[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:
@@ -144,6 +144,11 @@ class BlockTable:
|
||||
block_table_np = self.block_table.np
|
||||
block_table_np[tgt, :num_blocks] = block_table_np[src, :num_blocks]
|
||||
self.num_blocks_per_row[tgt] = num_blocks
|
||||
# Clear the vacated source row: dummy-run batches dereference stale
|
||||
# rows as mamba state slots and write state in place there, possibly
|
||||
# after the blocks have been freed and reallocated.
|
||||
block_table_np[src, :num_blocks] = 0
|
||||
self.num_blocks_per_row[src] = 0
|
||||
|
||||
def swap_row(self, src: int, tgt: int) -> None:
|
||||
src_tgt, tgt_src = [src, tgt], [tgt, src]
|
||||
|
||||
Reference in New Issue
Block a user