Repository navigation
Conversation
…ace) for MXFP4 Marlin MoE + sparse MLA Triton fallback Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
xs-alt
requested review from
Alisehen,
AniZpZ,
BBuf,
Edwardf0t1,
FlamingoPg,
Fridge003,
HaiShaw,
OrangeRedeng,
Qiaolin-Yu,
b8zhong,
ch-wan,
hebiao064,
ispobock,
merrymercy and
mmangkad
as code owners
August 7, 2026 03:53
3 of 5 tasks
Contributor
|
Thanks @xs-alt. Closing this because it has had no updates in 91 days. Reopen it if the work is still relevant. Some directories moved recently, so an older branch may need retargeting: |
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.
SGLang's MXFP4 Marlin MoE path and DSV4 sparse MLA backend were gated to SM90 (Hopper) and SM120 (Blackwell), leaving Ada Lovelace GPUs (SM89 — RTX 4090 / L4 /L40S / L20) unable to run DeepSeek-V4-Flash via the W4A16 Marlin path. The only fallback on SM89 was load-time FP4→FP8 dequant, which materializes a full FP8 weight copy on every TP shard and OOMs at TP8 on a single 8× RTX 4090 (24 GB) node.
This PR relaxes the software hardware-gate so SM89 takes the existing Marlin + Triton sparse MLA fallback path. No new kernels are introduced; we enable pre-existing code paths that the original authors restricted to SM90/SM120 purely for testing scope, not a hard hardware limitation. The underlying Marlin MoE kernel (moe_wna16_marlin.cuh) only guards on CUDA_ARCH >= 800, and SM89 (8.9) passes that guard.
Modifications
Six files, +94 / −10 lines:
_build_mega_moe_weights gate from is_sm90_supported() OR is_sm120_supported() to also accept is_sm89_supported(). Update the import block and the RuntimeError message.
Accuracy Tests
Hardware: 8 × RTX 4090 (24 GB, SM89), --tp-size 8 --moe-runner-backend marlin. CUDA graph capture bs=[1,2,4].
Speed Tests and Profiling
Hardware: 8 × RTX 4090 (24 GB, SM89), --tp-size 8 --moe-runner-backend marlin --cuda-graph-max-bs-decode 4 --mem-fraction-static 0.91, Triton sparse MLA via SGLANG_SM120_FLASHMLA_BACKEND=triton.
SGLANG_SM120_FLASHMLA_BACKEND=triton
python3 -m sglang.launch_server
--model-path deepseek-ai/DeepSeek-V4-Flash-0731
--tp-size 8
--moe-runner-backend marlin
--host 0.0.0.0 --port 30000
--mem-fraction-static 0.91
--cuda-graph-max-bs-decode 4
--max-running-requests 12
--trust-remote-code
CI States
Latest PR Test (Base): ❌ Run #31145732652
Latest PR Test (Extra): ❌ Run #31145732474