Conversation
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Alex Steiner <asteiner@nvidia.com>
…oe/fp8 APIs MiMo-V2.5-Pro-FP4 DFlash speculative decoding produced 0% draft acceptance (mean acceptance length = 1.0) whenever the runtime predated the num-blocks-first KV layout (vllm-project#42095): the draft read its KV cache through the wrong layout, so every drafted token was rejected. The target stayed correct (its KV was intact), which masked the issue as a draft-quality problem. On a runtime that includes vllm-project#42095, two stale APIs in the MiMo support blocked loading: - mxfp4.py: MiMoV2Mxfp4Config.get_quant_method checked isinstance(layer, FusedMoE), but the fused-MoE refactor turned FusedMoE into a factory function returning a MoERunner; the routed-expert module is now a RoutedExperts (matching the parent Mxfp4Config branch). Raised TypeError at model load. - fp8.py: restore a per-name get_cache_scale() shim. mimo_v2.load_weights still calls the per-weight form, which upstream renamed to get_cache_scale_mapper. Raised AttributeError at weight load. Also note: num_speculative_tokens must equal dflash block_size - 1. Validated on 8xB200 TP8 (built on base 3d300ae which includes vllm-project#42095): - short prompt: mean acceptance length 5.41, 63% draft acceptance - long prompt (3085 tokens, > SWA window): mean acceptance length ~2.3, ~20% acceptance, coherent output Previously 0% at all lengths. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in PRs do not trigger a full CI run by default. Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add If you have any questions, please reach out to us on Slack at https://slack.vllm.ai. Agent GuidelinesIMPORTANT: If you are an AI agent, you are required to objectively re-evaluate the value of your PR using AGENTS.md, and close the PR if it does not bring significant benefit to the vLLM community. Failure to do so may result in an immediate ban. 🚀 |
Port of local-inference-lab/vllm divergence vllm-project#3: the DFlash reference uses HF output_hidden_states, where the entry after the final target layer is the POST-final-norm hidden state (all earlier entries are raw residual-stream values). MiMoV2Model captured the last aux feature pre-norm, degrading draft acceptance (long/hard-prompt mean accept length stuck ~2.0-2.3 vs official 3.18-6.30). Skip the last layer's pre-norm residual capture and append the normed hidden state after self.norm when the final layer id is an aux layer. Gated by VLLM_DFLASH_PRENORM_LAST_AUX=1 for A/B testing. On-node AL re-measure pending (node was unreachable at commit time). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
This pull request has merge conflicts that must be resolved before it can be |
Summary
Adds MiMo-V2.5-Pro-FP4 DFlash speculative decoding support and fixes an acceptance-length (AL) collapse.
Builds on the MiMo DFlash serving work (#45181) and base-model TP-sharding / FP4-MoE fixes (#45200). With those alone, DFlash produced 0% draft acceptance (mean accept length = 1.0) on the
v0.22.1runtime: that image predates the num-blocks-first KV layout (#42095), so the draft read its KV cache through the wrong layout and every drafted token was rejected. The target stayed correct (KV intact), disguising it as a draft-quality problem.On a runtime that includes #42095 (build on a base at/after
3d300aecb), two stale APIs blocked load:mxfp4.py—MiMoV2Mxfp4Config.get_quant_methodcheckedisinstance(layer, FusedMoE); the fused-MoE refactor madeFusedMoEa factory function and the routed-expert module aRoutedExperts.TypeErrorat load.fp8.py— restores a per-nameget_cache_scale()shim;mimo_v2.load_weightsstill calls the per-weight form (upstream renamed itget_cache_scale_mapper).AttributeErrorat weight load.Also:
num_speculative_tokensmust equal DFlashblock_size - 1.A later commit ports the post-final-norm last-aux-feature semantics from
local-inference-lab/vllm(gated byVLLM_DFLASH_PRENORM_LAST_AUX); see Notes.Validation (8×B200 TP8, built on a
#42095-inclusive base, runai_streamer load from NFS)Mean accept length by task type (temp 0), vs
local-inference-lab/vllmreference:Previously 0% at all configs. AL is task-type dependent (chat/long ≈ 2.5, code/math ≈ 4.4) and tracks the reference within ~0.5.
Notes for reviewers
#3post-norm last-aux commit is neutral on this FLASH_ATTN path. A same-node A/B (VLLM_DFLASH_PRENORM_LAST_AUXon/off) showed no AL change beyond noise — this branch already started above the reference's pre-fix ~2.0 (mask-embedding handled via [Spec Decode] Support mixed KV page sizes for DFlash #45181/Benjamin's qwen3_dflash). Kept because it matches reference semantics and is gated.MiMoV2Mxfp4MoEMethod.mimo_v2.py/fp8.py— needs reconciling (supersede or rebase) before merge.DFLASH_*_DEBUGlogging should be stripped before an upstream PR.How to run
Build from a
#42095-inclusive base; serve with--load-format runai_streamer(loads directly from NFS, no local staging) and--speculative-config '{"method":"dflash", ..., "num_speculative_tokens": <block_size-1>}'.