Skip to content

Studio: support current native builds and preserve CPU asset selection - #12902

Merged
mahiatlinux merged 5 commits into
unslothai:mainfrom
oobabooga:fix/h3-amd-native
Oct 7, 2026
Merged

mahiatlinux merged 5 commits into
unslothai:mainfrom
oobabooga:fix/h3-amd-native

Conversation

@oobabooga

Copy link
Copy Markdown
Member

With win-cpu-x64 and win-vulkan-x64 in the same release, a Windows CPU install can pick the Vulkan zip depending on the order GitHub returns the assets. unslothai/stable-diffusion.cpp#22 adds that second asset. The prebuilt pin update will follow in a separate PR once that release is published.

Newer sd.cpp builds also lose Studio's VRAM headroom setting, and a native abort can leave the user with the end of a backtrace instead of the error that caused it.

Root cause

  • For Windows auto and cpu, resolve_release_asset looks for avx2. The Unsloth CPU asset is named win-cpu-x64, so the resolver falls back to the first Windows asset, including a GPU build.
  • The graph-cut probe requires both --max-vram and --stream-layers. Current native builds stream automatically and have removed --stream-layers, so the check fails and Studio omits --max-vram -1 too.
  • The CLI engine keeps 40 output lines and reports the last 12 on failure. A long backtrace pushes the original error out of both.

Fix

  • Remove accelerator builds from the Windows CPU candidate list before applying the AVX2 preference. A release with only GPU builds returns no match, allowing the existing installer fallback to run.
  • Add --max-vram -1 when the binary advertises it. Add --stream-layers only when it is advertised and CPU weight offload is enabled. An unreadable help response adds neither flag.
  • Keep 200 output lines in the CLI engine and use the same diagnostic-tail selection as the server, so error lines survive a long backtrace.

Testing

  • Installer and ROCm/Vulkan fallback suites: 450 passed, 1 skipped. The new cases cover both asset orders, auto and cpu, GPU-only releases, GPU assets with avx2 in their names, and the existing CPU AVX2 preference. Twelve cases fail before the fix.
  • Backend/video tests: 588 passed. Engine/server tests: 83 passed. Coverage includes old and current help output, CPU fallback, and unreadable help.
  • Probed compiled old and current binaries: the old one advertises both graph-cut flags, the current one only --max-vram.
  • Live child-process A/B on Linux and Windows: an error followed by 80 backtrace lines loses its original reason before the change and retains it afterwards.
  • Lint passed for the changed capability and resolver files.

Native builds from that PR's source also completed MiniMax-H3 generation on both AMD runners: Linux / Windows. Those checks ran the native CLI directly. Loading and generating through the Studio UI was not tested.

@oobabooga

Copy link
Copy Markdown
Member Author

Reached Codex review convergence at oobabooga#341.

@mahiatlinux

Copy link
Copy Markdown
Contributor

Review and verification evidence

Verified the PR from merge base e7cc9d5e431748f92b54ed1662640f22b774bff0 through repaired source head 0556ac6a07e30127b51d51707645deacee58185c.

Observed behavior

  • On native Windows, the repaired resolver selected win-cpu-x64 for both auto and cpu regardless of whether the CPU or Vulkan asset appeared first. It also rejected GPU-only Windows releases and preserved the existing CPU AVX2 preference.
  • The Windows mutation restored the prior fallback behavior and failed by selecting win-vulkan-x64 when Vulkan appeared first.
  • The repaired graph-cut probe retained --max-vram -1 for current binaries that no longer advertise --stream-layers, and the diagnostic tail retained the original native error through a long backtrace.
  • The backend mutation restored the paired-flag requirement and short output history. It failed the current-build graph-cut cases and both diagnostic-tail cases.

Executed checks

  • Native Windows resolver probe: passed on Microsoft-hosted Windows AMD64 with CPython 3.13.15.
  • Windows negative control: failed as expected when the repaired resolver was replaced with the prior implementation. The failing assertion showed auto selecting the Vulkan zip instead of the CPU zip.
  • Focused backend regression suite: 9 passed on Ubuntu with CPython 3.13.15.
  • Backend negative control: 4 failed and 5 passed as expected after restoring the paired-flag requirement and 40-line output history.
  • Comment-only gate on the final cleanup commit: Python ASTs unchanged across all 4 cleaned files.
  • Ruff 0.6.9 formatting and lint: passed for all 4 cleaned files in an isolated local environment.

The only reviewer-authored source change is 0556ac6a07e30127b51d51707645deacee58185c, which trims PR-scoped comments and docstrings. The comment-only checker verified that this cleanup did not alter executable Python ASTs.

The capability check was also compared with current unslothai/stable-diffusion.cpp source at 7bbffa35fc3571bcb9116212c60762f461e67e85: it advertises --max-vram and not --stream-layers. The future Windows asset names are documented by stable-diffusion.cpp PR 22.

No UI surface changed, so screenshot evidence is not applicable. Interactive Studio generation with a native H3 model was not run in this review; verification covered native Windows asset selection and the changed backend behavior on hosted runners.

@mahiatlinux
mahiatlinux self-requested a review October 7, 2026 01:45

@mahiatlinux mahiatlinux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Ready to merge, all manually checked.

@mahiatlinux
mahiatlinux merged commit 5a3d892 into unslothai:main Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants