[BugFix] Stop dummy runs from writing mamba state through stale block-table rows (#49757)

Signed-off-by: Nick Hill <nickhill123@gmail.com>
Signed-off-by: Jeff Ma <jeffjma@umich.edu>
Co-authored-by: Jeff Ma <jeffjma@umich.edu>
This commit is contained in:
Nick Hill
2026-07-29 01:09:41 +00:00
committed by GitHub
co-authored by Jeff Ma
parent 56f31af62a
commit 6fbbcf2151
5 changed files with 86 additions and 2 deletions
+7 -1
View File
@@ -163,7 +163,13 @@ class BlockTables:
# Therefore, this method must return the persistent tensor
# with the same memory address as that used during the model's forward pass,
# rather than allocating a new tensor.
return tuple(block_table[:num_reqs] for block_table in self.input_block_tables)
#
# Zero the rows so dummy runs write mamba state to the reserved null
# block rather than through the previous real step's (stale) block
# ids, which may point at blocks since freed and reallocated.
return tuple(
block_table[:num_reqs].zero_() for block_table in self.input_block_tables
)
def compute_slot_mappings(
self,