Add CPU checkpoint loading for Laya - #21
Merged
hsliuustc0106 merged 4 commits intoOct 2, 2026
Merged
Conversation
This was referenced Sep 28, 2026
The inventory mismatch reported only that the sets were unequal, so the most likely failure -- pointing the engine at a checkpoint that is not the frozen one -- said nothing about which tensor was wrong or in which direction. Both sets were already in scope. Report the expected-only names as "missing" and the checkpoint-only names as "unexpected", sorted, so the message is deterministic. The neighbouring errors already name their tensor (duplicate expected tensor, shape mismatch, unsupported dtype); this was the one that did not. Adds a CPU test over the synthetic safetensors fixture that asserts both directions and the ordering. fmt, clippy -D warnings, and the workspace tests pass; the checkpoint test that exercises this path still passes against the frozen checkpoint.
hsliuustc0106
self-requested a review
September 28, 2026 09:10
4 tasks
hsliuustc0106
left a comment
Contributor
There was a problem hiding this comment.
Reviewed commit c8cebc4db70bea6855fac1c2913f335f4df23f95.
No findings. 6 CPU tests passed; 2 full-checkpoint tests ignored without local weights.
This was referenced Sep 30, 2026
Contributor
|
resolve conflicts |
| @@ -0,0 +1,205 @@ | |||
| use omni_laya::{config::Config, weights::Weights}; | |||
Contributor
There was a problem hiding this comment.
tests should not be placed here
hsliuustc0106
approved these changes
Oct 1, 2026
hsliuustc0106
left a comment
Contributor
There was a problem hiding this comment.
Reviewed 86c4c5a25b795be5e9e3c7cad402b230011592b7.
No actionable findings. Formatting, Clippy, release build, strict docs build, and all 25 workspace tests passed. Both full-checkpoint CPU tests also passed: 206 tensor names/shapes and 618 conversion hashes matched the PyTorch 2.8.0 CPU reference for checkpoint 55cf4c4ebb4ebe31b2550e8bdf3bd21b99753851. The two GPU tests were not run.
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
Read Laya configuration and weights, validate tensor names and shapes, and convert FP32/FP16/BF16 values. Backends choose their storage precision. Refs #14.
Checkpoint tests live in
tests/laya/and remain registered with theomni-layacrate. Moving them does not change test contents or commands.Test Plan
cargo fmt --all --check cargo clippy --workspace --locked --all-targets -- -D warnings cargo test --workspace --locked cargo build --workspace --release --lockedWith the pinned checkpoint and PyTorch oracle, run:
cargo test --release --locked -p omni-laya --test weights -- --ignoredSystem1-Omni Version / Commit:
219808b; includes upstream566dec1.Test Result
All four workspace checks passed; 25 CPU tests passed and four external-data/GPU tests were skipped by default.
Both full-checkpoint CPU tests passed separately after the move: all 206 tensor names/shapes and 618 conversion hashes matched the existing PyTorch 2.14.0 reference for checkpoint
55cf4c4ebb4ebe31b2550e8bdf3bd21b99753851. No GPU tests ran.Rust CI, Docs build and benchmark harness tests passed for this update.
Self-review
Before marking this PR ready for review or requesting maintainer review, complete
the self-review checklist.
Keep the PR in draft while this work is incomplete.
For agent assistance, use the optional precheck-pr skill.