[CI][Bugfix] Fix flaky test_store_orders_after_compute_write (#50926)

Signed-off-by: Nick Hill <nickhill123@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Nick Hill
2026-08-04 00:54:49 +00:00
committed by GitHub
co-authored by Claude
parent 413e70d52c
commit 74295e3bd4
@@ -100,6 +100,13 @@ def _drive_store(
if int((cpu[:, 0].to(torch.int32) != val).sum().item()):
corrupt += 1
# Drain the compute stream before returning: in the no-barrier control
# phase the store never waits on compute, so the host loop runs far ahead
# and leaves a backlog of sleep+fill kernels in flight. Without this, the
# leftover control-phase fills race the barrier phase's fill->copy window
# on the shared gpu tensor and flakily corrupt one iteration.
compute_stream.synchronize()
return corrupt