Skip to content

[AMD] Select Quark MXFP4 dense GEMM via --fp4-gemm-backend aiter|triton - #43360

Draft
vorapolsiloai wants to merge 2 commits into
sgl-project:mainfrom
vorapolsiloai:feat/cli-fp4-gemm-backend-aiter-triton
Draft

vorapolsiloai wants to merge 2 commits into
sgl-project:mainfrom
vorapolsiloai:feat/cli-fp4-gemm-backend-aiter-triton

Conversation

@vorapolsiloai

@vorapolsiloai vorapolsiloai commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #39598 as requested in review: extends the existing --fp4-gemm-backend CLI argument to support aiter and triton on ROCm, removing the need for a separate environment variable (SGLANG_ROCM_USE_AITER_FP4_ASM_GEMM).

  • Add 'aiter' (AITER CK/ASM gemm_a4w4 with preshuffled weights on gfx95) and 'triton' (AITER Triton gemm_afp4wfp4) to Fp4GemmRunnerBackend and valid choices.
  • On ROCm, --fp4-gemm-backend auto maps to triton to keep existing baseline behavior unchanged.
  • QuarkW4A4MXFP4 reads the resolved backend at initialization instead of inspecting environment variables at import time.
  • Deprecates SGLANG_ROCM_USE_AITER_FP4_ASM_GEMM with a clear deprecation warning when --fp4-gemm-backend is unset (auto).
  • Updates documentation in server_arguments.mdx and quantization.mdx.
  • Adds unit tests in test_quark_mxfp4_asm.py.

Stack: Depends on #39598.


CI States

Latest PR Test (Base): ❌ Run #37920891223
Latest PR Test (Extra): ❌ Run #37920890866
Latest PR Test (AMD ROCm 10): ❌ Run #37920891326

Quark W4A4 MXFP4 dense linear layers on ROCm always call AITER's Triton
gemm_afp4wfp4, so they cannot use the a4w4_blockscale_tuned_gemm CSV tables
that AITER gemm_a4w4 and vLLM share. Add an opt-in path that does.

- Add SGLANG_ROCM_USE_AITER_FP4_ASM_GEMM (Envs, default off) for gfx95
- Preshuffle FP4 weights and E8M0 weight scales once after loading
- Quantize activations with AITER's shuffled per-1x32 FP4 quantizer
- Dispatch through gemm_a4w4 so model-specific tuned CSV entries apply
- Keep the Triton path for layers whose scale shape cannot be swizzled
- Reject Quark tuple-input fusion projections while the flag is on
Replace the SGLANG_ROCM_USE_AITER_FP4_ASM_GEMM switch with two ROCm
choices on the existing --fp4-gemm-backend flag, as requested in review.

- Add 'aiter' (gfx95 only; AITER CK/ASM gemm_a4w4 with preshuffled
  weights and the a4w4 tuned CSVs) and 'triton' (AITER Triton
  gemm_afp4wfp4) to FP4_GEMM_RUNNER_BACKEND_CHOICES and the
  Fp4GemmRunnerBackend enum
- Resolve the flag for ROCm in initialize_fp4_gemm_config: 'auto' maps
  to 'triton', so the AITER path stays opt-in; 'aiter' off gfx95 and
  'aiter'/'triton' off ROCm raise at startup
- QuarkW4A4MXFP4 reads the resolved backend at construction instead of
  the env var at import
- Deprecate SGLANG_ROCM_USE_AITER_FP4_ASM_GEMM: still honored with a
  DeprecationWarning while the flag is 'auto', ignored with a warning
  when the flag is set explicitly
- Document the new choices in server_arguments.mdx and quantization.mdx
@github-actions github-actions Bot added documentation Improvements or additions to documentation quant LLM Quantization labels Oct 9, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation quant LLM Quantization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant