Skip to content

fix(xla): refresh the plamo2 prefill goldens for the shifted-add scan - #3471

Merged
inureyes merged 1 commit into
mainfrom
fix/plamo2-xla-golden-prefix-add
Nov 27, 2026
Merged

inureyes merged 1 commit into
mainfrom
fix/plamo2-xla-golden-prefix-add

Conversation

@inureyes

Copy link
Copy Markdown
Member

Main has been red in mlxcel-xla since #3434 (db3a231): registered_fixtures_are_byte_exact and emit_all_reproduces_registered_goldens fail on plamo2/prefill.mlir. #3434 replaced the reduce_window cumsum in the Mamba2 SSD scan with a shifted-add prefix sum and regenerated the nemotron_h and falcon_h1 goldens, but the plamo2 fixture added by #3449 was frozen against the old scan.

This re-freezes the registered goldens with MLXCEL_FREEZE_GOLDENS=1. Only plamo2/prefill.mlir and plamo2/prefill_logits.mlir change, and the op counts differ only by the expected substitution: 6 reduce_window ops are replaced by shifted pad, slice and add, the same pattern as the nemotron_h regeneration in #3434. No emitter code changes.

Validation

PR #3434 replaced the reduce_window cumsum in the Mamba2 SSD scan with a shifted-add prefix sum and regenerated the nemotron_h and falcon_h1 goldens, but the plamo2 fixture from #3449 was frozen before that change landed. Main has failed `registered_fixtures_are_byte_exact` and `emit_all_reproduces_registered_goldens` since db3a231.

Re-frozen with MLXCEL_FREEZE_GOLDENS=1. Only plamo2 prefill.mlir and prefill_logits.mlir change, and only by the expected substitution (6 reduce_window ops become shifted pad, slice and add), the same pattern as nemotron_h in #3434. All mlxcel-xla lib tests pass (585) and the structural gate of validate_arch.sh passes on metal.
@inureyes inureyes added status:done Completed type:bug Bug fixes, error corrections, or issue resolutions priority:high High priority labels Nov 27, 2026
@inureyes
inureyes merged commit 86af447 into main Nov 27, 2026
33 checks passed
@inureyes
inureyes deleted the fix/plamo2-xla-golden-prefix-add branch November 27, 2026 01:55
@inureyes

Copy link
Copy Markdown
Member Author

CUDA GB10 execution of Plamo2 on the shifted-add scan, main 89425173

This covers the execution tier the Metal run could not reach. NVIDIA GB10 (sm_121), IREE 3.12.0rc20260721, setup-cuda.sh --env, device cuda, f32 (recurrent pin), every GPU command under gpu-lock. Checkpoint pfnet/plamo-2-1b @ 92c75fd6, committed oracle spike/openxla/plamo2_reference/oracle.json.

gate result before (#3449 record)
xla_plamo2 original-checkpoint oracle 40/40 tokens 40/40
xla_plamo2 hybrid synthetic parity single-sequence exact, worst ragged 1.03e-5 1.0e-5
xla_plamo2 2048-window probe inclusive mask, worst 5.4e-6 (minus 2.9e-6, plus 2.8e-6) 5.4e-6
validate_arch.sh --batch 4 --requests 8 --maxcap 24 --oracle structural, token-exact and serve reference-exact PASS (170 tokens) exit 0

No divergence. ROCm hip is still unverified for Plamo2, as before.

@inureyes

Copy link
Copy Markdown
Member Author

Plamo2 on ROCm hip (gfx1151) at main 894251735

main 894251735f7e61dda6646ab4cfb54ef829c3b106, on an AMD Radeon 8060S (Strix Halo gfx1151). The IREE environment came from scripts/iree/setup-rocm.sh --env, and every run was under scripts/rocm_gpu_guard.sh --hold. Checkpoint: pfnet/plamo-2-1b at 92c75fd6eea9018bcb9c33ee8921589febe071fa. Fixtures were freshly generated by spike/openxla/plamo2_oracle.py. Oracle: spike/openxla/plamo2_reference/oracle.json.

cargo test --profile test-fast --features xla-iree,test-utils --test xla_plamo2 -- --ignored --nocapture --test-threads=1 with MLXCEL_XLA_DEVICE=hip: 3 passed, 0 failed.

gate result
plamo2_original_checkpoint_oracle_tokens 40/40 oracle tokens match
plamo2_synthetic_parity single-sequence tokens exact; worst ragged logit delta 1.037e-5
plamo2_window_probe window matches the inclusive mask (worst 5.454e-6), window_minus the exclusive mask (worst 3.695e-6), window_plus the plus mask (worst 2.716e-6)

scripts/xla/validate_arch.sh --model <plamo-2-1b> --device hip --batch 4 --requests 8 --maxcap 24 --oracle spike/openxla/plamo2_reference/oracle.json: exit 0.

gate result
structural (byte-exact) PASS
token-exact single-seq (xla_oracle_check) PASS: 40 reference tokens
serve reference-exact (xla_batch_bench, B=4, N=8) PASS: 8 requests, 170 tokens

The ROCm numbers sit next to the GB10 CUDA ones in spike/openxla/FINDINGS_plamo2.md, with the ragged delta slightly higher (1.037e-5 vs 1.0e-5). That file still says "ROCm hip is not verified here", so it can be updated.

One observation outside the gates: the serve bench measured 7.29 tok/s batched against a 20.08 tok/s sequential baseline (0.4x) on this host.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:high High priority status:done Completed type:bug Bug fixes, error corrections, or issue resolutions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant