Add maxnreg autotuning to Mamba-3 Triton kernels#905
Merged
Conversation
ChrisLundquist
added a commit
to ChrisLundquist/mamba
that referenced
this pull request
Apr 12, 2026
Triton's HIP backend does not recognize the maxnreg keyword argument (added for NVIDIA in PR state-spaces#905), raising: KeyError: 'Keyword argument maxnreg was specified but unrecognised' Add _maxnreg() helper that returns {} on HIP and {maxnreg: value} on CUDA, and use **_maxnreg(r) in all autotune Config constructors. Verified on AMD RX 9070 XT (gfx1201): - All math utils: PASS (cos/sin err=0, tanh err=1.8e-7) - mamba3_siso_fwd kernel: PASS - angle_dt_fwd kernel: PASS - mamba3_siso_combined pipeline: PASS - Forward throughput: 3.9M tok/s at seqlen=1024 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 tasks
ChrisLundquist
added a commit
to ChrisLundquist/mamba
that referenced
this pull request
Apr 12, 2026
Triton's HIP backend does not recognize the maxnreg keyword argument (added for NVIDIA in PR state-spaces#905), raising: KeyError: 'Keyword argument maxnreg was specified but unrecognised' Add _maxnreg() helper that returns {} on HIP and {maxnreg: value} on CUDA, and use **_maxnreg(r) in all autotune Config constructors. Verified on AMD RX 9070 XT (gfx1201): - All math utils: PASS (cos/sin err=0, tanh err=1.8e-7) - mamba3_siso_fwd kernel: PASS - angle_dt_fwd kernel: PASS - mamba3_siso_combined pipeline: PASS - Forward throughput: 3.9M tok/s at seqlen=1024 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Add
maxnreg(max register count) as an autotuning dimension ([None, 128, 256]) to all Mamba-3 SISO forward and backward Triton kernels; On SM100 (Blackwell/B200/B300), the Triton compiler may default to a low register count (e.g. 32 or 168 out of 255 available) whenmaxnregis unspecified, causing excessive register spilling