Repository navigation
[rl] SGLang generator: use SGLang's public extra_buffer hooks for GDN and KDA - #6318
Draft
acisseJZhong wants to merge 1 commit into
Draft
acisseJZhong wants to merge 1 commit into
acisseJZhong wants to merge 1 commit into
Conversation
3 of 5 tasks
… and KDA The GDN/KDA backends filled SGLang's extra_buffer track slots by reading forward_metadata internals and calling the private _track_mamba_state_decode. Use the public MambaAttnBackendBase hooks from sgl-project/sglang#50991: extend_track_slots, track_conv_states_extend, track_mamba_state_decode and state_tracking_indices. Needs an SGLang pin that includes that PR.
acisseJZhong
force-pushed
the
sglang-linear-attn-public-hooks
branch
from
November 21, 2026 19:02
694555a to
7f5cec9
Compare
acisseJZhong
changed the base branch from
sglang-linear-attn-extra-buffer
to
main
November 21, 2026 19:02
This was referenced Nov 27, 2026
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.
Summary (human-written)
Depends on sgl-project/sglang#50991 and an SGLang pin that includes it:
scripts/install_rl_env.shstill pins851642ade, which lacks these hooks, so this stays a draft.Why
The GDN/KDA backends (#6172) fill SGLang's
extra_buffertrack slots by reading SGLang internals: theforward_metadatatrack fields and the private_track_mamba_state_decode. sgl-project/sglang#50991 adds public hooks onMambaAttnBackendBasefor registered backends.What changed
checkpoint_slotsfromforward_metadata.has_mamba_track_mask/mamba_track_indicesextend_track_slots(forward_batch)track_conv_indices/mamba_track_mask_indicestrack_conv_states_extend(forward_batch, inputs, conv_states)_track_mamba_state_decodetrack_mamba_state_decodeforward_metadata.mamba_track_indicesstate_tracking_indicesThe TODO listing these internals is removed.
Numerics
No numeric change. With SGLang
851642adeplus the hooks from sgl-project/sglang#50991, every generation of the parity tests below matches main bitwise (tokens and logprobs, seed 42), with the same cached tokens.Testing
tests/rl/unit_tests/gpu/test_sglang_bitwise_parity.pyon GB300, Attention Gym755691f: