Conversation
|
@hnyls2002 @SubSir Could you please review this quantized-target follow-up to #35371? It routes DFlash2 selector candidate projection through the target |
|
Great fix — this is exactly the crash I hit. One question on the validation target: does the "ModelOpt NVFP4 Qwen3.8-27B" target you tested include activation quantization (W4A4), or is it weights-only NVFP4 (W4A16)? I ask because I ran the same quant_method.apply eager approach (ported from r0b0tlab/qwen38-27b-nvfp4-sm121-sglang, which validates against W4A16) against the |
|
No description provided. |
|
@abdulchotu7 Thanks for checking. The target I validated was W4A4, not weights-only W4A16. The ModelOpt-exported checkpoint uses group-size-16 NVFP4 for the MLP The successful runtime validation used that ModelOpt export at TP=2. Since your failure used the RadixArk checkpoint at TP=1, the difference may be checkpoint metadata/loader behavior or something in the ported patch rather than missing W4A4 coverage. Could you share the exact traceback and SGLang commit/branch? I’d be happy to compare the failing path. |
|
Superseded by #35496, which has been merged. Thanks! |
Summary
lm_head.quant_method.applywhen the target head is quantized.Motivation
DFlash2 borrows the target model's
lm_headto build its selector candidates. A ModelOpt NVFP4 target stores that head as packed weights, so treating.weightas a dense FP16/BF16 matrix either fails the dense-head guard or produces a shape mismatch.The DFlash worker already keeps a quantized selector head on the eager path instead of folding its static matrix multiplication into the draft CUDA graph. This change makes that eager fallback functional by using the same
should_apply_lm_head_quant_methoddispatch as the target logits path. Dense heads retain the existing sliced matrix multiplication, and TP still communicates only local top-k values and IDs.This is a quantized-head follow-up to #35371. Related fixes use the same dispatch pattern in #30119 and #34742.
Validation
pre-commit run --files python/sglang/srt/models/dflash.py test/registered/unit/spec/test_dflash_logits.pyPYTHONPATH=python python -m pytest -q test/registered/unit/spec/test_dflash_logits.py(4 passed)compute_candidatespath was validated with a ModelOpt NVFP4 Qwen3.8-27B target and Qwen3.8-27B-DFlash2 draft at TP=2. The server completed target and draft CUDA graph capture, kept the quantized selector head eager as intended, served a smoke request, and completed 1000/1000, 50000/400, and 97000/3000 workloads at concurrency 1, 4, and 8.Behavior note
This PR adds functional quantized-head support to the DFlash2 selector. It does not fold the quantized selector projection into the draft CUDA graph; that remains a separate optimization opportunity.
CI States
Latest PR Test (Base): ❌ Run #32231149827
Latest PR Test (Extra): ❌ Run #32231149622