unsloth/studio/backend
Daniel Han bc00a8e797 Serialize the GPU handoffs, gate DiT training on a GPU, and keep 3.9 installable
Six review findings, three of them evict-then-fail orderings:

- The chat load reclaimed the GPU without telling the arbiter it existed. A
  chat load holds no llama-server process until its GGUF has downloaded,
  which is minutes, so a competing Images/Video acquire in that window
  found nothing to cancel, took the GPU, and the chat load then spawned
  onto the same device. It now registers an in-flight marker through
  acquire_for's register hook (under the arbiter lock, as the image and
  video loads do), the evictor cancels a marked load, and the route undoes
  itself if ownership moved while it loaded.
- The Hub-download conflict check ran after that handoff, so a GGUF the
  download manager already owns destroyed the resident Images/Video
  pipeline and then 409'd, having loaded nothing. It moves above the
  handoff, together with the marker it handshakes with.
- The image load released the engine router's transition lock before
  registering the load, so a second load choosing the other engine could
  unload the still-idle engine this one captured; the load then landed on a
  deactivated engine, where generate, status, unload and the arbiter's
  evictor can no longer reach it. Registration now happens under that lock
  and refuses if the engine changed.
- Training a DiT family on a host with no GPU was accepted: nf4 is not a
  CPU fallback, its 4-bit load goes through bitsandbytes, which requires
  CUDA, XPU or MPS. The start unloaded the working Images pipeline, pulled
  the text encoders, and only then died in the child. Rejected before the
  teardown now, and /info stops advertising a precision that always 400s.
  SDXL keeps its documented fp32-on-CPU path.
- Both diffusion pages kept the routed-pick marker forever, so re-picking
  the same checkpoint (after chat evicted it) neither loaded nor cleared
  the query string. The marker is released once the query is gone. The
  Images key also carried a stray NUL byte, which made the file read as
  binary to grep and other tooling.
- diffusers dropped Python 3.9 in 0.38, so the unconditional >=0.39.0 pin
  left pip no candidate at all on 3.9 and made every install that composes
  the huggingface extras unresolvable there. The floor is conditional now.

Also fixes tests that were already red on the branch: two hand-built
request fakes had gone stale against fields this branch added, and the
handoff-ordering test only failed on a host with fewer than two GPUs.
2026-07-26 14:46:02 +00:00
..
assets feat(studio): add DoRA support to studio (#7315) 2026-07-24 03:24:16 -07:00
auth Studio: reject whitespace-only passwords (#7341) 2026-07-23 00:44:37 -07:00
core Serialize the GPU handoffs, gate DiT training on a GPU, and keep 3.9 installable 2026-07-26 14:46:02 +00:00
hub [pre-commit.ci] auto fixes from pre-commit.com hooks 2026-07-26 13:37:29 +00:00
loggers Studio: quiet noisy logs, log real progress, and speed up Windows/macOS dataset prep (#7087) 2026-07-15 06:49:52 -07:00
models Add the diffusion download plan endpoint 2026-07-26 04:56:16 -07:00
picker Studio: add configurable model download location (#7274) 2026-07-23 01:34:38 -07:00
plugins Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
requirements Merge origin/main into image-generation (PR #6763) 2026-07-25 00:34:38 -07:00
routes Serialize the GPU handoffs, gate DiT training on a GPU, and keep 3.9 installable 2026-07-26 14:46:02 +00:00
state Studio: shareable per-checkpoint preview links (#6486) 2026-06-24 06:31:53 -07:00
storage fix(studio): persist connection model selections for remote clients (#7298) 2026-07-23 19:11:50 -07:00
tests Serialize the GPU handoffs, gate DiT training on a GPU, and keep 3.9 installable 2026-07-26 14:46:02 +00:00
utils Studio: fail fast on out-of-disk instead of a doomed llama.cpp source build (#7420) 2026-07-26 00:11:38 -07:00
__init__.py Final cleanup 2026-03-12 18:28:04 +00:00
_platform_compat.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
cloudflare_tunnel.py Studio: fix stuck composer prompt on first send and unreachable --secure Cloudflare links (#7340) 2026-07-23 00:39:14 -07:00
colab.py fix(studio/colab): fix OutStream startup crash and tidy the notebook cards (#7404) 2026-07-25 04:11:03 -07:00
main.py Merge origin/main into image-generation (PR #6763) 2026-07-25 00:34:38 -07:00
mcp_server.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
run.py fix(studio): support hostname-based enterprise proxies (#7416) 2026-07-26 02:53:00 +01:00
startup_banner.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00