Repository navigation
Load native FP4 experts with optional lossless CSF scales - #964
voipmonitor wants to merge 4 commits into
Conversation
Stage expert scale parameters on the CPU, compress through the ordinary B12X preparation API, and release source scales. Scope serialized reconstruction scratch to each model. VLLM_B12X_MOE_FP4_CSF defaults to zero and does not change expert activation precision. Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: Martin Vit <martin@voipmonitor.org>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: Martin Vit <martin@voipmonitor.org>
Apply the same bounded scale staging policy to the compressed-tensors MoE loader when B12X online CSF is enabled. Weight packing and default GPU scale allocation remain unchanged. The generic Kimi MXFP4 path already uses this policy. Validation: six focused GPU staging and ownership tests; repository pre-commit hooks. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Martin Vit <martin@voipmonitor.org>
Explain per-rank preparation and the normalized mxfp4 loader without introducing an encoder thread setting. Link component and full-model startup evidence. Documentation pre-commit checks pass. Signed-off-by: Martin Vit <martin@voipmonitor.org>
VLLM_B12X_MOE_FP4_CSF=1loads ordinary native MXFP4/NVFP4 expert checkpoints with lossless CSF scale storage. The standard safetensors loader stages scale parameters on the CPU, prepares one layer on the GPU, and releases the original scale tensors. Model-scoped shared scratch avoids retaining full scale planes for every layer. The flag defaults to0; checkpoint files, dense-layer quantization, and expert activation precision retain their existing behavior.Scale staging covers the native MXFP4, ModelOpt NVFP4, and compressed-tensors MXFP4 loaders. Kimi normalizes its native metadata to the
mxfp4handler and uses--quantization mxfp4. Default compressed-tensors scale placement remains on the GPU when online compression is disabled.This stacks on #956 and adds native-checkpoint preparation; it does not duplicate #956's stored-CSF loader or #963's beta import. It requires paired B12X #458. PP1/DP1, no EP/EPLB, and serialized execution are required; unsupported overlap is rejected. TP workers compress independently, and GPU preparation requires no extra thread setting.
Implemented and qualified for the tested staging, ownership, and bounded startup contracts:
python -m pytest --confcutdir=tests/kernels/moe tests/kernels/moe/test_b12x.py -k 'compressed_tensors_mxfp4_preserves or online_csf' -xq: 6 GPU cases passed, including source-scale release, scratch lifetime/isolation, and enabled/disabled compressed-tensors placement.Real DS4.1 TP4 (384 experts) and Qwen TP1 (512 experts), both projections of layer 3, pass exact source-byte reconstruction and baseline encoded-plane comparisons. Qwen also matches the complete CPU-index prepared storage. Eight balanced warm cycles measure Qwen encoding plus index at 105.394 → 2.923 ms (36.06x) and DS4.1 encoding at 2.833 → 2.834 ms (1.00x). DS4.1 uses 160/18 scale columns per row, so the at-most-eight-column MXFP4 optimization does not apply. These component timings are research-only under NVML
0x400, RTX PRO 6000 Blackwell, 600 W, memory 16,365 MHz. Complete DS4.1/Qwen startup receipts cover the separately pinned loading implementation; whole-model startup after the GPU-index change was not repeated.Full-model KLD and full-vocabulary logit parity are unmeasured. Full-model GLM responses differ even between unchanged control launches; byte/component oracles establish exactness. Encoding timings are research-only under NVML event mask
0x400, and do not claim improved decode throughput or equal I/O/compiler-cache history.Preparation measurements and exact runtime identities separate component speedups from complete startup. Native loading/serving evidence also records Qwen TP1/MTP3 and DS4.1 TP4/no-spec loading, serving comparisons, and configuration limits.
AI assistance: implemented, reviewed, and tested with OpenAI Codex at the repository owner's request. Human review has not been represented as complete.