Repository navigation
Conversation
`x.to(tl.float8e5, fp_downcast_rounding="rtne")` passes an `ir.ROUNDING_MODE` enum to the builder's `create_fp_to_fp`. The symbolic engine stored it as a child expression, and `SymbolicExpr.from_value` raised "Unsupported type: <class 'triton._C.libtriton.ir.ROUNDING_MODE'>". The child now holds the enum's integer value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Performance Benchmark
Iterations: 1 warmup + 20 measured |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A downcast with an explicit rounding mode, such as
x.to(tl.float8e5, fp_downcast_rounding="rtne"), fails under the sanitizer and the race detector:The builder's
create_fp_to_fpreceives anir.ROUNDING_MODEenum.FpToFpSymbolicExpradded it as a child expression, andSymbolicExpr.from_valuecannot infer a dtype for the enum. The child now holds the enum's integer value, so it is an ordinary constant and still distinguishes the two rounding modes insignature().Tests
tests/end_to_end/test_sanitizer.py:test_sanitizer_supports_fp_downcast_rounding, an fp32 to fp8e5 cast withfp_downcast_rounding="rtne"under the sanitizer. It fails on main with the error above.pytest tests/: 366 passed, 6 skipped on main; 367 passed, 6 skipped with this PR (Python 3.12, Triton 3.8.0).ruff checkandruff format --check(v0.1.9) pass on the changed files.🤖 Generated with Claude Code