Add a narrow tile candidate for small ROCm INT4 matmuls - #22850
mergennachin wants to merge 2 commits into
Conversation
Offer a 16-column tile for ROCm queries with M=1..4 to increase parallelism. Retain every existing candidate so export-time autotuning can choose for the target GPU rather than imposing the MI300X choice. CUDA and other query sizes keep their existing candidate set; kernel arithmetic and the runtime are unchanged. Validated with 46 focused tests, lintrunner, and full Voxtral W4/BF16 PTE exports executed by the native C++ runner on Linux MI300X. Inference on 30 seconds of audio improved from 12.270 to 7.332 seconds, and on 360 seconds from 156.649 to 97.771 seconds, with identical transcripts and matching token counts. The added candidate also compiled for representative RDNA2/3/4 targets and gfx950; those GPUs were not execution-tested. ROCm 7.1 remains unverified. Lint was run directly because the pre-commit bootstrap cannot build its untokenize dependency under Python 3.14. Authored with assistance from OpenAI Codex.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22850
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 Pending, 1 Unclassified FailureAs of commit 0e64460 with merge base 026ca3f ( UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
There was a problem hiding this comment.
🔵 Needs a closer look
ROCm 7.1 and several target GPUs were not execution-tested, warranting final human review.
Pull request overview
Adds a ROCm-specific narrow INT4 matmul tile for small query sizes while preserving existing candidates.
Changes:
- Adds conditional autotune pruning for ROCm
M=1–4. - Adds configuration and small-shape correctness tests.
File summaries
| File | Description |
|---|---|
backends/cuda/triton/kernels/int4_matmul.py |
Adds the narrow tile and ROCm-specific candidate selection. |
backends/cuda/tests/test_int4_matmul.py |
Tests pruning behavior and small matmul shapes. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@claude Report the result of [test-voxtral-realtime-rocm-gfx1100-rocm7.2] when it finishes. I am especially interested in rtf result in the log (find a line that starts with "Voxtral RTF") |
| needs: [voxtral-run-decision] | ||
| if: | | ||
| false && needs.voxtral-run-decision.outputs.run-gfx1100 == 'true' && | ||
| needs.voxtral-run-decision.outputs.run-gfx1100 == 'true' && |
There was a problem hiding this comment.
don't land this FYI, we should update this to be on manual trigger only TBH

Offer a 16-column tile for ROCm queries with M=1..4 to increase parallelism. Retain every existing candidate so export-time autotuning can choose for the target GPU rather than imposing the MI300X choice. CUDA and other query sizes keep their existing candidate set; kernel arithmetic and the runtime are unchanged.
Validated with 46 focused tests, lintrunner, and full Voxtral W4/BF16 PTE exports executed by the native C++ runner on Linux MI300X. Inference on 30 seconds of audio improved from 12.270 to 7.332 seconds, and on 360 seconds from 156.649 to 97.771 seconds, with identical transcripts and matching token counts. The added candidate also compiled for representative RDNA2/3/4 targets and gfx950; those GPUs were not execution-tested. ROCm 7.1 remains unverified.
Lint was run directly because the pre-commit bootstrap cannot build its untokenize dependency under Python 3.14.
Authored with assistance from OpenAI Codex.