Repository navigation
Conversation
`tl.math.umulhi` was patched both as a frontend (`tl.math`) op and, as `create_umulhi`, as an interpreter-builder op. A client that overrides `Umulhi`, such as the sanitizer or the race detector, reached the frontend patch first, and `run_op_overrider` raised "Patching math ops not yet supported" for it. Every kernel that calls `tl.rand`, `tl.randn`, or `tl.randint` failed this way, because their Philox rounds call `tl.umulhi`. `tl.math.umulhi` calls the builder's `create_umulhi`, whose patch already dispatches to the clients, so the frontend patch is removed. 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
Every kernel that calls
tl.rand,tl.randn, ortl.randintfails under the sanitizer and the race detector:Their Philox rounds call
tl.umulhi.TRITON_NAMESPACESregisteredUmulhitwice: as the frontend optl.math.umulhiand as the interpreter-builder opcreate_umulhi. A client that overridesUmulhireached the frontend patch first, andrun_op_overriderraised for everytl.mathop.tl.math.umulhicalls the builder'screate_umulhi, whose patch already dispatches to the clients (SymbolicClient._op_umulhi_overridertakes builder handles), so this PR removes thetl.mathentry and the branch that raised.Tests
tests/end_to_end/test_sanitizer.py:test_sanitizer_supports_tl_rand, a kernel that storestl.rand(seed, offs)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