From 6f4bbc997ad762fef69bf2f2acd0c257bc7c45f6 Mon Sep 17 00:00:00 2001 From: biondizzle Date: Mon, 1 Jun 2026 22:32:40 +0000 Subject: [PATCH] Add sync after sampler for step<3 to catch async CUDA errors early --- single_shot_inference.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/single_shot_inference.py b/single_shot_inference.py index ba747902..4ef98edf 100644 --- a/single_shot_inference.py +++ b/single_shot_inference.py @@ -1034,6 +1034,9 @@ def main(): recent_tokens=all_tokens[-256:], seed=SEED, ) + # Check for async CUDA errors from sampler + if step < 3: + torch.cuda.synchronize() next_id = sampled[0].item() all_tokens.append(next_id)