Skip to content

test(cuda): fix too-tight tolerance in EagerVsGraphDecode_QuantizedKv_Match - #175

Merged
jamesburton merged 1 commit into
devfrom
issue/174-graphcapture-tolerance
Jul 24, 2026
Merged

jamesburton merged 1 commit into
devfrom
issue/174-graphcapture-tolerance

Conversation

@jamesburton

Copy link
Copy Markdown
Owner

Closes #174.

Summary

Root-caused the documented pre-existing full-suite-only flake in
CudaGraphCaptureEquivalenceTest.EagerVsGraphDecode_QuantizedKv_Match. It asserted a 1e-3f logit
tolerance claiming eager/graph paths are bit-identical — but its sibling test in the same file
already documents and tolerates (5.0f) the real cause: benign PTX-JIT/kernel-registration-order FP
drift from other tests running first in the same process. Confirmed via direct repro: 0.0 diff
standalone, ~0.20 diff in the full suite — inside the sibling's tolerance, outside this test's.
Loosened to match (5.0f) and corrected the comment.

Test plan

  • Standalone: passes (as it always did)
  • Full DotLLM.Tests.Unit.Cuda suite, same conditions that previously reproduced the failure:
    339 total / 303 passed / 36 skipped / 0 failed (previously 1 failed — this test)

🤖 Generated with Claude Code

…_Match (#174)

This test asserted maxDiff < 1e-3f on first-step logits with a comment claiming
eager and graph paths are bit-identical. Its sibling EagerVsGraphDecode_Match
already documents and tolerates (< 5.0f) the real cause: PTX-JIT cache state
left behind by other CUDA tests in the same process shifts SASS scheduling,
which shifts FP accumulation order in identical arithmetic, perturbing logits
by up to ~0.25 max-abs in the full suite (argmax unaffected).

Confirmed by direct repro: standalone diff 0.000000, full DotLLM.Tests.Unit.Cuda
suite diff 0.201172 — comfortably inside the sibling test's own tolerance,
failing only this test's much tighter bound. Not a real eager-vs-graph bug;
this is the pre-existing test-isolation flake documented across prior sessions
(always passed standalone, only failed in the full suite).

Loosened to 5.0f (matching the sibling exactly) and corrected the comment.

Full DotLLM.Tests.Unit.Cuda suite, same conditions that previously reproduced
the failure: before - 1 failed (this test); after - 339 total / 303 passed /
36 skipped / 0 failed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 24, 2026 20:16
@jamesburton
jamesburton merged commit a88650d into dev Jul 24, 2026
3 checks passed
@jamesburton
jamesburton deleted the issue/174-graphcapture-tolerance branch July 24, 2026 20:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts a flaky CUDA graph-capture equivalence unit test by aligning its logit-diff tolerance with the already-established tolerance used in the sibling test, and updates the in-test rationale to reflect observed full-suite floating-point drift behavior.

Changes:

  • Loosened EagerVsGraphDecode_QuantizedKv_Match first-step logit max-abs-diff tolerance from 1e-3f to 5.0f.
  • Replaced the “bit-identical logits” rationale comment with an explanation of suite-order-dependent FP drift (PTX-JIT/module registration effects).

Comment on lines +254 to +258
// Argmax MUST match at every step — this is the real correctness gate (same
// reasoning as EagerVsGraphDecode_Match above). Logit VALUES are not actually
// bit-identical in practice: PTX-JIT cache state left behind by other tests in
// the same process (module/kernel registration order shifts SASS scheduling,
// which shifts FP accumulation order in identical arithmetic) perturbs them by
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants