Run Laya encoder and decision layers on CUDA - #49
Draft
linear3735 wants to merge 26 commits into
Draft
linear3735 wants to merge 26 commits into
linear3735 wants to merge 26 commits into
Conversation
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.
4 tasks done
added 14 commits
October 1, 2026 12:54
This branch has not been deployed
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
Run Laya's 28 encoder layers and two decision transformer layers from Rust. Validate the checkpoint and kernel bundle before loading, then leave hidden states on the GPU for the scorer.
Part of #14. Depends on #48 and the existing Hopper kernel build. Uses original RoPE and eager execution. Scorer, HTTP and CUDA Graph integration are separate steps.
Kept in draft until #48 merges. The diff against
maincurrently includes its dependencies. Review this increment: 419 core/configuration lines for encoder execution.Tests now live under the repository-root
tests/directory. Cargo target names and test coverage are unchanged.Test Plan
cargo fmt --all --check cargo clippy --workspace --locked --all-targets -- -D warnings cargo test --workspace --locked cargo build --workspace --release --lockedCompare with official Laya 0.3.20 on H800: 13 real request cases, including 16 distinct rows at 16×512. Check intermediate and final hidden states, reverse request order, and repeat each workspace without intermediate readbacks. Reproduction commands are in
src/models/laya/README.md.System1-Omni Version / Commit:
ff4d8fa; incremental base2f5ff4b. GPU run:684470a. The later change adds pre-load rotary-size validation and device selection in the test; model execution and kernels are unchanged.Test Result
fmt, strict Clippy, release build passed locally; 45 CPU tests passed and 8 checkpoint/GPU tests were skipped. The earlier GPU validation below is separate; encoder and CUDA source are unchanged by this test-directory update.
All 208 valid-token comparisons had zero measured error. Repeated runs produced identical output bytes. Candidate outputs were finite; empty-key padding was excluded from equality checks. These checks validate implementation parity.
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.