Skip to content

FP8 GEMV long-indexing test: seeded inputs and a last-bit tolerance - #14220

Merged
danielhanchen merged 3 commits into
mainfrom
fp8-long-indexing-test-tolerance
Oct 19, 2026
Merged

danielhanchen merged 3 commits into
mainfrom
fp8-long-indexing-test-tolerance

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

test_fp8_rowwise_gemv_long_indexing.py::test_weight_past_2_31_elements is flaky. It compares, bit for bit, the tail rows of an N = 524544 launch (BLOCK_N 8) with an N = 512 launch (BLOCK_N 1) on unseeded random inputs. The two block sizes can round the last bit of a bf16 output differently, so the result depends on the global RNG state left by earlier tests.

It showed up as false regressions in per-PR parent vs merge runs. On a B200, 32 seeds of the test body in isolation mismatch on exactly the same 4 seeds (one element, max abs diff 1.5e-5) for the #14026 parent, its merge and current main, on torch 2.13 and 2.14.

Change

  • The inputs come from a seeded generator.
  • The tail rows are compared with assert_close at an absolute tolerance of 1% of the largest output, instead of torch.equal.

The point of the test is addressing past 2^31 elements. Wrong addressing reads other rows, or faults, which is far outside that tolerance.

Validation (B200, torch 2.14)

  • 3 consecutive runs: pass.
  • Flip check, with LONG_INDEXING = False forced for the GEMV in a scratch copy: the test fails with an illegal memory access was encountered. The unmodified copy passes.

Test-only change.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T08:28:39.866642Z a3b03d9 Manual request
🔒 Security Review ⚠️ Failed 2026-10-19T08:26:50.096215Z a3b03d9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: a3b03d99d4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 5f3a0a2 into main Oct 19, 2026
@danielhanchen
danielhanchen deleted the fp8-long-indexing-test-tolerance branch October 19, 2026 12:04
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.

1 participant