Skip to content

Add CPU checkpoint loading for Laya - #21

Open
linear3735 wants to merge 2 commits into
ThinkFlowLab:mainfrom
linear3735:codex/laya-checkpoint
Open

linear3735 wants to merge 2 commits into
ThinkFlowLab:mainfrom
linear3735:codex/laya-checkpoint

Conversation

@linear3735

@linear3735 linear3735 commented Sep 28, 2026 •

Copy link
Copy Markdown

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 on 30622438.

Test Result

  • Local checks passed on c8cebc4: formatting, strict Clippy, release build and 19 CPU tests.
  • CI for this commit is awaiting approval (action_required); no jobs have run.
  • Both full-checkpoint CPU tests passed separately on c8cebc4: 206 tensor names/shapes and 618 conversion hashes matched. Reference: PyTorch 2.14.0, checkpoint 55cf4c4ebb4ebe31b2550e8bdf3bd21b99753851.
  • The two full-checkpoint tests require local weights and are skipped by default in CI. The six new CPU tests run without model downloads.

Reproduction commands.

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
hsliuustc0106 self-requested a review September 28, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant