Skip to content

bench: fix layer_norm probe -- affine/seed axes + corrected docstring (#149) - #159

Merged
sbryngelson merged 2 commits into
sbryngelson:mainfrom
comp-physics:bench/probe-affine-seed
Aug 2, 2026
Merged

bench: fix layer_norm probe -- affine/seed axes + corrected docstring (#149)#159
sbryngelson merged 2 commits into
sbryngelson:mainfrom
comp-physics:bench/probe-affine-seed

Conversation

@sbryngelson

Copy link
Copy Markdown
Owner

The layer_norm_compile_probe.py merged in #158 hardcoded seed=13 with both affine terms non-constant, and its docstring asserted a scattered non-monotonic frontier as established fact. That frontier is an artifact of that one affine -- the failure depends on the gamma/beta values, not the shape. Since the probe is on main, that misleading docstring/behavior is worth correcting now.

Verified across M1 Max / M2 Pro / M5 Pro, the affine 2x2 (--affine-scan) separates two distinct, family-specific bugs:

  • M1/M2 (compile): layer_norm compile-fails whenever exactly one affine term is non-constant (one folded, one live). Uniform -- no shape/seed dependence.
  • M5 (execute): with both terms live and large D (>=~10240), the program fails to execute (rc=-1). Seed-dependent at the edge.

M1/M2 and M5 are exact opposites on the asymmetric configs. rms_norm/softmax never fail (single/zero affine slots).

Changes:

  • add --seed, --gamma/--beta, and an --affine-scan 2x2xD mode (the diagnostic that reveals the split);
  • report the compile-vs-dispatch stage (C-FAIL/D-FAIL);
  • rewrite the docstring to the verified two-bug finding and flag that any single scan is one affine's signature.

Smoke-tested on M5: --one 512 10240 (default rr) -> D-FAIL; same cell with --gamma rand --beta zeros -> OK (asymmetric passes on M5, as verified). ruff clean.

…rected docstring (sbryngelson#149)

The committed probe hardcoded seed=13 with both affine terms non-constant and its
docstring asserted a 'scattered non-monotonic frontier' as fact. That frontier is
an artifact of that one affine: the failure depends on the gamma/beta values, not
the shape. Verified across M1 Max / M2 Pro / M5 Pro, the affine 2x2 separates two
distinct family-specific bugs -- M1/M2 compile-fail when exactly one affine term is
non-constant (fold asymmetry); M5 execute-fails with both terms live at large D.

Changes: add --seed, --gamma/--beta, and an --affine-scan 2x2 mode; report the
compile-vs-dispatch stage (C-FAIL/D-FAIL); rewrite the docstring to describe the
verified two-bug finding and flag that any single scan is one affine's signature.
…alse C-FAIL)

The rms column passed beta='-', not a valid --beta choice, so the worker subprocess
errored in argparse and every rms cell read C-FAIL instead of OK. rms_norm ignores
beta; use a valid placeholder ('zeros').
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