Skip to content

CI: a stuck CUDA redist staging directory no longer fails the Windows CUDA job - #112

Merged
danielhanchen merged 2 commits into
masterfrom
ci-cuda-redist-cleanup-tolerant
Dec 2, 2026
Merged

danielhanchen merged 2 commits into
masterfrom
ci-cuda-redist-cleanup-tolerant

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Problem

The scheduled and dispatched prebuilt runs keep losing the Windows CUDA 13 assets. In run 46820687136 (master-982-0518b34-uc4b0713), windows-x64-cuda13-portable and windows-x64-cuda13-older failed in "Install CUDA toolkit 13.3" on the staging cleanup:

Remove-Item -Recurse -Force $zip, (Join-Path $stage $name)
The directory is not empty: ...\cuda-redist\cuda_crt-windows-x86_64-13.3.33-archive

The publish job still ran, so the release shipped 19 of 22 assets, without:

  • sd-*-bin-win-cuda13-x64.zip
  • sd-*-windows-x64-cuda13-newer.zip
  • sd-*-windows-x64-cuda13-older.zip

The same error hit windows-x64-cuda13-older in the f22ff38 run and in the cancelled 367b615 run. A release with missing assets cannot be pinned by Studio, and gh run rerun --failed is refused for these runs.

Fix

That Remove-Item only frees runner disk after the component has already been copied into the toolkit prefix. It now retries up to 3 times, 5 s apart, removing only paths that still exist. If the directory is still held open after the third attempt, it logs a warning and the job continues instead of failing.

Tests

  • The workflow file parses as YAML.
  • The loop was run under pwsh 7 with one removable staging pair and one undeletable directory. The removable pair and the second zip are deleted. The undeletable directory produces one warning after three attempts, and the loop continues to the next component.
  • The next dispatch of the prebuilt workflow from master is the end-to-end check: it should publish all 22 assets.

