[https://nvbugs/6599150][fix] Initialize dt_bias in KDA verify-parity test - #17584
Conversation
… test The test builds KimiKDARuntime with random weights and no checkpoint, but dt_bias is constructed with torch.empty and only filled by load_weights(), so it held uninitialized host memory. When that memory contained NaN/Inf bit patterns, both the decode and verify paths produced identical NaN outputs and assert_close (equal_nan=False by default) reported a 100% mismatch — the intermittent DGX_B200 CI failure. Finite garbage preserved parity because both paths share the parameter, which is why the failure was nondeterministic and platform-dependent. Initialize dt_bias explicitly after construction, as the sibling KDA parity tests already do. Verified: 200/200 fresh-process runs of the [2-1]/[2-3] parametrizations on an x86_64 B200 node (previously ~64% of processes failed), plus a full-file run of all four parametrizations. Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe parity test initializes ChangesKimi KDA parity test
Estimated code review effort: 1 (Trivial) | ~2 minutes Mergeability Score: ⚪ Minimal · up to This localized test-only change initializes a previously uninitialized test parameter and removes the waived test entry; no actionable merge-blocking risk remains beyond normal checks and review. Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/bot run |
|
PR_Github #65705 [ run ] triggered by Bot. Commit: |
…ty-dt-bias-init Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
The flake is fixed by initializing dt_bias in the test; remove the DGX_B200 waive for test_kda_verify_matches_sequential_decode[2-1]. Verified after rebasing onto current main: 40/40 fresh-process runs of the [2-1]/[2-3] parametrizations on an x86_64 B200 node, plus all four parametrizations passing in a single-process run. Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
PR_Github #65705 [ run ] completed with state |
|
/bot reuse-pipeline |
|
PR_Github #65744 [ reuse-pipeline ] triggered by Bot. Commit: |
|
PR_Github #65744 [ reuse-pipeline ] completed with state |
…DIA#17584) test_kda_verify_matches_sequential_decode[2-1] was waived under nvbugs/6599150, but that bug is closed-fixed: PR NVIDIA#17584 (merged) fixed the test by initializing dt_bias in the parity test and removed the need for the waive. Main carries no such waive. Drop the re-added line so the now-passing test runs. Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
Dev Engineer Review
runtime.mixer.dt_biaswith finite random values before verification.torch.emptydata from causing intermittent NaN failures.test_kda_verify_matches_sequential_decode[2-1].QA Engineer Review
test_kda_verify_matches_sequential_decode.tests/integration/test_lists/waives.txt.Description
test_kda_verify_matches_sequential_decodefailed intermittently in the DGX_B200 PyTorch CI stage with NaN outputs (nvbug 6599150), while SBSA CI on the same commits passed.Root cause: the test builds
KimiKDARuntimewith random weights and no checkpoint, butKimiKDAMixer.dt_biasis constructed withtorch.emptyand only filled byload_weights(), so in this test it held uninitialized host memory (torch.manual_seeddoes not affecttorch.empty). When that memory happened to contain NaN/Inf bit patterns, both the decode-reference and verify paths produced identical NaN outputs, andtorch.testing.assert_close(defaultequal_nan=False) reported a 100% mismatch. Finite garbage preserved parity because both paths share the parameter — hence the nondeterministic, platform-dependent flake rather than a real kernel divergence.The fix initializes
dt_biasexplicitly after constructing the runtime, as the sibling KDA parity tests (test_kimi_kda_fused_verify_parity,test_kda_mtp_decode_cute_parity) already do. Also removes the correspondingwaives.txtentry fortest_kda_verify_matches_sequential_decode[2-1], since the flake is fixed.The
torch.emptyconstruction in the mixer itself is left unchanged; it matches the convention for checkpoint-loaded parameters (e.g.mamba2_mixer).Evidence for the root cause: across 240 instrumented fresh-process test runs on an x86_64 B200 node, NaN/Inf content in
dt_biasat construction time correlated perfectly with test failure (78/78 failures, 162/162 passes, zero off-diagonal cases).Test Coverage
tests/unittest/_torch/modeling/test_kimi_kda_verify_parity.py(the fixed test): 200/200 fresh-process runs of the[2-1]/[2-3]parametrizations on an x86_64 B200 node after the fix; before the fix ~64% of fresh processes failed on the same node. All four parametrizations pass in a single-process run.PR Checklist