Skip to content

Run Laya encoder and decision layers on CUDA - #4

Closed
linear3735 wants to merge 13 commits into
codex/laya-workspacefrom
codex/laya-encoder
Closed

linear3735 wants to merge 13 commits into
codex/laya-workspacefrom
codex/laya-encoder

Conversation

@linear3735

@linear3735 linear3735 commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Superseded by #90, now merged into main.

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 InferMatrixLab#14. Depends on #3 and the existing Hopper kernel build. Uses original RoPE and eager execution. Scorer, HTTP and CUDA Graph integration are separate steps.

This fork PR targets codex/laya-workspace; encoder execution adds 419 core/configuration lines. Upstream PR: #49.

Test Plan

cargo fmt --all --check
cargo clippy --workspace --locked --all-targets -- -D warnings
cargo test --workspace --locked
cargo build --workspace --release --locked

Compare 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 the native encoder recipe. The residency/workspace recipe covers inherited resource checks.

System1-Omni Version / Commit: b7c9384; base 7574f19 (codex/laya-workspace). 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

Current upstream CPU CI for the same head: 45 tests passed; 9 checkpoint/GPU tests skipped. fmt, strict Clippy and release build passed. This documentation-only follow-up also passed local strict MkDocs and rendered-anchor checks. Historical GPU validation was not rerun; encoder and CUDA source are unchanged.

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.

GitHub CI only runs for PRs targeting main, so this fork review PR has no automatic CI run.

Upstream CI for the same head: Rust CI, Docs build, benchmark harness tests passed.

Self-review

  • I have reviewed the full diff and addressed the issues I found.
  • I have checked that the change follows the project's architecture and stays focused on the stated purpose.
  • I have run the checks appropriate to this change and reported commands, results, and anything I could not verify above.
  • I have checked that the PR description, documentation, and any accuracy or performance claims match the implementation and available evidence.

@linear3735 linear3735 closed this Oct 6, 2026
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