Repository navigation
[OMNIML-3853] Backfill checkpoint aliases for Kimi-K2.7-Code and the Gemma-4 MoE releases - #2647
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (6)
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review. 📝 WalkthroughWalkthroughThe change adds three model-specific NVFP4 recipe aliases that import existing general recipes. It documents the aliases and their published checkpoint names, and updates the published checkpoint reference in an existing Qwen recipe description. ChangesNVFP4 checkpoint aliases
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Merge Risk: ⚪ Minimal · up to The aliases and checkpoint references are internally consistent, with no demonstrated merge-blocking risk. 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2647 +/- ##
==========================================
+ Coverage 71.54% 78.06% +6.52%
==========================================
Files 640 638 -2
Lines 71316 71256 -60
==========================================
+ Hits 51020 55627 +4607
+ Misses 20296 15629 -4667
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Continues the 2026 published-checkpoint backfill. Each entry imports an existing general recipe wholesale; nothing is duplicated. moonshotai/Kimi-K2.7-Code general/ptq/nvfp4_experts_only_input_scale1-kv_fp8_cast google/gemma-4-26B-A4B-it general/ptq/nvfp4_experts_only-kv_fp8_cast google/diffusiongemma-26B-A4B-it general/ptq/nvfp4_experts_only-kv_fp8_cast Each engineer described the scheme in prose rather than naming a recipe file, so the mapping was checked against the published checkpoints before being recorded: - All three are NVFP4 with an FP8 KV cache, and every model card documents post-training quantization with no quantization-aware training or distillation. - Kimi-K2.7-Code's exported expert input_scale tensors are exactly 1.0, which is what the input_scale1 recipe produces by pinning amax to a constant 2688.0 (E2M1_MAX * E4M3_MAX); its shared experts and attention are excluded. That distinguishes it from the plain experts-only recipe, whose expert input scales are calibrated. - Both Gemma releases quantize only the routed experts -- dense MLPs, router, attention, vision tower and lm_head all appear in exclude_modules -- with calibrated expert input scales and no exported k_scale, i.e. KV cast mode. diffusiongemma nests its decoder under model.decoder.layers rather than model.language_model.layers, which the recipe's `*.experts.*` patterns match either way. Calibration is the one property a checkpoint cannot reveal, so it rests on what each engineer said: the Gemma pair used the default calibration, which is max. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Shengliang Xu <[email protected]>
The recipe reproduces nvidia/Qwen3.8-27B-NVFP4 -- ptq.md already says so -- but the recipe's own metadata.description did not, which makes it read like an unrelated AutoQuantize artifact when you encounter the file on its own. Every other checkpoint entry names the release it corresponds to, so an audit of backfill coverage that reads the recipes can miss this one. Verified the claim against the published checkpoint before asserting it: MLP gate/up/down_proj NVFP4, self_attn and linear_attn projections FP8, lm_head NVFP4, mtp excluded, no KV quantization, and the model card names local-Hessian calibration on 2,048 samples -- all matching this recipe, including the unusual NVFP4 lm_head. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Shengliang Xu <[email protected]>
553e45d to
71e3277
Compare
cjluo-nv
left a comment
There was a problem hiding this comment.
Bot review (bedrock-claude-opus-5-5) — DM the bot to share feedback.
Approve: this adds three thin YAML aliases that follow the established checkpoint-alias pattern, and both base recipes they import already exist.
No action needed.
No action needed:
- Design review was triggered because the diff spans 6 directories, but nothing new is being built. Each alias has the same
imports: base+$import: base+metadatashape as the mergedmodels/zai-org/GLM-5.1/ptq/nvfp4_experts_only_input_scale1-kv_fp8_cast.yaml. general/ptq/nvfp4_experts_only-kv_fp8_cast.yamlandgeneral/ptq/nvfp4_experts_only_input_scale1-kv_fp8_cast.yamlboth exist, so the imports resolve.- Licensing: the new files carry only the standard NVIDIA header, which matches
LICENSE_HEADERexactly. - Size: no source code changed, so this is well under the logic-line budget.
- Tests: no new test was added; the PR says the shipped-recipe sweep in
tests/unit/recipe/test_loader.pyloads every new alias. No existing tests changed. - The Qwen3.8-27B recipe edit only changes its description text.
|
#2769 #2770 #2719 #2796 #2801 #2794 #2787 #2682 #2793 #2791 #2792 #2766 #2823 #2777 #2773 #2813 #2832 #2795 #2684 #2822 #2838 #2807 #2772 #2837 #2820 (#2843) ## Cherry-picked PRs - #2647 - #2700 - #2718 - #2578 - #2580 - #2711 - #2731 - #2726 - #2697 - #2769 - #2770 - #2719 - #2796 - #2801 - #2794 - #2787 - #2682 - #2793 - #2791 - #2792 - #2766 - #2823 - #2777 - #2773 - #2813 - #2832 - #2795 - #2684 - #2822 - #2838 - #2807 - #2772 - #2837 - #2820 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Expanded quantized model export support for MXFP4, MXFP8, FP8, and additional block-quantization formats. * Added quantization support for GPT-OSS and Step-family models, plus export support for native FP8 experts. * Added chat JSONL data preparation for Megatron workflows and an option to freeze the student MTP head during distillation. * Added model recipes for Kimi, Gemma, DiffusionGemma, and GLM variants. * **Bug Fixes** * Improved ONNX quantization and export compatibility, distributed calibration consistency, and handling of packed attention caches. * Improved safe model loading and low-precision quantization accuracy. * **Documentation** * Updated the 0.48.0 changelog and guidance for data preparation and quantization recipes. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Also includes a partial backport of #2656 (only the `_validate_fold_weight` hook and the `mtq.fold_weight` pre-check), which #2820 depends on. --------- Signed-off-by: Shengliang Xu <[email protected]> Signed-off-by: Rohan Joshi <[email protected]> Signed-off-by: Juhi Mittal <[email protected]> Signed-off-by: Fridah-nv <[email protected]> Signed-off-by: Chenjie Luo <[email protected]> Signed-off-by: yingguo-trt <[email protected]> Signed-off-by: weimingc <[email protected]> Signed-off-by: Yue <[email protected]> Signed-off-by: joe-nv <[email protected]> Signed-off-by: ajrasane <[email protected]> Signed-off-by: Ajinkya Rasane <[email protected]> Signed-off-by: ColinM-sys <[email protected]> Signed-off-by: Keval Morabia <[email protected]> Signed-off-by: Meng Xin <[email protected]> Signed-off-by: gcunhase <[email protected]> Signed-off-by: Chad Voegele <[email protected]> Co-authored-by: Shengliang Xu <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]> Co-authored-by: Juhi Mittal <[email protected]> Co-authored-by: Frida Hou <[email protected]> Co-authored-by: Chenjie Luo <[email protected]> Co-authored-by: yingguo-trt <[email protected]> Co-authored-by: Wei-Ming Chen <[email protected]> Co-authored-by: yueshen2016 <[email protected]> Co-authored-by: joe <[email protected]> Co-authored-by: Ajinkya Rasane <[email protected]> Co-authored-by: Colin McDonough <[email protected]> Co-authored-by: Keval Morabia <[email protected]> Co-authored-by: mxinO <[email protected]> Co-authored-by: Gwena Cunha <[email protected]> Co-authored-by: Chad Voegele <[email protected]>
What does this PR do?
Type of change: New recipes (checkpoint aliases)
Continues the 2026 published-checkpoint backfill started in #2643, with three more NVFP4 releases. Each entry is a thin alias importing an existing general recipe wholesale — no duplicated
quant_cfg, and editing a base recipe flows through to every alias pointing at it.moonshotai/Kimi-K2.7-Codegeneral/ptq/nvfp4_experts_only_input_scale1-kv_fp8_castnvidia/Kimi-K2.7-Code-NVFP4google/gemma-4-26B-A4B-itgeneral/ptq/nvfp4_experts_only-kv_fp8_castnvidia/Gemma-4-26B-A4B-NVFP4google/diffusiongemma-26B-A4B-itgeneral/ptq/nvfp4_experts_only-kv_fp8_castnvidia/diffusiongemma-26B-A4B-it-NVFP4How these were verified
Unlike #2643, where each engineer named a recipe file outright, these three were described in prose ("NVFP4 experts only, input activation scale 1.0, calibration free"; "nvfp4 experts only, default dataset, 1024 samples"). So the mapping was checked against the published checkpoints before being recorded:
lm_headinexclude_modules, leaving only the routed experts quantized. Kimi-K2.7-Code additionally excludes its shared experts.input_scale1vs plain experts-only. This is what separates the Kimi recipe from the Gemma one. Theinput_scale1recipe pins expert activation amax to a constant 2688.0 (E2M1_MAX * E4M3_MAX), so the exportedinput_scaleis exactly 1.0. Kimi-K2.7-Code's sampled expertinput_scaletensors are exactly 1.0; the Gemma releases' are calibrated values, so they take the plain recipe.k_scaletensors, which is what cast mode produces (use_constant_amax, no KV calibration) — consistent with the already-mergedGLM-5.1/Kimi-K2.6entries, which use-kv_fp8_castrecipes and likewise export none. A calibrated KV cache exports a non-1.0k_scale.diffusiongemmanests its decoder undermodel.decoder.layersrather thanmodel.language_model.layers. The recipe's*.experts.*patterns match either way, so no model-specific body is needed.What this cannot establish: calibration. A checkpoint does not record whether max, MSE, or something else was used, so that rests on what each engineer said — the Gemma pair used the default, which is max. Kimi-K2.7-Code is calibration-free on the activation side by construction.
Second commit: name the release in the Qwen3.8-27B description
models/Qwen/Qwen3.8-27B/ptq/nvfp4_w4a4_mlp_fp8_attn_local_hessianalready reproducesnvidia/Qwen3.8-27B-NVFP4, andptq.mdsays so — but the recipe's ownmetadata.descriptiondid not, so on its own the file reads like an unrelated AutoQuantize artifact. Every other checkpoint entry names its release, so a coverage audit that reads the recipes can miss this one. (It missed mine.)Checked against the published checkpoint before asserting it: MLP
gate/up/down_projNVFP4,self_attnandlinear_attnprojections FP8,lm_headNVFP4,mtp*excluded, no KV quantization — and the model card names local-Hessian calibration on 2,048 samples. All matching, including the unusual NVFP4lm_head.Usage
python examples/hf_ptq/hf_ptq.py \ --pyt_ckpt_path google/gemma-4-26B-A4B-it \ --recipe models/google/gemma-4-26B-A4B-it/ptq/nvfp4_experts_only-kv_fp8_cast \ --export_path <output>Testing
tests/unit/recipe/— 460 passed. All three aliases load throughload_recipe, inheritalgorithm: maxfrom their base, and resolve to 32quant_cfgentries.tests/unit/recipe/test_loader.py, which finds every PTQ recipe from disk, so they are covered without a bespoke test.pre-commitpasses on all changed files.transformer_engine.soin the dev venv; they reproduce identically on unmodifiedmain.Not covered: numerics. Nothing here asserts accuracy or that running a recipe reproduces a released checkpoint's weights bit-for-bit.
Before your PR is "Ready for review"
CONTRIBUTING.md: ✅ — no new dependencies, no source changes.Additional Information
Three more releases from the same tracking list are verified for scope and KV mode but still need their calibration method confirmed by the engineer who produced them (a checkpoint cannot reveal it):
moonshotai/Kimi-K2.5,Qwen/Qwen3.5-397B-A17B(the non-V2 release), andzai-org/GLM-5.1. They will follow separately.🤖 Generated with Claude Code
Summary by CodeRabbit