Skip to content

fix(invariance_check): feed int tokens, not a float residual batch (SPEC D4)#940

Open
ocg-goodfire wants to merge 1 commit into
feature/jaxfrom
bridge/task-fix-invariance-check-float-tokens
Open

fix(invariance_check): feed int tokens, not a float residual batch (SPEC D4)#940
ocg-goodfire wants to merge 1 commit into
feature/jaxfrom
bridge/task-fix-invariance-check-float-tokens

Conversation

@ocg-goodfire

Copy link
Copy Markdown
Collaborator

Summary

python -m param_decomp.experiments.invariance_check (step 3 of the validation stack, SPEC D4) crashed on clean feature/jax with TypeError: Indexer must have integer or boolean type, got indexer with type float32 — the check still built a float32 residual batch from before the S18 amendment made the model input token ids, so clean_output hit embed_tokens indexing with floats. Same failure family as the slow-eval hidden_acts crash fixed by #919.

Fix: draw random int tokens (random.randint(..., 0, cfg.vocab_size), matching the test_llama8b.py batch builders) and rename residtokens.

Verification

XLA_FLAGS=--xla_force_host_platform_device_count=4 python -m param_decomp.experiments.invariance_check:

devices: 4
OK: 3-step trajectory matches 1-layout vs 4-device GSPMD (worst rel 1.02e-04; tol rel 1e-04 + abs 1e-07; reassociation-only)

make check clean on the touched file (basedpyright 0 errors, ruff pass).

Found while validating PR #939 (not caused by it). Bridge task: fix-invariance-check-float-tokens.

🤖 Generated with Claude Code

…PEC D4)

The check predated the S18 amendment that made the model input token ids
(Int[B,T] -> embed_tokens indexing); its float32 'resid' batch crashed
clean_output with 'Indexer must have integer or boolean type'. Draw random
int tokens like the llama8b tests do. Same failure family as the slow-eval
hidden_acts crash fixed by #919.

Verified: XLA_FLAGS=--xla_force_host_platform_device_count=4 passes
(worst rel 1.02e-04 within tol).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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