RDNA-aware autotune configs for the INT8 matmul kernels#69
RDNA-aware autotune configs for the INT8 matmul kernels#69liminfei-amd wants to merge 2 commits into
Conversation
The two INT8 matmul kernels ship 6 NVIDIA-tuned autotune configs (num_stages=3-4). On AMD RDNA, num_stages=2 with deeper block_k is faster. Add _int8_autotune_configs() which returns an RDNA-tuned pool when torch.version.hip is set and keeps the NVIDIA config list unchanged for CUDA. INT8 GEMM is int32-exact, so this changes speed only. Fixes Comfy-Org#68 Signed-off-by: liminfei-amd <91481003+liminfei-amd@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughChangesINT8 autotuning configuration
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thanks for merging Comfy-Org/ComfyUI#14862 (default-enabling the Triton backend on ROCm) — much This PR is the companion on the kernel side: it tunes the INT8 matmul autotune configs for RDNA |
|
What about add waves_per_eu into the configs? gfx1103 is a apu, limited by memory bandwidth, dgpu may need to use different configs. |
Occupancy tuning via waves_per_eu helps on bandwidth-limited RDNA APUs (gfx1103/gfx1151: up to ~1.15x); dGPUs autotune-select the existing base configs (within noise). Added as an autotune dimension rather than hardcoding per-model configs. Thanks to @LuXuxue for the suggestion. Signed-off-by: liminfei-amd <91481003+liminfei-amd@users.noreply.github.com>
|
Thanks @LuXuxue! I checked |
|
I know this might not be the place to ask this but your recent change in comfyui's enabling triton backend for ROCM Comfy-Org/ComfyUI#14862 totally killed the int8 model usage for me. RDNA2, triton-windows 3.7.1.post27. I was using comfy without triton-backend and with custom node everything worked perfectly now neither native load diffusion model nor the custom node works, comfy just freezes and only a reset helps. |
What
The two INT8 matmul kernels ship 6 NVIDIA-tuned autotune configs (
num_stages=3–4,block_n=256).On AMD RDNA,
num_stages=2with deeperblock_kis faster. This adds_int8_autotune_configs(),which returns an RDNA-tuned pool when
torch.version.hipis set and keeps the NVIDIA list unchangedfor CUDA. Both kernels share the resulting
_INT8_MATMUL_CONFIGS.Why it's safe
@triton.autotuneblocks in the package).torch.version.hipgate).Perf & testing
~1.03–1.11× per shape on gfx1100 (RDNA3) and gfx1201 (RDNA4).
pytest tests/test_int8.py→37 passed / 5 cuda-only failures on AMD (unchanged).
Fix: #68