mla: split latent_scale identity/dynamic compile-cache entries - #52
mla: split latent_scale identity/dynamic compile-cache entries#52MadeBy561 wants to merge 1 commit into
Conversation
CuTeDSL folds the outer-scale multiply out of the kernel when latent_scale traces at exactly 1.0. The explicit compile keys do not hash source or scalar values, so an identity-traced cubin is replayed for later launches with real per-layer scales (and vice versa), silently dropping the NVFP4 outer-scale restore. Add the identity/dynamic distinction as a spec fact and bump both MLA spec versions. Repro: nvfp4_ds_mla + VLLM_NVFP4_MLA_SCALES_FILE with a cache populated by scale-1.0 runs -> teacher-forced KLD degrades 0.13 -> 6.7-7.4; fresh cache scores 0.13 on the identical config. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThe MLA decode and prefill kernel compile-spec cache keys now distinguish ChangesMLA compile cache updates
Estimated code review effort: 2 (Simple) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
Closing: authored against the pre-restructure b12x layout (b12x/attention/mla/) and now conflicting. Superseded by the sparkinfer-layout port with the identical fix and spec-version bumps. |
CuTeDSL folds the NVFP4 outer-scale multiply out of the MLA kernels when
latent_scaletraces at exactly 1.0. The explicit compile keys(
attention.mla.sm120.decodev17,attention.mla.sm120.prefill_mgv3) hashneither kernel source nor scalar values, so a persistent cache populated by
scale-1.0 runs replays identity cubins for launches with real per-layer
scales — the restore is silently dropped.
Repro (GLM-5.2, SM120, TP4+DCP4,
nvfp4_ds_mla+VLLM_NVFP4_MLA_SCALES_FILE):teacher-forced prefill KLD 0.13 → 6.7–7.4 on a stale cache; 0.13 on a fresh
cache, identical config. Short prompts through serving degenerate to
near-immediate EOS.
Fix: add
latent_scale_identityas a compile-spec fact and bump both specversions (decode 17→18, prefill_mg 3→4), following the v17 FP8-RoPE ABI-bump
pattern. Two entries max per config; both directions correct.
🤖 Generated with Claude Code
Summary by CodeRabbit