[Bugfix][DSv4.1] Preserve NaN-scored candidate block indices (#57454)

Signed-off-by: Woosuk Kwon <woosuk@inferact.ai>
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Woosuk Kwon
2026-09-17 19:00:10 -07:00
committed by GitHub
co-authored by Codex
parent 2c88fb131c
commit 64563d0ec4
2 changed files with 23 additions and 2 deletions
@@ -66,9 +66,10 @@ def _store_candidates_kernel(
cols = tl.program_id(1) * TILE + tl.arange(0, TILE)
value = tl.load(values + row * k + cols, cols < k, other=-float("inf"))
index = tl.load(indices + row * k + cols, cols < k, other=-1)
# NaN scores can occur during warmup; only -inf denotes padding.
tl.store(
output + row * out_stride_row + cols * out_stride_col,
tl.where(value > -float("inf"), index, -1),
tl.where(value != -float("inf"), index, -1),
cols < OUT_K,
)