[Bugfix][Core] Exempt exactly the blocks an async KV load writes from zeroing (#59504)

Signed-off-by: Yifan Qiao <yifanqiao@inferact.ai>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Yifan Qiao
2026-10-03 06:26:12 +00:00
committed by GitHub
co-authored by Claude Opus 5.5 Codex
parent 1a001d5842
commit ca0df1f122
17 changed files with 162 additions and 72 deletions
+4 -4
View File
@@ -689,10 +689,10 @@ class SingleDirectionOffloadingHandler:
# Stores must wait for the model to finish writing the KV they read.
# Loads must wait for pending writes (including zeroing) to their
# destination blocks: the scheduler's _skip_zero_block_ids only edits
# the step being scheduled and cannot retract zeroing shipped in an
# earlier step for a since-reallocated block; with async scheduling
# nothing else orders that zeroing against this copy.
# destination blocks: the scheduler leaves a block unzeroed only in
# the step that allocates it for the load and cannot retract zeroing
# shipped in an earlier step for a since-reallocated block; with async
# scheduling nothing else orders that zeroing against this copy.
stream.wait_stream(current_platform.current_stream())
if self._transfers:
last_transfer: Transfer = self._transfers[-1]