Skip to content

Commit f343ede

Browse files
authored
[Sgl Atom][fix] GDN target verify: zero padded rows in the batched recurrence (#3552)
* plugin/sglang: zero padded rows in batched GDN target verify With ReplaySSM off, CUDA-graph pad rows (mamba cache index -1) return early in the conv, so their q/k/v hold whatever torch.empty returned. The batched fused_recurrent call still ran them through the arange slot table and could write NaN into core_attn_out. Pass slot -1 for those rows so fused_recurrent zeroes their output and skips their state, as it does elsewhere. Real rows are unchanged. Also fix the host comment in causal_conv1d_update: only the read table is checked for pad_slot_id, so a row padded in the write table must also be padded in the read table. This matches the docstring and the kernel comment. Add a GPU test that fills the pad rows' q/k/v with NaN and checks that pad rows come out zero and real rows match an unpadded run bit for bit, for both the VK and logical-KV state layouts. * plugin/sglang: check pad rows' skipped state in batched GDN verify test Address review on #3552: - The pad-row test now asserts that the kernel leaves the pad rows' intermediate_ssm steps 1.. untouched (zero). Step 0 holds the host seed ssm_states[-1] and is not checked. Without this, keeping the arange slot table and zeroing pad outputs on the host passed the test. - _spec_ssm_slot_table: the table is built once per shape and never mutated; the kernel gets the pad-masked copy. - Test module docstrings no longer call this the default verify path: with MTP, ReplaySSM is the default and this path runs only with ATOM_ENABLE_REPLAYSSM=0. The module now sets that for every test instead of relying on the absence of server args. * plugin/sglang: drop "default" from batched GDN verify test names Address the second review on #3552: - Rename test_default_batched_path_populates_verify_buffers and test_default_ssm_path_uses_one_kernel_call to test_batched_*: this path is not the default. test_default_conv_path_* keep their names, since ReplaySSM also goes through _spec_conv_qkv. - The module docstring credits ReplaySSM's default to any speculative algorithm (MTP, DFLASH, ...), not just MTP. * plugin/sglang: fix stale GDN verify comments in attention_gdn Address the third review on #3552, comments and docstrings only: - _verify_batched_ssm: cite test_gdn_target_verify_batched_equiv.py for equivalence with the per-step loop; test_sglang_gdn_verify_batched_ssm.py checks the plugin contract (buffers, live state, one kernel call, pad rows). Say the live SSM state is only read. - _build_gdn_metadata: TARGET_VERIFY runs SGLangGatedDeltaNet's own conv + SSM verify (ReplaySSM, or the batched path with ATOM_ENABLE_REPLAYSSM=0) and needs no native GDN metadata. - SGLangGatedDeltaNet class docstring: it no longer fills SGLang's verify snapshots; name the two verify paths. - _spec_conv_window_phys: state what the single call writes instead of what it replaced. - test_batched_ssm_leaves_live_state_untouched: state the constraint, not the history. * plugin/sglang: fix remaining stale GDN verify docstrings and error text Address the fourth review on #3552, text only: - _conv_per_step_loop: it is the removed production path, retained as a test-only numerical reference. - causal_conv1d_update docstring: it returns (query, key, value), not an `out` shaped like `x`; padded entries' rows are left unwritten. - _spec_conv_window_phys errors no longer say "batched TARGET_VERIFY": the default ReplaySSM path raises them too. * Clarify GDN verify coverage and check per-step buffer contents Check nonzero intermediate SSM and conv contents for every live request at steps 1..draft-1, excluding the host-seeded SSM step zero. Distinguish these forward-path checks from the isolated batched-versus-loop kernel comparison and remove its vacuous live-state test. Use algorithm-neutral TARGET_VERIFY wording and align conv docstrings with the split q/k/v outputs, read-side pad check, and single-token non-varlen input contract. * docs: correct GDN verify state layout and pointer labels Name the pad-test cases plain KV and FlyDSL logical KV. Document the query/key and value pointer dimensions separately.
1 parent 6d2f713 commit f343ede

4 files changed

Lines changed: 170 additions & 92 deletions

File tree

‎atom/model_ops/mamba_ops/causal_conv1d.py‎

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ def _causal_conv1d_fwd_kernel( # continuous batching
116116
block_idx_last_scheduled_token, # (batch,)
117117
initial_state_idx, # (batch,)
118118
num_computed_tokens, # (batch,)
119-
query_ptr, # (k_dim_size, seqlen)
120-
key_ptr, # (k_dim_size, seqlen)
121-
value_ptr, # (v_dim_size, seqlen)
119+
query_ptr, # (cu_seqlen, k_dim_size)
120+
key_ptr, # (cu_seqlen, k_dim_size)
121+
value_ptr, # (cu_seqlen, v_dim_size)
122122
# Matrix dimensions
123123
dim: tl.constexpr,
124124
k_dim_size: tl.constexpr,
@@ -658,8 +658,9 @@ def causal_conv1d_fn(
658658
activation: either None or "silu" or "swish" or True
659659
pad_slot_id: int
660660
if cache_indices is passed, lets the kernel identify padded
661-
entries that will not be processed,
662-
for example: cache_indices = [pad_slot_id, 1, 20, pad_slot_id]
661+
entries that will not be processed. Only cache_indices_in (which
662+
defaults to cache_indices) is checked,
663+
for example: cache_indices_in = [pad_slot_id, 1, 20, pad_slot_id]
663664
in this case, the kernel will not process entries at
664665
indices 0 and 3
665666
block_idx_first_scheduled_token: (batch,), dtype int32
@@ -672,7 +673,10 @@ def causal_conv1d_fn(
672673
The number of tokens already completed for each sequence
673674
block_size_to_align: int
674675
The block size to align the cached states to
675-
out: same shape as `x`
676+
677+
Returns (query, key, value): the conv output split along dim, shaped
678+
(cu_seq_len, k_dim_size), (cu_seq_len, k_dim_size) and
679+
(cu_seq_len, v_dim_size). Rows of padded entries are left unwritten.
676680
"""
677681
if isinstance(activation, bool) and activation:
678682
activation = "silu"
@@ -725,7 +729,7 @@ def causal_conv1d_fn(
725729
# 1. conv_states is used to replaced initial_states
726730
# 2. conv_states serve as a cache with num cache lines can be larger than batch size
727731
# 3. mapping from sequence x[idx] to a cache line at index as specified via cache_indices[idx]
728-
# 4. computation can be skipped if cache_indices[idx] == pad_slot_id
732+
# 4. computation can be skipped if cache_indices_in[idx] == pad_slot_id
729733
num_cache_lines = conv_states.size(0)
730734
assert (
731735
num_cache_lines == conv_states.shape[0]
@@ -837,7 +841,7 @@ def grid(META):
837841
@triton.jit()
838842
def _causal_conv1d_update_kernel(
839843
# Pointers to matrices
840-
x_ptr, # (batch, dim, seqlen)
844+
x_ptr, # (batch, dim, 1), or (num_tokens, dim) with query_start_loc
841845
w_ptr, # (dim, width)
842846
bias_ptr,
843847
conv_state_ptr,
@@ -858,9 +862,9 @@ def _causal_conv1d_update_kernel(
858862
query_start_loc_ptr, # (batch + 1)
859863
block_idx_last_scheduled_token, # (batch,)
860864
initial_state_idx, # (batch,)
861-
query_ptr, # (batch, dim, seqlen)
862-
key_ptr,
863-
value_ptr,
865+
query_ptr, # (num_tokens, k_dim_size, 1)
866+
key_ptr, # (num_tokens, k_dim_size, 1)
867+
value_ptr, # (num_tokens, v_dim_size, 1)
864868
# Matrix dimensions
865869
batch: int,
866870
dim: tl.constexpr,
@@ -960,7 +964,8 @@ def _causal_conv1d_update_kernel(
960964
query_start_index = idx_seq * seqlen
961965
query_end_index = query_start_index + seqlen
962966
x_offset = idx_seq * stride_x_seq
963-
# Non-varlen: output is [batch, split_dim, seqlen]
967+
# Non-varlen: output is [batch, split_dim, 1], so seqlen must be 1;
968+
# multi-token input goes through query_start_loc.
964969
q_base = idx_seq * stride_q_seq
965970
k_base = idx_seq * stride_k_seq
966971
v_base = idx_seq * stride_v_seq
@@ -1243,9 +1248,10 @@ def causal_conv1d_update(
12431248
x: Input tensor which can take the following shapes:
12441249
12451250
- `[batch, dim]` - single token prediction
1246-
- `[batch, dim, seqlen]` - single or multiple tokens prediction
1247-
- `[num_tokens, dim]` - continuous batching, where num_tokens is
1248-
the total tokens of all sequences in that batch
1251+
- `[batch, dim, 1]` - the same, with an explicit token axis. Outputs have
1252+
one row per batch entry, so multi-token input needs query_start_loc.
1253+
- `[num_tokens, dim]` with query_start_loc - continuous batching, where
1254+
num_tokens is the total tokens of all sequences in that batch
12491255
12501256
conv_state: (..., dim, state_len), where state_len >= width - 1
12511257
weight: (dim, width)
@@ -1285,11 +1291,15 @@ def causal_conv1d_update(
12851291
length in the batch.
12861292
pad_slot_id: int
12871293
if conv_state_indices is passed, lets the kernel identify padded
1288-
entries that will not be processed,
1289-
for example: conv_state_indices = [pad_slot_id, 1 ,20 ,pad_slot_id]
1294+
entries that will not be processed. Only conv_state_indices_in
1295+
(which defaults to conv_state_indices) is checked,
1296+
for example: conv_state_indices_in = [pad_slot_id, 1, 20, pad_slot_id]
12901297
in this case, the kernel will not process entries at
12911298
indices 0 and 3
1292-
out: (batch, dim) or (batch, dim, seqlen) or (num_tokens, dim), same shape as `x`
1299+
Returns (query, key, value): the conv output split along dim, shaped
1300+
(num_tokens, k_dim_size), (num_tokens, k_dim_size) and
1301+
(num_tokens, v_dim_size) with num_tokens = x.shape[0]. Rows of padded
1302+
entries are left unwritten.
12931303
"""
12941304
if validate_data:
12951305
assert pad_slot_id is not None
@@ -1329,8 +1339,10 @@ def causal_conv1d_update(
13291339
)
13301340
# num_cache_lines masks only the STEP-2 history load (read slot against
13311341
# conv_state_in's rows). The STEP-1 column loads and the store are not
1332-
# bounds-checked, so both index tables must hold valid slots or
1333-
# pad_slot_id.
1342+
# bounds-checked. Only conv_state_indices_in is checked for pad_slot_id,
1343+
# so a row padded there may hold anything in conv_state_indices; every
1344+
# other row needs valid slots in both tables. A row padded in
1345+
# conv_state_indices must also be padded in conv_state_indices_in.
13341346
num_cache_lines = conv_state_in.size(0)
13351347

13361348
if validate_data:
@@ -1339,8 +1351,8 @@ def causal_conv1d_update(
13391351
# shape [slot, conv_dim, state_len], but its row-major cache layout can
13401352
# have conv_state.stride(-2) != 1. The Triton kernel below uses the runtime
13411353
# stride_istate_seq/dim/token values for all conv_state loads/stores, so
1342-
# Pass this layout straight through to the kernel, rather than
1343-
# rejecting it here or converting it to another layout in Python first.
1354+
# this layout goes straight through to the kernel rather than being
1355+
# rejected here or converted to another layout in Python first.
13441356
# assert (
13451357
# conv_state.stride(-2) == 1
13461358
# ), f"ERROR: expect contiguous along feat-dim of conv_state (currently stride={conv_state.stride()})"
@@ -1362,7 +1374,6 @@ def causal_conv1d_update(
13621374
num_accepted_tokens.max()
13631375
), "conv_state_in is narrower than num_accepted_tokens reads"
13641376

1365-
# adopt the strategy in vLLM that overwrite on 'x' directly, rather than creating a new tensor 'o'
13661377
num_tokens = x.shape[0]
13671378
query = torch.empty([num_tokens, k_dim_size, 1], dtype=x.dtype, device=x.device)
13681379
key = torch.empty([num_tokens, k_dim_size, 1], dtype=x.dtype, device=x.device)
@@ -1375,7 +1386,7 @@ def causal_conv1d_update(
13751386
stride_w_dim, stride_w_width = weight.stride()
13761387

13771388
if query_start_loc is None:
1378-
# X (batch, dim, seqlen)
1389+
# X (batch, dim, 1)
13791390
stride_x_seq, stride_x_dim, stride_x_token = x.stride()
13801391
else:
13811392
# X (num_tokens, dim)

‎atom/plugin/sglang/attention_backend/attention_gdn.py‎

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,8 @@ def current(cls, forward_batch: Any) -> _GDNStep:
446446

447447

448448
class SGLangGatedDeltaNet(GatedDeltaNet):
449-
"""Run batched ATOM GDN while filling SGLang's verify snapshots."""
449+
"""ATOM GDN under SGLang. TARGET_VERIFY runs ReplaySSM, or the batched path
450+
with ``ATOM_ENABLE_REPLAYSSM=0``."""
450451

451452
def forward(
452453
self,
@@ -480,26 +481,22 @@ def forward(
480481
attn_backend = SGLangGDNForwardContext._resolve_attn_backend(forward_batch)
481482
if attn_backend is None:
482483
raise RuntimeError(
483-
"ATOM Qwen3.5 TARGET_VERIFY requires an active SGLang "
484-
"attention backend."
484+
"ATOM GDN TARGET_VERIFY requires an active SGLang attention backend."
485485
)
486486
linear_backend = SGLangGDNForwardContext._linear_attn_backend(attn_backend)
487487
if getattr(linear_backend, "forward_metadata", None) is None:
488488
raise RuntimeError(
489-
"ATOM Qwen3.5 TARGET_VERIFY requires initialized SGLang "
490-
"GDN metadata."
489+
"ATOM GDN TARGET_VERIFY requires initialized SGLang GDN metadata."
491490
)
492491
req_to_token_pool = getattr(linear_backend, "req_to_token_pool", None)
493492
if req_to_token_pool is None:
494-
raise RuntimeError(
495-
"ATOM Qwen3.5 TARGET_VERIFY requires the SGLang mamba pool."
496-
)
493+
raise RuntimeError("ATOM GDN TARGET_VERIFY requires the SGLang mamba pool.")
497494
layer_cache = req_to_token_pool.mamba2_layer_cache(self.layer_num)
498495
if not hasattr(layer_cache, "intermediate_ssm") or not hasattr(
499496
layer_cache, "intermediate_conv_window"
500497
):
501498
raise RuntimeError(
502-
"ATOM Qwen3.5 TARGET_VERIFY requires speculative GDN "
499+
"ATOM GDN TARGET_VERIFY requires speculative GDN "
503500
"intermediate-state buffers."
504501
)
505502

@@ -526,7 +523,8 @@ def forward(
526523
cache_indices = linear_backend.forward_metadata.mamba_cache_indices[:bs]
527524
conv_states = layer_cache.conv[0]
528525
# Same view Native passes to GatedDeltaNet: FlyDSL decode keeps a
529-
# logical KV view over physical VK storage. Verify reads that view.
526+
# logical KV view over physical VK storage. The batched path reads
527+
# that view; ReplaySSM addresses the raw pool.
530528
ssm_states = layer_cache.temporal
531529
policy = getattr(self, "gdn_flydsl_policy", None)
532530
if policy is not None and policy.decode:
@@ -692,8 +690,8 @@ def _spec_ssm_slot_table(
692690
) -> torch.Tensor:
693691
"""`[bs, draft]` table into the flat `intermediate_ssm` slot pool.
694692
695-
Cached per shape and filled in place: CUDA graph replay requires the
696-
tensor address to stay put across iterations.
693+
Built once per shape and never mutated. `_verify_batched_ssm` hands the
694+
kernel a pad-masked copy, not this table.
697695
"""
698696
cache = getattr(self, "_spec_slot_table_cache", None)
699697
if cache is None:
@@ -734,14 +732,19 @@ def _verify_batched_ssm(
734732
`intermediate_ssm` as a flat `[slot * step]` pool via a 2D index table,
735733
so every per-step state lands where SGLang's
736734
`fused_mamba_state_scatter_with_mask` expects it. The live SSM state is
737-
never written, so it needs no snapshot/restore.
735+
only read.
738736
739737
The conv update is folded into one wide-window call over SGLang's
740738
deduplicated sliding-window `intermediate_conv_window`.
741739
742-
Equivalence with the stepwise loop is covered bit-for-bit by
743-
tests/plugin/test_gdn_target_verify_batched_equiv.py and
744-
tests/plugin/test_sglang_gdn_verify_batched_ssm.py.
740+
tests/plugin/test_gdn_target_verify_batched_equiv.py checks this call
741+
pattern bit-for-bit against a per-step loop, using its own stand-in
742+
call rather than this method.
743+
tests/plugin/test_sglang_gdn_verify_batched_ssm.py drives this method
744+
through forward() and checks the plugin contract: both buffers have
745+
nonzero contents for each live request at steps 1..draft-1 (SSM
746+
step 0 is host-seeded), the live state is untouched, one conv and
747+
one SSM kernel call, and pad rows give zero output.
745748
"""
746749
query_all, key_all, value_all, g, beta = self._spec_conv_qkv(
747750
layer_cache=layer_cache,
@@ -765,6 +768,10 @@ def _verify_batched_ssm(
765768
"intermediate_ssm buffer."
766769
)
767770
slot_table = self._spec_ssm_slot_table(bs, draft_token_num, mixed_blocks.device)
771+
# A pad row (cache index < 0) gets no conv output, so its q/k/v are
772+
# uninitialised. Slot -1 makes the kernel zero its output and skip its
773+
# state.
774+
ssm_state_indices = torch.where(cache_indices.view(bs, 1) < 0, -1, slot_table)
768775
flat_phys = pool.view(pool.shape[0] * pool.shape[1], *pool.shape[2:])
769776
# FlyDSL keeps live state as a logical KV view over physical VK.
770777
# ``intermediate_ssm`` is that same physical layout. A transpose view
@@ -791,7 +798,7 @@ def _verify_batched_ssm(
791798
initial_state=recurrent_state,
792799
inplace_final_state=True,
793800
cu_seqlens=cu_seqlens,
794-
ssm_state_indices=slot_table,
801+
ssm_state_indices=ssm_state_indices,
795802
use_qk_l2norm_in_kernel=True,
796803
)
797804
output_blocks.copy_(
@@ -867,20 +874,19 @@ def _spec_conv_window_phys(
867874
with `view[s, t, d, w] = phys[s, d, t + w]` (see `MambaPool.__init__`
868875
and `conv_window_dedup_enabled` in SGLang's memory_pool.py). That
869876
physical row is exactly what ATOM's spec `causal_conv1d_update` writes,
870-
so recovering it lets one call replace the whole per-step loop.
877+
so recovering it lets one call write every step's window.
871878
872-
Raises when the view is not that dedup layout. DFLASH target verify on
873-
ROCm requires the linear-chain deduplicated layout.
879+
Raises when the view is not that dedup layout, which GDN target
880+
verify on ROCm requires.
874881
"""
875882
if window_view.ndim != 4:
876883
raise RuntimeError(
877-
"ATOM GDN batched TARGET_VERIFY requires a rank-4 "
878-
"intermediate_conv_window."
884+
"ATOM GDN TARGET_VERIFY requires a rank-4 intermediate_conv_window."
879885
)
880886
num_slots, draft, dim, win = window_view.shape
881887
if draft != draft_token_num:
882888
raise RuntimeError(
883-
"ATOM GDN batched TARGET_VERIFY received an incompatible "
889+
"ATOM GDN TARGET_VERIFY received an incompatible "
884890
f"draft dimension: expected {draft_token_num}, got {draft}."
885891
)
886892
shared_win = draft + win - 1
@@ -894,7 +900,7 @@ def _spec_conv_window_phys(
894900
or stride_slot != dim * shared_win
895901
):
896902
raise RuntimeError(
897-
"ATOM GDN batched TARGET_VERIFY requires SGLang's "
903+
"ATOM GDN TARGET_VERIFY requires SGLang's "
898904
"deduplicated sliding-window intermediate_conv_window "
899905
f"(shape={tuple(window_view.shape)} "
900906
f"stride={tuple(window_view.stride())})."
@@ -1087,9 +1093,10 @@ def _build_gdn_metadata(
10871093
) -> GDNAttentionMetadata | None:
10881094
mode = forward_batch.forward_mode
10891095
if mode.is_target_verify():
1090-
# SGLangGatedDeltaNet fills SGLang's transactional snapshots using
1091-
# ATOM's stepwise kernels. Keep the outer ATOM context active for
1092-
# MoE, norms and collectives without native GDN metadata.
1096+
# TARGET_VERIFY runs SGLangGatedDeltaNet's own conv + SSM verify
1097+
# (ReplaySSM, or the batched path with ATOM_ENABLE_REPLAYSSM=0) and
1098+
# needs no native GDN metadata. Keep the outer ATOM context active
1099+
# for MoE, norms and collectives.
10931100
return None
10941101

10951102
bs = forward_batch.batch_size

‎tests/plugin/test_gdn_target_verify_batched_equiv.py‎

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
"""Differential tests for the default batched GDN target-verify path.
1+
"""Differential tests for the batched GDN target-verify path.
22
3-
The production SGLang plugin folds the whole draft block into one conv update
4-
and one SSM recurrent call. These tests retain the removed per-draft-step
5-
implementation as a test-only numerical reference.
3+
The SGLang plugin's batched TARGET_VERIFY path (``ATOM_ENABLE_REPLAYSSM=0``)
4+
folds the whole draft block into one conv update and one SSM recurrent call.
5+
These tests retain the removed per-draft-step implementation as a test-only
6+
numerical reference.
67
78
These tests check, with the real kernels, whether the two call patterns are
89
numerically interchangeable, and whether SGLang's buffer layouts can be
@@ -17,10 +18,15 @@
1718
1819
The negative-control tests exist so that a future refactor cannot make the
1920
equivalence tests pass vacuously: they assert that realistic adapter bugs are
20-
still detected. See section 17 of ``ATOM_Qwen3.5_DFLASH_TP8复现与实现报告.md``.
21-
22-
Apart from ``_conv_batched_live``, which repeats the plugin's production conv
23-
call (``_spec_conv_qkv``), nothing here touches the plugin's production path.
21+
still detected.
22+
23+
These tests call the kernels directly, not the plugin's ``forward()`` or
24+
``_verify_batched_ssm``. ``_conv_batched_live`` repeats the kernel call from
25+
``_spec_conv_qkv``. The SSM stand-in ``_ssm_batched`` covers only the plain
26+
state layout (no FlyDSL logical KV view), slots ``cache_index * draft + step``
27+
and no pad rows;
28+
``test_sglang_gdn_verify_batched_ssm.py`` covers the plugin's own call through
29+
``forward()``.
2430
"""
2531

2632
from __future__ import annotations
@@ -50,7 +56,6 @@
5056

5157
NUM_SLOTS = 24
5258

53-
# Draft lengths spanning the sweep in section 16 of the report.
5459
DRAFT_LENS = [4, 8, 16]
5560
BATCH_SIZES = [1, 3]
5661

@@ -217,16 +222,6 @@ def test_ssm_per_step_loop_matches_batched_slot_table(bs: int, draft: int):
217222
torch.testing.assert_close(inter_b, inter_a, rtol=0, atol=0)
218223

219224

220-
@pytest.mark.parametrize("draft", DRAFT_LENS)
221-
def test_batched_ssm_leaves_live_state_untouched(draft: int):
222-
"""The batched path writes only into the slot pool, so the plugin's
223-
snapshot/restore of the live SSM state becomes unnecessary."""
224-
inp = _Inputs(3, draft)
225-
live_before = inp.live_ssm.clone()
226-
_ssm_batched(inp)
227-
torch.testing.assert_close(inp.live_ssm, live_before, rtol=0, atol=0)
228-
229-
230225
def test_ssm_equivalence_detects_collapsed_slot_table():
231226
"""Negative control: a naive adapter reusing one slot for every step (what
232227
a 1D index table would do) must NOT compare equal.
@@ -260,7 +255,8 @@ def test_ssm_equivalence_detects_missing_live_state_seed():
260255
# Conv
261256
# --------------------------------------------------------------------------
262257
def _conv_per_step_loop(inp: _Inputs):
263-
"""Plugin behaviour today: one narrow-window update per draft step."""
258+
"""Removed production path (one narrow-window update per draft step), retained
259+
as a test-only numerical reference."""
264260
conv = inp.live_conv.clone()
265261
qkv = torch.zeros(inp.bs, inp.draft, CONV_DIM, device="cuda", dtype=torch.bfloat16)
266262
windows = torch.zeros(
@@ -438,7 +434,7 @@ def test_intermediate_ssm_layout_is_flattenable():
438434
439435
This mirrors the allocation in SGLang's
440436
``MambaPool.__init__`` (memory_pool.py); if that ever stops being
441-
contiguous the conversion layer must copy instead of view."""
437+
contiguous, ``_verify_batched_ssm`` raises rather than viewing it."""
442438
draft = 8
443439
layers, slots = 2, NUM_SLOTS
444440
cache = torch.zeros(

0 commit comments

Comments
 (0)