Repository navigation
test(xla): repair the OpenXLA family reference harnesses - #3389
Merged
Merged
Conversation
#2837 replaced `format!("{:x}", digest.finalize())` with `sha256_hex(digest.finalize())`, but `sha256_hex` hashes its input, so the incremental digests in `digest_f32`, `digest_i32` and the Gemma3n canonical-diagnostics `sha256` were hashed twice. The Molmo gate reported `5d74b78d...` (the sha256 of the pinned `0a1bef50...`) and stopped at the pixel digest, which hid everything after it. Add `hex_lower`, the hex encoding without the hash, and use it at the three sites. No pinned value changes. A unit test pins `digest_f32` and `digest_i32` to a single SHA-256 of the little-endian bytes. With the digest check passing, the Molmo gate reaches its vision stages for the first time since #2837. `vision.selected_layer_14` and `_21` then miss `VISION` on 2 and 4 distinct elements of 1,181,696 (max_abs 2.69 and 2.80), identically on local-task and cuda. They get a wider selected-layer bound (atol 4.0); the projector and every decoder stage keep `VISION`. Result: 14/14 PASS on local-task and cuda. Validation: `xla_molmo_reference_check` on molmo-7b-d-0924-4bit, 14/14 on both devices; the new unit tests; `cargo check --features cuda,xla-iree --all-targets`; `cargo check --no-default-features --features xla-diagnostics --all-targets`. The Gemma3n canonical lib test now clears its checkpoint hashes and reaches its numerics; it then stops on the pinned prefix-decode top1 (854 pinned, 236798 observed on this host), a close-ranking pin separate from this fix. Refs #3365
The LLaVA CLI and server surface script failed on two stale expectations. The CLI echoes a newline before the first token, so the generated text is now compared after `lstrip`. The server reports the prepared sequence length (743 with the image expanded) in `usage`, not the unexpanded prompt length (15), so the check uses the expanded length from the reference manifest. The script passes on cuda. Oracle environment: `requirements.lock` gains `torchvision`, and the Youtu-VL oracle, which cannot import its remote code under transformers 5.12.1 (`DefaultFastImageProcessorKwargs`), gets `requirements-youtu.lock` pinned to transformers 4.57.1. Both resolve from a clean venv with `uv pip install --dry-run`. Docs: `xla_qwen25_vl_window_check` needs non-uniform multi-image input or its negative controls trip. The `iree` lib tests of `mlxcel-xla` fail to link under `--profile test-fast` because the IREE runtime recipe lives only in the root `build.rs` and release only links by dropping the unreferenced shim calls under fat LTO; the README records the cause and the working `cargo test --release -p mlxcel-xla --lib --features iree` command, which links. Refs #3365
Revert the wider selected-layer tolerance added earlier in this PR. Epic #566 and #932 forbid relaxing a tolerance to make a gate pass. `vision.selected_layer_14` and `vision.selected_layer_21` are back on `VISION`, so the Molmo gate now reaches its vision stages after the digest fix and fails 2 of 14: layer 21 on 4 of 1,181,696 elements (max_abs 2.80) and layer 14 on 2 elements (max_abs 2.69), identically on local-task and cuda. That numeric gap is tracked separately. Validation: `cargo fmt --check` and `cargo check --features cuda,xla-iree --all-targets` pass. Refs #3365
This was referenced Nov 24, 2026
Member
Author
Implementation Review SummaryIntent: repair the OpenXLA reference harnesses in #3365 (Molmo and Gemma3n double hash, LLaVA script, oracle locks, docs); the Molmo 14/14 and Gemma3n top1 items are tracked separately. No CRITICAL or HIGH findings, so no commits were pushed.
LOW (not fixed): the README says a lib test that calls the shim "would therefore fail in release too", which is an inference and was not checked. The 14/14 and Gemma3n acceptance boxes correctly stay unchecked.
|
inureyes
marked this pull request as ready for review
November 24, 2026 05:01
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
sha256_hex(digest.finalize())). A newhex_lowerencodes the finished digest at the three sites, so the pinned values (0a1bef50...) match again and none changed. A unit test pinsdigest_f32anddigest_i32to a single SHA-256.vision.selected_layer_21on 4 of 1,181,696 elements (max_abs 2.80) andvision.selected_layer_14on 2 elements (max_abs 2.69), identical on local-task and cuda. No tolerance is relaxed. This is tracked separately.llava_cli_server_check.py: strips the CLI's leading newline, and expects the server'susage.prompt_tokensto be the expanded sequence (743), not the unexpanded prompt (15). Passes on cuda.requirements.lockgainstorchvision; the newrequirements-youtu.lockpins transformers 4.57.1 for the Youtu-VL oracle. Both resolve from a clean venv.xla_qwen25_vl_window_checkneeds non-uniform multi-image input. Themlxcel-xlaireelib tests fail to link undertest-fastbecause the IREE runtime link recipe lives only in the rootbuild.rs; release links only because fat LTO drops the unreferenced shim calls. The README records this and the working--releasecommand.Test plan
digest_helpers_hash_the_little_endian_bytes_onceandhex_lower_encodes_a_finished_digest_without_rehashingllava_cli_server_check.pyon cuda: RESULT PASScargo test --release -p mlxcel-xla --lib --features iree --no-runlinkscargo fmt --check,cargo check --features cuda,xla-iree --all-targets,cargo check --no-default-features --features xla-diagnostics --all-targets,python3 scripts/insert_apache_header.py --checkCloses #3365