Skip to content

Kaggle T4: describe the batched-generation expectation as a precision property, not a pending fix - #10377

Merged
danielhanchen merged 1 commit into
mainfrom
ci/kaggle-batched-expectation-wording
Sep 6, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci/kaggle-batched-expectation-wording

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Follow-up to #10367. The comment above KNOWN_BATCHED_GENERATION_BREAKAGE, the failure message for a listed model that starts agreeing, and the docstring of test_known_upstream_breakage.py all described gemma-4-E2B-it and Qwen3.5-2B as "confirmed broken upstream" and referred to "the day #9708 is fixed".

There is no fix coming. As recorded on #9708, the disagreement between batch size 1 and a padded batch is bf16 / fp16 rounding that depends on batch shape: a padded batch takes a different SDPA kernel from a lone prompt, the prefill projections run at a different GEMM shape, and RMSNorm rounds differently on the result. It reproduces with plain transformers and unsloth never imported, on every transformers release from 4.57.0 to 5.16.1, and float32 makes every batch size agree.

Change

Words only. The strict expectation is unchanged: a listed model that starts agreeing still fails the leg, because agreement in bf16 means a kernel or the stack changed and that is worth hearing about. The message now says that instead of "if the upstream fix has landed".

No behaviour change. python3 -m pytest tests/kaggle/test_known_upstream_breakage.py tests/kaggle/test_t4_payload_assertions.py -q: 145 passed.

The comment above KNOWN_BATCHED_GENERATION_BREAKAGE, the failure message for
a listed model that starts agreeing, and the test file's docstring all said
the two models were "confirmed broken upstream" and talked about "the day
#9708 is fixed". There is no fix coming. The disagreement is bf16 / fp16
rounding that depends on batch shape (SDPA kernel selection for masked
versus unmasked input, prefill GEMM shape, RMSNorm rounding), it reproduces
with plain transformers and unsloth never imported on every transformers
release from 4.57.0 to 5.16.1, and float32 makes every batch size agree.
The measurements and a standalone repro are on #9708.

The strict expectation stays exactly as it was: a listed model that starts
agreeing still fails, because agreement in bf16 means a kernel or the stack
changed and that is worth hearing about. Only the words change, so the next
reader does not spend a week looking for a bug that is a property of the
arithmetic. No behaviour change; the existing tests cover both halves.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 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-09-06T09:20:35.992513Z 074af0c 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.

@danielhanchen
danielhanchen merged commit c25841f into main Sep 6, 2026
15 of 16 checks passed
@danielhanchen
danielhanchen deleted the ci/kaggle-batched-expectation-wording branch September 6, 2026 09:17

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 074af0c7f3

ℹ️ 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".

Comment on lines +914 to +915
f"{known}, and every batch size AGREED. That disagreement is bf16 "
f"rounding that depends on batch shape, so agreement means a kernel "

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Report fp16 for the T4 failure path

When either listed model starts agreeing, this diagnostic runs from a payload that unconditionally loads the model with dtype = torch.float16 because the T4 has no bf16 support, so attributing the previous disagreement specifically to bf16 is false for the environment being reported. This can send whoever investigates the newly red leg toward the wrong precision path; the message should say fp16 or generically low-precision rounding.

Useful? React with 👍 / 👎.

Comment on lines +852 to +854
# transformers with unsloth never imported shows the same thing, every
# transformers release from 4.57.0 to 5.16.1 shows it, and float32 makes every
# batch size agree. The measurements and a standalone repro are on #9708.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Correct the impossible Transformers version range

This claims the listed models reproduce on every Transformers release starting at 4.57.0, but the repository's own Gemma 4 loader explicitly rejects versions below 5.5.0 (unsloth/models/loader.py, in the gemma4 dispatch). Consequently the stated range cannot have exercised unsloth/gemma-4-E2B-it as described, which undermines the evidence used to classify its disagreement as a permanent precision property; narrow the range per model or clarify that the older-version experiment used a different repro.

Useful? React with 👍 / 👎.

Comment on lines +915 to +917
f"rounding that depends on batch shape, so agreement means a kernel "
f"or the stack changed; work out what, then delete the entry rather "
f"than carry a stale expectation"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Do not infer a kernel change from decoded-text agreement

Agreement here only means the decoded greedy strings compare equal; it does not demonstrate that the batch-shape rounding disappeared. The same numerical differences can remain while the argmax stays unchanged, especially because this check runs on a newly trained adapter and an unpinned, potentially re-uploaded checkpoint. In that scenario this message incorrectly concludes that a kernel or stack changed and directs the reader to delete the expectation, which can make the next near-boundary output red again; require numerical evidence or describe agreement as a reason to investigate all inputs before deletion.

Useful? React with 👍 / 👎.

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