Repository navigation
[BugFix] Skip marlin backend for fp4 on SM100 (Blackwell) - fixes #43988 - #44091
Asthenia0412 wants to merge 2 commits into
Conversation
…nd for fp4 on SM100 (Blackwell)
FP4 Marlin is weight-only (W4A16) and does not support W4A4 GEMM.
FlashInfer's mm_fp4 rejects backend='marlin' on SM100+ with:
BackendSupportedError: mm_fp4 does not support backend 'marlin' with capability 100
When the user explicitly passes --fp4-gemm-backend marlin on Blackwell GPUs,
or auto-selection unexpectedly chooses marlin, fall back to flashinfer_cutedsl
(SM100) or flashinfer_cutlass (other SM12x) with a clear warning.
Fixes: #43988
Signed-off-by: yancy <yancy@users.noreply.github.com>
|
@merrymercy 麻烦帮忙 review 一下 🙏 |
|
Hi @Asthenia0412, thanks for working on this! I'd been looking at the same issue and noticed a couple of things that might be worth considering: ModelOpt NVFP4 + Marlin on Blackwell. Since A possibly narrower fix. Now that #40022 is merged, if is_fp4a4_nvfp4_supported and not get_fp4_gemm_runner_backend().is_marlin():
return CompressedTensorsW4A4Fp4()
# otherwise fall through to the existing weight-only Marlin fallback(The fallback's warning text would need a tweak for the explicit-request case.) Happy to help if useful. What do you think? |
Signed-off-by: yancy <yancy@users.noreply.github.com>
|
🤖 CI gating notice: This PR's checks ( |
|
Thanks for your interest in SGLang. This account opened 16 PRs in about eight hours, across unrelated subsystems (attention backends, speculative decoding, diffusion loading, scheduler IPC, KV-cache compression, docs), including two PRs for the same change (#44073 and #44117, both for #28808) and a fix for #43929 that is already on main. We can't review contributions at this volume, so we are closing the ones still open. If you want to pursue one, please pick a single change, verify it on a real run (a repro, a test, or numbers), and open a fresh PR. |
Summary
Fix issue #43988:
--fp4-gemm-backend marlincrashes with NVFP4 W4A4 checkpoints on SM100.Root Cause
FP4 Marlin is a weight-only (W4A16) backend; it does not support W4A4 GEMM.
When a user explicitly passes
--fp4-gemm-backend marlinon Blackwell (SM100+)GPUs, FlashInfer's
mm_fp4raises:The existing
automode already picksflashinfer_cutedslon SM100, so thecrash only happens with an explicit user override of the fp4 GEMM backend.
Fix
In
initialize_fp4_gemm_config()(python/sglang/srt/layers/quantization/fp4_utils.py),after both auto-selection and explicit user input have been resolved, check whether
the chosen backend is
marlinon a Blackwell GPU. If so, fall back to the correctFlashInfer dense-GEMM backend (
flashinfer_cutedslfor SM100+ orflashinfer_cutlassfor other SM12x) and emit a clear warning explaining the situation.
This guarantees that no code path can pass
backend='marlin'into FlashInfer'smm_fp4on unsupported hardware.Testing
--fp4-gemm-backend marlin— the server now starts cleanly, auto-falls back to
flashinfer_cutedsl, andlogs the expected warning.
autostill picksflashinfer_cutedslon SM100,marlinon SM80-SM90, andflashinfer_cutlasselsewhere.Fixes: #43988
Signed-off-by: yancy yancy@users.noreply.github.com
CI States
Latest PR Test (Base): ❌ Run #38445301324
Latest PR Test (Extra): ❌ Run #38445300993
Latest PR Test (AMD ROCm 10): ❌ Run #38445301205