Skip to content

test(gemma4): the checkpoint gates can only be produced for a checkpoint that fits beside its own reference on one card - #1050

Merged
FeathBow merged 7 commits into
pegainfer-project:mainfrom
FeathBow:feat/gemma4-fixture-path-overrides
Sep 16, 2026
Merged

FeathBow merged 7 commits into
pegainfer-project:mainfrom
FeathBow:feat/gemma4-fixture-path-overrides

Conversation

@FeathBow

Copy link
Copy Markdown
Collaborator

Description

Closes #1049

The suite was 12B by construction. The checkpoint gates opened their four HF fixtures and the chat reference at fixed paths, and the dumpers loaded the reference tower on one device. Another checkpoint's fixtures had nowhere to live, and a tower that does not fit beside the long-context prompts on one card could not be dumped.

Paths from the environment, a set by tag. Each gate reads its fixture path from PEGAINFER_GEMMA4_{GOLDEN,WINDOW_GOLDEN,LONGCTX_GOLDEN,GENERATE,CHAT_GOLDEN}, falling back to the committed 12B files. scripts/gemma4_gates.sh takes PEGAINFER_GEMMA4_FIXTURE_TAG (default 12b; the committed chat reference keeps its untagged name), exports the five paths for that tag, and holds the set against the checkpoint's digests before the first load, as before.

Dumped sharded when the tower needs it. The dumpers accept a device map that shards the reference tower over several GPUs; the golden dumper fingerprints a sharded checkpoint by its index and shard headers the way it fingerprints a single file; the chat parity reference follows the tag.

Test Env

  • Single GPU (sm_89, x86_64) for the 12B suite; one and two GH200s (sm_90, aarch64) for the 31B dumps and suite.

Verification

Bound to the tip of this range.

  • The 12B suite through the runner with nothing set: every gate resolves to the committed files and passes as before.
  • The 31B set dumped from google/gemma-4-31B-it at revision 842da3794eaa (window and long-context cases with the tower sharded over two GH200s) and the whole suite run through the runner with PEGAINFER_GEMMA4_FIXTURE_TAG=31b: the fixture preflight agrees on the revision, and the suite runs to its end; the numeric results are retained in the M3 snapshot rather than here.
  • cargo fmt --check, clippy -D warnings on the gemma4 and frontend crates including tests.

…environment

Signed-off-by: Feathbow <feathbow@gmail.com>
Signed-off-by: Feathbow <feathbow@gmail.com>
Signed-off-by: Feathbow <feathbow@gmail.com>
Signed-off-by: Feathbow <feathbow@gmail.com>
@FeathBow FeathBow changed the title gemma4: the checkpoint gates can only be produced for a checkpoint that fits beside its own reference on one card test(gemma4): the checkpoint gates can only be produced for a checkpoint that fits beside its own reference on one card Sep 16, 2026

@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: ddf7f6514a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread scripts/gemma4_gates.sh
# The fixture set is named by the checkpoint it was dumped from; the
# committed set is 12b. Another tag selects fixtures dumped for another
# checkpoint under the same names, and the gates are told where they are.
FIXTURE_TAG=${PEGAINFER_GEMMA4_FIXTURE_TAG:-12b}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Update the Gemma 4 fixture documentation

When PEGAINFER_GEMMA4_FIXTURE_TAG selects a non-12B set, the maintained docs still state that the gates are pinned to 12B, provide only 12B fixture names, and omit the multi-GPU --device auto dumping procedure (docs/models/gemma4/hf-golden.md and docs/models/gemma4/tokenizer.md). This leaves the newly supported workflow undocumented and directly contradicts the tokenizer guide's claim that other sizes cannot be gated; update those model docs with the tagged naming, sharded dump, and tagged chat-reference procedure.

AGENTS.md reference: AGENTS.md:L188-L190

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Makes sense

@FeathBow

Copy link
Copy Markdown
Collaborator Author

@codex review please

@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: ddf7f6514a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

case_cuts = cuts if probed else []
hidden, logits = run_case(model, text_model, case_cuts, tokens, args.device)
hidden, logits = run_case(
model, text_model, case_cuts, tokens, input_device(model, args.device)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Move sharded probe captures to a common device

When --device auto actually distributes the language layers across multiple GPUs, the selected first/last-layer hooks retain their activations on those different CUDA devices. run_case() then passes them directly to the single torch.stack() at lines 210–212, which raises a cross-device tensor error before the base golden can be written. Move each captured activation to CPU (or another common device) before stacking so the newly supported sharded workflow works for checkpoints that cannot fit on one card.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Sure

@FeathBow

Copy link
Copy Markdown
Collaborator Author

@codex review thx

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 9e0fe1a0c7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@FeathBow
FeathBow merged commit 6e15865 into pegainfer-project:main Sep 16, 2026
17 checks passed
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.

gemma4: the checkpoint gates can only be produced for a checkpoint that fits beside its own reference on one card

1 participant