Add CPU checkpoint loading for Laya - #21
Open
linear3735 wants to merge 2 commits into
Open
linear3735 wants to merge 2 commits into
linear3735 wants to merge 2 commits into
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
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
Refs #14. Replaces #16 with the first CPU-only step: read Laya configuration and weights, check tensor names and shapes, and convert FP32/FP16/BF16 values. Backends choose their own storage precision.
302 core/config changed lines. Tests, documentation and Cargo.lock are separate; generated outputs are not included.
Test Plan
Run workspace checks and CPU tests for configuration errors, tensor validation and float conversion boundaries. Compare every tensor in the fixed Laya checkpoint with PyTorch-generated hashes.
System1-Omni Version / Commit:
c8cebc4, based on30622438.Test Result
c8cebc4: formatting, strict Clippy, release build and 19 CPU tests.action_required); no jobs have run.c8cebc4: 206 tensor names/shapes and 618 conversion hashes matched. Reference: PyTorch 2.14.0, checkpoint55cf4c4ebb4ebe31b2550e8bdf3bd21b99753851.Reproduction commands.