moe_w2: loader-level skip — boot DeepSeek-V4-Flash from the pack / planes cache without re-staging - #16
Open
anoane wants to merge 2 commits into
Open
Conversation
added 2 commits
July 19, 2026 03:53
…aging Regenerate the distribution patch from the fork branch with the moe_w2 loader-skip: when a DeepSeek-V4-Flash layer is already served by the pack store (VLLM_MOE_W2_STORE_DIR) or the GPU-resident planes cache (VLLM_MOE_W2_PLANES_CACHE), skip the host-RAM checkpoint staging entirely and serve the 2-bit planes straight from the cache — no per-boot re-quant, no ~51 GiB staging transient, no swap on a small single-GPU host. Touches only mxfp4.py (create_weights: gate the per-expert staging on plan_pack_skip; use the create-time build key) and moe_w2_cubit.py (build_layer_planes: consume the pack / planes cache when a layer was loader-skipped, mirroring build_layer_planes_nvfp4). FILES.txt unchanged. SOURCE.txt advanced to the fork commit carrying the change.
…g B + HF cache Add a single-card (96 GB, SM120) serving block that boots straight from the planes cache via the loader-skip: config A (max quality — 6 GiB FP4 pool, MTP off, min_p, ~75 tok/s @ 256K, fills the card) and config B (throughput — no pool, with an MTP-on/off concurrency guide: MTP k=2 wins for few streams / latency, peaks ~1122 @ C=64; MTP off scales monotonically to ~2085 @ C=256). Full docker + vLLM commands, every env/flag with its measured justification, a needle-in-a-haystack section (recommended 256K, absolute-max boots-only, pool-vs-retrieval tradeoff), and a link to the prebuilt ~588 GB cache on Hugging Face.
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.
What
Wire the existing
moe_w2loader-skip into the 2-bitMxfp4MoEMethodpath, so a DeepSeek-V4-Flash layer already served by the pack store (VLLM_MOE_W2_STORE_DIR) or the GPU-resident planes cache (VLLM_MOE_W2_PLANES_CACHE) boots straight from the cache — no per-boot re-quant of the 149 GB fp8 checkpoint, no host-RAM staging, no swap.Why
Stock behaviour stages every expert of every layer into host RAM before building the 2-bit planes — a ~51 GiB transient that forces swap (and multi-minute boots) on a small single-GPU host, on every start. The loader-skip already exists for the nvfp4 path (
build_layer_planes_nvfp4/ModelOptNvFp4FusedMoE.create_weights); this extends the same skip to the 2-bit path so the planes cache / pack is actually used to boot.How
Two files, mirroring the existing nvfp4 skip:
mxfp4.pyMxfp4MoEMethod.create_weights: gate the per-expert CPU staging onnot moe_w2_cubit.plan_pack_skip(layer); use the create-time build key so the pack sidecar probe and the plane build agree on the layer index.moe_w2_cubit.pybuild_layer_planes: when a layer was loader-skipped (_moe_w2_pack_skip), take the shapes from the create-time stash and serve the planes from the pack (_try_skip_requant) or the planes cache (_consume_planes_cache) instead of reading the never-staged checkpoint.No new env vars — both paths reuse the
STORE_DIR/PLANES_CACHEmachinery already wired for nvfp4. On a pack miss (genuine first boot) the classic all-layers staging path is unchanged.Patch / fingerprints
patch/vllm-moet-v0.24.0.patchregenerated from the fork branch (current base0fd0e145+ this change).patch/FILES.txtunchanged (same files touched);patch/SOURCE.txtadvanced to the fork commit carrying the change.README
Adds one single-card block under DeepSeek-V4-Flash — 1x RTX 6000 Pro (96 GB, SM120):
min_p=0.05, ~75 tok/s @ 256K, fills the card.Full docker + vLLM commands, every env/flag justified, a needle-in-a-haystack section (recommended 256K, absolute-max boots-only with warnings, pool-vs-retrieval tradeoff), and a link to the prebuilt cache on Hugging Face.
Prebuilt cache
The ~588 GB planes cache + FP4 packs are published so you can boot without re-quantizing: https://huggingface.co/anoane/DeepSeek-V4-Flash-vllm-moet-sm120-cache (mount
planescache/->/planescache,moet_store/->/store; the model config/tokenizer still comes fromdeepseek-ai/DeepSeek-V4-Flash).Testing
git apply --check patch/vllm-moet-v0.24.0.patchon thev0.24.0tag: clean.py_compileclean; the applied result is byte-identical to the fork commit.