Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow triton==3.0.x for fp_quantizer #6447

Merged
merged 3 commits into from
Aug 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions op_builder/fp_quantizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,27 @@ def is_compatible(self, verbose=False):
import triton
except ImportError:
if verbose:
self.warning(f"please install triton==2.3.0 or 2.3.1 if you want to use the FP Quantizer Kernels")
self.warning(
f"please install triton==2.3.0, 2.3.1 or 3.0.0 if you want to use the FP Quantizer Kernels")
return False

# triton 2.3.0 and 2.3.1 are okay and the only versions released in 2.3.x before 3.x was released
# triton 2.3.{0,1} and 3.0.0 are ok.
allowed_versions = ("2.3", "3.0")
if pkg_version:
allowed = pkg_version.parse("2.3")
allowed = (pkg_version.parse(v) for v in allowed_versions)
installed_triton = pkg_version.parse(triton.__version__)
triton_mismatch = installed_triton.major != allowed.major or installed_triton.minor != allowed.minor
triton_mismatch = all(installed_triton.major != a.major or installed_triton.minor != a.minor
for a in allowed)
else:
installed_triton = triton.__version__
major, minor, _ = installed_triton.split(".")
triton_mismatch = major != "2" or minor != "3"
allowed = (v.split(".") for v in allowed_versions)
triton_mismatch = all(major != v[0] or minor != v[1] for v in allowed)

if triton_mismatch:
if verbose:
self.warning(
f"FP Quantizer is using an untested triton version ({installed_triton}), only 2.3.0 and 2.3.1 are known to be compatible with these kernels"
f"FP Quantizer is using an untested triton version ({installed_triton}), only 2.3.{0,1} and 3.0.0 are known to be compatible with these kernels"
)
return False

Expand Down
Loading