Repository navigation
update(xla): add a paired A/B harness for two IREE builds - #3050
Merged
Merged
Conversation
A single before/after run of `mlxcel generate --profile` moves 5 to 10 percent between runs on a thermally loaded host, so an apparent win can be drift. The new harness builds or takes both arms, runs them interleaved, reports both medians and how many paired rounds the new arm won, and requires the greedy text to match. It is the harness the decode changes of #3028, #3042 and #3043 were measured with. Three cases are refused rather than measured because each has produced a wrong number before: two arms built from the same bytes, a zero prefill window (whole-run accounting, #3042), and differing text. Text equality is delegated to scripts/ab_output_equality.sh. The per-device toolchain env is applied from scripts/iree/setup-*.sh when it is not already exported, and GPU use is serialized through gpu-lock on CUDA and scripts/rocm_gpu_guard.sh on HIP.
This was referenced Nov 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
scripts/xla/ab_decode_pair.sh, the paired A/B harness the decode measurements of #3028, #3042 and #3043 were taken with, so the comparison can be reproduced on another host with one command instead of hand-written shell.docs/benchmarks.mdgains the invocation under "Suggested benchmark commands".A single before/after run of
mlxcel generate --profilemoves 5 to 10 percent between runs on a thermally loaded host, so an apparent win can be drift. The script builds or takes both arms, runs them interleaved, reports both medians and how many paired rounds the new arm won, and then requires the greedy text to match. Equality is not reimplemented: the text half is delegated to the existingscripts/ab_output_equality.sh.Three cases are refused rather than measured, because each of them has produced a wrong number before:
cargo buildthat no-ops leaves both arms the same bytes and every round "passes". Refused unless--allow-identical.--allow-whole-run-accounting.Usage
--oldand--newalso take a path to an already-built binary (anything containing a slash).--deviceacceptship,cuda,metalandlocal-task. On CUDA the script wraps every run ingpu-lock run --tag xla-ab --; on HIP it usesscripts/rocm_gpu_guard.sh --hold --; both can be overridden with--lock. WhenMLXCEL_XLA_IREE_COMPILEis unset, the script applies thescripts/iree/setup-*.sh --envmatching--device, so a fresh shell needs no manual setup.MLXCEL_XLA_QUANT=nativeis HIP-only, and the help text says so, because a CUDA run with the flag silently uses the f16 path and its figures are not comparable with HIP native-4bit figures.Validation
gfx1151, AMD RYZEN AI MAX+ 395, llama-3.2-1b-instruct-4bit): end-to-end run withMLXCEL_XLA_IREE_COMPILEunset exited 0. It applied the ROCm setup env, printed the per-round table, both medians and the round-win count, then the delegated gate reportedtext EQUAL. The rates from that run are not reportable: the baseline binary predates the fix(cli): report XLA prefill and decode separately (#3041) #3042 accounting fix, so both arms fell to whole-run accounting and the run needed--allow-whole-run-accounting. The point of that run was the harness paths, not the number.--model, a model directory that does not exist, two arms holding identical bytes, and a zero prefill window.bash -nclean;--helpprints the header block.The CUDA path is left to be exercised on a GB10 host. The lock prefix and the setup script for it were verified by reading
gpu-lock run --tag <tag> -- <command>andscripts/iree/setup-cuda.sh --env; the first version of the script omitted the--that both require, and that was caught by this HIP run.