Repository navigation
[KK] NVFP4-CSF: expand the next layer's scales during its attention - #979
Closed
voipmonitor wants to merge 2 commits into
Closed
voipmonitor wants to merge 2 commits into
voipmonitor wants to merge 2 commits into
Conversation
Layers of an NVFP4-CSF model share one scale scratch, and every eager prefill call expanded its experts' scales into it serially before its MoE (4% of a GLM-5.3 glm53-tp2 A4 prefill, with nothing overlapping). After a layer's MoE the method now expands the following layer's scales on a side stream, ordered after that MoE, and the following layer waits for it and binds with scales_expanded=True (b12x expand_scales). Only eager steps that expand - A4 prefill rows or A16 calls above the stage-read limit - prefetch; CUDA graph capture, decode-only steps and other forward passes are untouched, and any pending expansion is waited for before the scratch is used. VLLM_B12X_CSF_SCALE_PREFETCH=0 turns it off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 53c7474)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit fcad04e)
|
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 configuration
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 |
Author
|
Closing: superseded by Luke's reworked NVFP4-CSF scale prefetch in |
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.
Canonical twin of #978 (merged into the Karmic beta as
ff292a9c), onfeat/kk-fp4-csf. It needs b12xexpand_scales/bind(scales_expanded=...): local-inference-lab/b12x#478 on master's CSF chain (twin of b12x#477).After a layer's MoE,
Nvfp4CsfMoEMethodexpands the following layer's scales on a side stream, ordered after that MoE. The following layer waits for it and skips its own expansion, so the expansion overlaps the following layer's attention. A prefetch is used only by the next layer of the same forward pass; any pending expansion is waited for before the shared scratch is used; CUDA graph capture is untouched.VLLM_B12X_CSF_SCALE_PREFETCH=0turns it off.Differences from the beta commit: this base has no A4 prefill (#970/#977 are in #972), so a step prefetches when its call is above b12x's stage-read limit (A16 calls of more than 1,536 tokens). The A4 prefill-row case comes with #972. The test is adapted to match. The release fragment is byte-identical to the beta one.
Evidence (beta,
glm53-tp2, two RTX PRO 6000 Max-Q): A16 8K/32K prefill 7,672/7,925 → 7,763/8,058 tok/s; with A4 (beta only) 10,032/10,312 → 10,254/10,620. Decode unchanged; needle-checksum A16 498/495/497, A4 495/490/492.Tests:
tests/quantization/test_nvfp4_csf.py10 passed (one RTX PRO 6000, this branch's files over the beta image).ruff check/ruff format --check: clean.AI-assisted (Claude Code); reviewed and run by the submitter.
🤖 Generated with Claude Code