Support Mamba async scheduling - #27
Draft
lmcafee-nvidia wants to merge 1 commit into
Draft
Conversation
This was referenced Jul 21, 2026
lmcafee-nvidia
force-pushed
the
async-sched-mamba
branch
from
July 21, 2026 15:09
5b3fa9b to
c21e6de
Compare
lmcafee-nvidia
force-pushed
the
async-sched-prefill
branch
from
July 21, 2026 15:09
fb346d8 to
8f70fe7
Compare
lmcafee-nvidia
force-pushed
the
async-sched-mamba
branch
4 times, most recently
from
July 22, 2026 14:24
998d947 to
781bbed
Compare
lmcafee-nvidia
force-pushed
the
async-sched-prefill
branch
2 times, most recently
from
July 22, 2026 14:35
1091404 to
da72be8
Compare
lmcafee-nvidia
force-pushed
the
async-sched-mamba
branch
3 times, most recently
from
July 22, 2026 15:14
715fbd5 to
9f744e9
Compare
lmcafee-nvidia
force-pushed
the
async-sched-prefill
branch
from
July 22, 2026 15:14
589c6f1 to
1965c8d
Compare
lmcafee-nvidia
force-pushed
the
async-sched-mamba
branch
9 times, most recently
from
July 24, 2026 15:46
044cae4 to
1f3550f
Compare
santhnm2
reviewed
Jul 24, 2026
Comment on lines
+2127
to
+2128
| torch.argmax( | ||
| self._all_logits_cuda.squeeze(0)[:active_request_count], dim=-1, out=sampled_tokens_gpu |
Collaborator
There was a problem hiding this comment.
Why is this an argmax now instead of a max?
Owner
Author
There was a problem hiding this comment.
torch.max was introduced to avoid the original argmax(logits.float()) conversion while writing into preallocated output buffers. however, its values output requires a buffer matching the logits dtype. hybrid/Mamba models can produce either BF16 or FP32 logits, so that buffer is not reliably typed. native-dtype torch.argmax(..., out=sampled_tokens_gpu) avoids the conversion, writes only the required int64 token IDs, and works for both logits dtypes. the parameterized test covers both BF16 and FP32.
lmcafee-nvidia
force-pushed
the
async-sched-mamba
branch
2 times, most recently
from
July 27, 2026 18:04
b67b102 to
56ba559
Compare
Signed-off-by: Lawrence McAfee <lmcafee@nvidia.com>
lmcafee-nvidia
force-pushed
the
async-sched-mamba
branch
from
July 27, 2026 21:31
56ba559 to
ec88126
Compare
lmcafee-nvidia
changed the base branch from
async-sched-prefill
to
async-sched-prefill-standalone
July 28, 2026 04:57
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
Architecture
The async-prefill parent drains a pending forward before it admits newly ready work. This gives the existing single Mamba state bank a clear ownership boundary without adding a second bank, admission-specific state, or Mamba kernel changes.
Async request resolution already moves logical request rows after requests finish. This PR extends that move to the Mamba state-slot mapping and clears mappings for vacated rows. The recurrent tensors themselves remain in their existing physical slots.
Performance
DFW
inference-benchused the trained hybrid Mamba 2B checkpoint (2.875B parameters), one GSM8K request at a time, OSL 512, and full-iteration CUDA graphs. Each mode ran four requests; the first was discarded as warmup.Async scheduling improves steady throughput by 13.8% over legacy and is 1.5% faster than the same-hardware rerun of the prior single-bank implementation.
Validation
main,legacy, andasyncall scored 57/164 (0.3476), with byte-identical raw generations.mainandlegacyscored 127/164 (0.7744);asyncscored 126/164 (0.7683). The one-result launch-to-launch EP variation matches prior qualification of this checkpoint.legacyandasynccompleted four requests with 32 generated tokens. Repeated launches confirmed that observed token variation was launch-level EP numerics rather than scheduling-specific state.