Repository navigation
[Native][SGLang] Zero padded ReplaySSM forward outputs - #3718
Open
ZLkanyo009 wants to merge 2 commits into
Open
ZLkanyo009 wants to merge 2 commits into
ZLkanyo009 wants to merge 2 commits into
Conversation
Contributor
🏷️ CI GuideRuns automatically on every eligible PR before approval:
Heavy model tests:
Path scope:
|
valar-cop
reviewed
Nov 23, 2026
valar-cop
left a comment
There was a problem hiding this comment.
some changes needed..
gpu run of test_sglang_gdn_replayssm_verify.py at head?
ci green.
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.
Motivation
ReplaySSM returns on
slot < 0before writing the output, so padded rows can retain uninitialized or stale values. Complete the separate follow-up promised in #3552, including its test environment leak and stale enablement docstring.Technical Details
Write positive zero inside the GDN serial, GDN UT and KDA forward kernels before returning for a padded row. These branches precede checkpoint, record and cursor access. Live-row computation is unchanged.
Use pytest's monkeypatch fixture to restore the verify test's environment override, including on failure. Describe the actual enablement policy: off uses batched verify; unset follows speculative steps or the configured algorithm.
Test Plan
Run
python3 -m pytest --noconftest tests/test_replayssm_pad_rows.py -qon a GPU. The added suite covers mixed/all-pad batches, uniform/ragged/empty sequences, partial V tiles, positive-zero outputs, output red zones, exact live-row agreement, all checkpoint/record/cursor comparisons, and graph replay with two changed query inputs.Use the actual kernels and wrappers in Triton's CPU interpreter for FP32 semantics and mutation checks. Inject a failure after setting the test environment to check restoration. Check formatting, compilation and that the non-pad production AST is unchanged.
Test Result
9f2a5bcc769854c3257d1146ad1fd0f261afb9a1, 33/33 GPU cases passed, zero failures/skips: 30 BF16 eager cases and three changed-input graph cases on MI308X/gfx942, Torch 2.10.0/ROCm 7.2.4 and Triton 3.8.0. Pytest completed in 10.32 seconds; this is test runtime, not a performance result. The owned processes exited and GPU memory returned to its allocation baseline.tl.expalias. These results were recorded at7da7389e9; final9f2a5bcc7only moves the no-GPU collection skip before GPU-stack imports, with identical kernel and interpreted test-helper ASTs.These are shared-kernel correctness checks. The full SGLang verification test, model accuracy, distributed execution and model performance were not run for this follow-up. #3552's earlier CI results retain their original head attribution.
Submission Checklist
cc @valarLip