[Bugfix][DSv4.1] Keep the compressor ring out of the null block (#58560)

Signed-off-by: bluemelov <hannes.b2411@eva.space>
Signed-off-by: Yifan Qiao <yifanqiao@inferact.ai>
Co-authored-by: bluemelov <hannes.b2411@eva.space>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Yifan Qiao <yifanqiao@inferact.ai>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bluemelov
2026-10-05 01:49:41 +00:00
committed by GitHub
co-authored by bluemelov Cursor Yifan Qiao Claude Opus 5.5
parent 1388100560
commit 49e0f47978
2 changed files with 20 additions and 14 deletions
+5 -1
View File
@@ -75,8 +75,12 @@ def _ring_slot_mapping_kernel(
block = tl.load(block_table_ptr + req * block_table_stride, mask=valid, other=0)
pos = tl.load(positions_ptr + offsets, mask=valid, other=0)
slot = block.to(tl.int64) * CAPACITY + pos % CAPACITY
# Block 0 is the null block. A request without a ring block (dummy or padding
# rows, which the runners fill with the null block) must not write.
tl.store(
slot_mapping_ptr + offsets, tl.where(valid, slot, -1), mask=offsets < num_tokens
slot_mapping_ptr + offsets,
tl.where(valid & (block != 0), slot, -1),
mask=offsets < num_tokens,
)