@danielhanchen danielhanchen self-assigned this Dec 2, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-02T08:27:01.091185Z dc7cf78 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: dc7cf78615

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 0c69df2 into master Dec 2, 2026
7 checks passed
danielhanchen added a commit to unslothai/unsloth that referenced this pull request Dec 2, 2026
…GroupNorm fallback fix) (#20791)

## Summary

Moves the Studio sd.cpp prebuilt pin from `master-982-0518b34-uf22ff38`
to `master-982-0518b34-u0c69df2` (unslothai/stable-diffusion.cpp at
`0c69df28`). The new build adds three fork changes:

- unslothai/stable-diffusion.cpp#110 (from upstream #2476): the
MiniMax-H3 video VAE pads the last frames into one allocation instead of
one full-clip concat per padded frame. In the encoder, CausalConv3d does
its reflection, downsample end padding and causal zero frames in one
padding op. On CUDA / HIP, TemporalGroupNorm runs GroupNorm + affine +
SiLU as one frame-norm op. CPU, Metal and Vulkan build one batched
GroupNorm over all frames instead of a slice, norm and concat per frame.
- unslothai/stable-diffusion.cpp#111: SYCL and OpenCL keep the per-frame
GroupNorm fallback. The CPU, CUDA, Vulkan and Metal graphs are the same
as in #110.
- unslothai/stable-diffusion.cpp#112: CI only. The Windows CUDA 13
toolkit install no longer fails when it cleans up an extracted redist
folder that is not yet empty. That failure is why the `c4b0713` build
published without its three Windows CUDA 13 bundles, so this build is
the one to pin.

`0c69df28` is three commits ahead of `f22ff38d31`. The source changes
are in `src/model/vae/minimax_h3_vae.hpp`, `src/core/ggml_extensions.*`,
`src/core/ggml_extend.*` and two new CUDA files (`vae_frame_norm.cu`,
`vae_pad.cu`); #112 only touches
`.github/workflows/unsloth-sd-prebuilt.yml`. ggml and the fork's ggml
patch list are unchanged.

## Changes

- `install_sd_cpp_prebuilt.py`: `DEFAULT_TAG` and
`PINNED_RELEASE_ASSETS` move to the new tag, with all 22 assets and
their sha256. The digests come from the release's
`sd-prebuilt-sha256.json`. The two JSON files were hashed after
download. All 22 match the digests the GitHub releases API reports.
- `sd_cpp_args.py`: the new tag joins `METAL_IMPLICIT_GEMM_CONV_TAGS`
and `VULKAN_PAGEABLE_OFFLOAD_TAGS`. `0c69df28` descends from
`f22ff38d31`, so it still carries #103 (implicit GEMM Metal CONV_2D) and
#106 (Vulkan offload in pageable RAM).
- Tests that name the pin move with it:
`test_diffusion_more_families.py`, `test_sd_cpp_args.py` (new row;
`uf22ff38` stays as the previous pin), `test_sd_cpp_cuda_cpu_torch.py`,
`test_sd_cpp_vulkan_cpu_torch.py`,
`test_sd_cpp_metal_vae_conv_default.py`,
`test_sd_cpp_metal_vae_conv_direct.py`,
`test_sd_cpp_metal_vae_conv_status_argv.py` and
`test_h3_native_pageable_offload.py`. The last one now also checks that
`u9213d05` and `ub6ed0ee` stay pageable.

## Tests

Release check: the release is published (not a draft, not a prerelease)
with the same 22 asset names as `uf22ff38`. Apart from the tag, source
commit, timestamp and hashes, `sd-prebuilt-manifest.json` is the same as
the old one, including the asset and CUDA coverage rows.

Linux x86_64 CPU, `uf22ff38` vs `uc4b0713` (the build of #110 + #111;
`u0c69df2` adds only the CI change of #112), using the release zips:
FLUX.2 klein 4B Q4_K_M (4 steps) and Z-Image-Turbo Q4_K_M (8 steps),
256x256, seed 42, `--rng cpu`, Studio's `--flash-attn
off,diffusion=on,te=auto`, 8 threads, A B B A, each render in a fresh
process. For each model all four PNGs are byte-identical. Each log
reports its own tag and commit.

MiniMax-H3 on CUDA, from the fork PR #110 run on an L4 (sm_89): Ref2VA
at 864x480, 124-frame reference video, 8 steps, plain decode,
unsloth/MiniMax-H3-GGUF ref2va Q4_K.

| build | request (s) | decode (s) | output md5 |
| --- | --- | --- | --- |
| before #110 | 848.3 | 48.5 | 2da16326 |
| #110 | 790.3, 794.0 | 48.5, 51.5 | 2da16326 |

The request is 6.5% faster and the output video is byte-identical. The
fork PR also reports the padding step at 124 -> 136 frames, 864x480,
going from 4.78 s to 0.36 s with peak memory 1885 -> 1242 MiB, and CPU
VAE encode latents byte-identical before and after.

Unit tests: the sd.cpp, installer and H3 suites (136 files) give 4639
passed on this branch and 4638 on main. The extra case is the new
previous-pin row. The same 57 failed and 64 errored test IDs show up on
both sides; they are mostly in the H3 image suites, fail the same way on
main, and do not touch the pin. `test_sd_cpp_pinned_prebuilt.py` and
`test_sd_cpp_install_ratelimit.py` pass on this branch. With the pin on
the incomplete `uc4b0713` release (19 assets),
`test_sd_cpp_pinned_prebuilt.py` fails 9 tests (the Windows CUDA 13
routing cases and
`test_the_shipped_asset_list_carries_every_cuda_family_bundle`), so the
suite catches a release that is missing bundles.

## Not covered

- The CPU renders used the `uc4b0713` zips, not `u0c69df2`. The only
change between them is the CI workflow.
- The L4 numbers come from the fork PR's build, not from this release's
CUDA bundle. No new GPU render was made for this pin.
- No Metal, Vulkan, ROCm or Windows render was run for this pin. Metal
and Vulkan take the batched GroupNorm path. In the fork PR, Linux RADV
only measured the padding step (2.3 s to 0.6 s), because every render at
that size, master included, hit `ErrorDeviceLost` in DiT sampling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant