Synchronize H3 sampler captures

This commit is contained in:
Daniel Maddern 2026-08-13 13:13:29 +07:00
parent 985a529fc9
commit 663534f5dc

View file

@ -13,6 +13,7 @@ new = (
" capture_dir = os.getenv(\"H3_SAMPLER_CAPTURE_DIR\")\n"
" if capture_dir:\n"
" os.makedirs(capture_dir, exist_ok=True)\n"
" torch.cuda.synchronize(x[\"x\"].device)\n"
" if x[\"i\"] == 0:\n"
" torch.save({\"sigmas\": sigmas.detach().cpu(), \"initial_x\": x[\"x\"].detach().cpu()}, os.path.join(capture_dir, \"initial.pt\"))\n"
" torch.save({\"sigma\": x[\"sigma\"].detach().cpu(), \"denoised\": x[\"denoised\"].detach().cpu(), \"x\": x[\"x\"].detach().cpu()}, os.path.join(capture_dir, f\"step_{x[\"i\"]:02d}.pt\"))\n"