qwen3_5: reduce Gated DeltaNet preparation shared memory - #68
Draft
hsliuustc0106 wants to merge 1 commit into
Draft
hsliuustc0106 wants to merge 1 commit into
hsliuustc0106 wants to merge 1 commit into
Conversation
Signed-off-by: Hongsheng Liu <liuhongsheng4@huawei.com>
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
Reduce Qwen3.5 Gated DeltaNet preparation cost by converting normalized Q/K to TF32 once, storing the meaningful bits in three-byte component planes, retaining the original four-term accumulation, and writing U/W fragments directly as bfloat16. Dynamic shared memory falls from 92 KiB to 72 KiB. The float32 inverse and existing C ABI/workspace contracts are preserved.
Move the existing GPU tests to repository-level
tests/qwen3_5/, register them explicitly in Cargo, and extend the recurrent float64 reference to tile/chunk boundaries, grouped heads, long inputs, weak decay, and tiny/zero Q/K. The existing reference tolerance is unchanged.Test Plan
System1-Omni Version / Commit:
e23d5648f791afc332ff204d43ba09b3d39e9a8f, based on main58b8cbe9d4738f6c217f6fe584852dc9361b2c24.Passed:
cargo fmt --all --checkcargo clippy --workspace --locked --all-targets -- -D warningscargo test --workspace --lockedcargo build --workspace --release --lockedTest Result
GitHub CI also passed: Rust, benchmark tests and strict documentation build.
Complete eager GDN wall time, two passes of 100 calls per shape (excluded feasibility and warmups):
The >=10% medium/long kernel gate passed. These are seeded synthetic tensors at real workload shapes; the timing includes host submission.
Mean warm HTTP latency: baseline 48.375 / 48.441 ms, candidate 48.105 / 48.305 ms. Aggregate 48.408 → 48.205 ms (0.42%), below the predeclared 2% target. This PR remains a draft targeted kernel proposal; this experiment does not establish a material full-model latency improvement.
Full-model validation uses an unchanged frozen Rust worker/frontend from #55 (worker
202c0e1, ABI4 library sources7b93572); the kernel change builds independently on main and its GPU tests use ABI3. Graph capture and shared-prefix caching were disabled. HF Transformers and open-jev-fast were not remeasured here.Benchmark report, raw records and reproduction controls also document the separate installed FlashInfer comparison and rejected precision/accumulation variants. Modified-kernel execution on SM80/SM89 and hardware profiling counters remain unverified. Task-owned processes and GPU reservation were cleaned up.
Self-review
Agent self-review completed with no actionable code correctness findings; the HTTP performance target was missed and the hardware limits above remain. Contributor review/checklist is pending. #55 also moves this test suite, so its engine import/manifest wiring may need reconciliation when those branches merge.
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. The optional precheck-pr skill does not replace contributor or maintainer review.