cua_s1: load and validate native vision checkpoints on CPU - #59
Merged
hsliuustc0106 merged 4 commits intoOct 6, 2026
Merged
Conversation
This was referenced Oct 2, 2026
This was referenced Oct 5, 2026
…a-vision-loader # Conflicts: # src/models/cua_s1/native/Cargo.toml # src/models/cua_s1/native/src/lib.rs
Levius-Fubuki
marked this pull request as ready for review
October 5, 2026 15:48
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.
Purpose
Add CPU
VisionCheckpointloading for Qwen3.5-4B and the Cua-S1 multimodal adapter. Validate configuration, the complete visual tensor inventories, shapes/dtypes, bounded offsets, shard routing, duplicate header/index keys and checkpoint path containment. Keep 297 BF16 base tensors and 100 FP32 LoRA tensors separate, with borrowed views backed by owned memory maps.Updated onto main
7f39ac40902c374803992407bb26eeba29c8a588. The diff is four core files: the loader, its public export, the required Serde derive dependency and its lockfile dependency edge. It uses the existing shared Qwen/runtime layout. CUDA vision execution is supplied separately by #64.Test Plan
Current head:
550ee0afae3475e488b5cb308a733ad41d1e9487. Baseline:7f39ac40902c374803992407bb26eeba29c8a588.Test Result (fresh, 2026-10-05)
The current production tree passed
cargo fmt --all --check,cargo clippy --workspace --locked --all-targets -- -D warnings,cargo test --workspace --locked, andcargo build --workspace --release --lockedon macOS arm64 / Rust 1.98.0. Workspace tests: 82 passed, 0 failed, 10 existing tests ignored (6 CUDA, 2 Laya checkpoint/oracle, 1 Laya packing, 1 Open-Jev tokenization). Benchmark CI checks also passed: 4 smoke requests validated and 8 Python tests passed.Feature fixtures and examples remain outside this core-only diff. A fresh external Cargo runner imports the current production crate by path and uses its locked dependency versions; only the external root package is added to the runner lockfile. The feature harness is materialized from the linked pre-cleanup commit. No native CUDA, full multimodal inference, HTTP image path, model accuracy or performance claim is made by this CPU prerequisite PR.
The external release fixture suite passed all 13 cases, covering single/sharded checkpoints, ignored language-only tensors, shapes/dtypes/missing or extra tensors, malformed/truncated payloads, bad shard routes, duplicate keys, overflow offsets, paths/symlink escapes, vision config and adapter math/targets. A fresh loader execution over the local visual-only extracts matched all 397 Rust-accessor SHA-256 values against a fresh independent Python mmap calculation: 667,028,480 base bytes and 16,678,912 adapter bytes. Aggregate payload hashes also matched the pinned extraction manifest.
The extracts contain unchanged visual payloads from base revision
851bf6e806efd8d0a36b00ddf55e13ccb7b8cd0aand multimodal adapter revision16818868b0cc7813808aae4e87b417657046ab79, repackaged with rebased offsets. This does not verify the original full checkpoint file hashes or execute the encoder. Checkpoint files must remain immutable while their maps/views are alive.Harness sources and extraction recipe: pre-cleanup commit. Fresh local logs, runner lockfile and payload hash tables are archived under
artifacts/all-pr-followups-20261005/cua/pr59/.Self-review
Full current diff reviewed against the pinned main revision; shared execution/processing/runtime ownership and core-only scope retained. The CPU loader can merge independently as a prerequisite for #64. Maintainer review remains separate.
Demo / evidence
Actual CPU validation, not native encoder/HTTP inference. Raw logs and fixture/payload hashes remain local under the artifact path above, outside the core-code diff. No video is needed for these CPU prerequisites. Current-head GitHub Rust, benchmark and docs CI passed; deployment skipped. CI run.