unsloth/studio/backend
Daniel Han 90ac3b7734
Some checks are pending
CodeQL / Languages to analyse (push) Waiting to run
CodeQL / Analyze () (push) Blocked by required conditions
CodeQL / Prune superseded CodeQL overlay bases (push) Blocked by required conditions
Core / Resolve the unsloth_zoo revision (push) Waiting to run
Core / Core (HF=default + TRL=default) (push) Blocked by required conditions
Core / Core (HF=4.57.6 + TRL<1) (push) Blocked by required conditions
Core / Core (HF=latest + TRL=latest) (push) Blocked by required conditions
Core / Core zoo (HF=default + TRL=default) (push) Blocked by required conditions
Core / Core zoo (HF=4.57.6 + TRL<1) (push) Blocked by required conditions
Core / Core zoo (HF=latest + TRL=latest) (push) Blocked by required conditions
Core / llama.cpp build + smoke (push) Waiting to run
Cross-platform parity / parity (ubuntu-latest) (push) Waiting to run
Cross-platform parity / parity (windows-latest) (push) Waiting to run
Interrupted install recovery / select legs (push) Waiting to run
Interrupted install recovery / kill@ (push) Blocked by required conditions
Interrupted install recovery / windows kill@ (push) Blocked by required conditions
Kaggle T4 Notebook CI / gate (push) Waiting to run
Kaggle T4 Notebook CI / T4 smoke (push) Blocked by required conditions
Kaggle T4 Unsloth GPU CI / gate (push) Waiting to run
Kaggle T4 Unsloth GPU CI / Unsloth GPU smoke (push) Blocked by required conditions
Lint CI / Source lint (Python + shell + YAML + JSON + safety nets) (push) Waiting to run
Local Agent Guides CI / connection (claude, stable) (push) Waiting to run
Local Agent Guides CI / connection (codex, stable) (push) Waiting to run
Local Agent Guides CI / connection (dsh, stable) (push) Waiting to run
Local Agent Guides CI / connection (hermes, stable) (push) Waiting to run
Local Agent Guides CI / connection (openclaw, stable) (push) Waiting to run
Local Agent Guides CI / connection (opencode, stable) (push) Waiting to run
Local Agent Guides CI / connection (opencode, v2) (push) Waiting to run
Local Agent Guides CI / connection (pi, stable) (push) Waiting to run
Local Agent Guides CI / connection (vibe, stable) (push) Waiting to run
Local Agent Guides CI / file-edit (claude) (push) Waiting to run
Local Agent Guides CI / file-edit (codex) (push) Waiting to run
Local Agent Guides CI / file-edit (dsh) (push) Waiting to run
Local Agent Guides CI / file-edit (hermes) (push) Waiting to run
Local Agent Guides CI / file-edit (openclaw) (push) Waiting to run
Local Agent Guides CI / file-edit (opencode) (push) Waiting to run
Local Agent Guides CI / file-edit (pi) (push) Waiting to run
Local Agent Guides CI / file-edit (vibe) (push) Waiting to run
Local Agent Guides CI / resume (claude) (push) Waiting to run
Local Agent Guides CI / resume (codex) (push) Waiting to run
Local Agent Guides CI / resume (opencode) (push) Waiting to run
Local Agent Guides CI / resume (pi) (push) Waiting to run
Local Agent Guides CI / prompt-cache (gemma-3-270m) (push) Waiting to run
MLX CI on Mac M1 / dispatch (push) Waiting to run
Security audit / advisory audit (pip + npm + cargo) (push) Waiting to run
Security audit / pip scan-packages :: audio-torch280 (push) Waiting to run
Security audit / pip scan-packages :: audio-torch290 (push) Waiting to run
Security audit / pip scan-packages :: extras (push) Waiting to run
Security audit / pip scan-packages :: studio (push) Waiting to run
Security audit / pip scan-packages :: hf-stack (push) Waiting to run
Security audit / npm scan-packages (Unsloth frontend tarballs) (push) Waiting to run
Security audit / npm provenance + new install-script diff (push) Waiting to run
Unsloth API CI / Unsloth API & Auth Tests (push) Waiting to run
Backend CI / (Python 3.11, floor) (push) Waiting to run
Backend CI / (Python 3.13, a-k) (push) Waiting to run
Backend CI / (Python 3.13, l-r) (push) Waiting to run
Backend CI / (Python 3.13, rest) (push) Waiting to run
Backend CI / Repo tests (CPU, rest) (push) Waiting to run
Backend CI / Repo tests (CPU, studio) (push) Waiting to run
Backend CI / Repo tests (CPU, studio-install) (push) Waiting to run
Backend CI / Shell installer tests (push) Waiting to run
Frontend CI / Frontend build + bundle sanity (push) Waiting to run
Frontend CI / Frontend unit tests (Windows) (push) Waiting to run
Unsloth GGUF CI / GGUF inference smoke (API, tools, vision) (push) Waiting to run
Mac Unsloth Install Matrix CI / Install + load (macos-15) (push) Waiting to run
Mac Unsloth Install Matrix CI / Install + load (macos-26) (push) Waiting to run
Mac Unsloth Install Matrix CI / Install + load (macos-15-intel) (push) Waiting to run
Mac Unsloth Install Matrix CI / Install + load (macos-26-intel) (push) Waiting to run
Mac Unsloth UI + API + Update + Inference CI / Chat UI, API, Update and GGUF inference (push) Waiting to run
Unsloth Tauri CI / Tauri Linux debug build (no codesign) (push) Waiting to run
Unsloth Tauri CI / Rust unit tests (windows) (push) Waiting to run
Unsloth Tauri CI / Rust unit tests (macos) (push) Waiting to run
Unsloth UI CI / Chat UI Tests (extra) (push) Waiting to run
Unsloth UI CI / Chat UI Tests (chat) (push) Waiting to run
Unsloth UI CI / Loaded-models indicator (cross-browser) (push) Waiting to run
Unsloth Update CI / Unsloth Updating Tests (push) Waiting to run
Unsloth Update CI / Unsloth Updating Tests (macOS) (push) Waiting to run
Unsloth Update CI / Unsloth Updating Tests (Windows) (push) Waiting to run
Studio VAE seam guard / seam-guard (push) Waiting to run
Windows Unsloth API CI / Unsloth API & Auth Tests (push) Waiting to run
Windows Unsloth GGUF CI / GGUF inference smoke (API, tools, vision) (push) Waiting to run
Windows Unsloth GGUF CI / Unsloth install + inference without Visual Studio (push) Waiting to run
Windows Unsloth GGUF CI / real-VS detection (VS 2022) (push) Waiting to run
Windows Unsloth GGUF CI / real-VS detection + VC++ round-trip (VS 2026) (push) Waiting to run
Windows Unsloth GGUF CI / setup.ps1 units, no-VS resolve, VC++ round-trip (windows-latest) (push) Waiting to run
Windows Unsloth UI CI / Chat UI Tests (push) Waiting to run
Windows Unsloth Update CI / Unsloth Updating Tests (push) Waiting to run
studiobench CI / Selftests, lint and the single-file build (push) Waiting to run
studiobench CI / Real-path session, every action ran (push) Waiting to run
Wheel CI / Wheel build + content sanity + import smoke (push) Waiting to run
Windows Application Control CI / installer survives a denied unsloth.exe (push) Waiting to run
Windows ARM64 CI / woa (pwsh-7) (push) Waiting to run
Windows ARM64 CI / woa (windows-powershell-5.1) (push) Waiting to run
Windows No Compiler CI / the installer spawns no C# compiler (push) Waiting to run
Workflow trigger lint / workflow-trigger lint (pull_request_target / cache-poisoning) (push) Waiting to run
Workflow trigger lint / security suites (torch-dependent) (push) Waiting to run
Studio: install causal-conv1d and mamba-ssm only when a model needs them (#13861)
Studio setup stops downloading causal-conv1d and mamba-ssm. They are
installed when a model that needs them is first trained or loaded, and
Qwen3.5 / Qwen3.6 / Qwen3-Next no longer request causal-conv1d at all.

## Why

#13396 added both kernels to every NVIDIA Linux / Windows setup next to
flash-attn: about 555 MB of downloads (~620 MB installed) for every
user, while only a few model families use them. Studio already installs
them on demand when such a model is trained (`core/training/worker.py`)
or loaded for chat (`core/inference/worker.py` through
`utils/ssm_runtime.ensure_ssm_runtime`), so the setup step only
duplicated that.

Qwen3.5 / 3.6 / Qwen3-Next do not need causal-conv1d with Unsloth:
unsloth-zoo runs their GatedDeltaNet with its vendored FLA kernels and
its own Triton causal conv
(`unsloth_zoo/temporary_patches/gdn_causal_conv1d.py`, model types
`qwen3_5`, `qwen3_5_moe`, `qwen3_next`). Studio still downloaded the
CUDA package for them because their transformers modeling files mention
`causal_conv1d`.

## What changes

- `studio/install_python_stack.py`: the setup-time SSM install is gone
from all three places (initial setup, Linux torch repair, Windows torch
flavor repair), with its progress step. flash-attn stays where it was.
`unsloth install-kernels` still installs every kernel, for offline
images.
- `studio/backend/utils/ssm_runtime.py`: `ZOO_GDN_MODEL_TYPES` (equal to
zoo's list; a test reads zoo's source to keep them equal). Names and
configs of those models, including `_text` / `_vision` sub-configs,
resolve to no causal-conv1d request, checked before the modeling-source
scan. A config that mixes in another model type that needs it still asks
for it. Zoo's own kill switch `UNSLOTH_DISABLE_TRITON_CAUSAL_CONV1D=1`
brings the old request back.
- `core/training/worker.py` and `core/systemone/clef_runtime.py` use the
same predicate, so the eager install, the `is_causal_conv1d_available`
hook and Clef (a Qwen3.5 backbone) all agree.
- Only where zoo's Triton conv can run: a CUDA torch (not ROCm, not
CPU), Triton importable, not macOS. This is read from torch's
distribution version (`+rocm` / `+cpu` / `+cu`), so no load imports
torch to decide. On ROCm, macOS or Windows without triton-windows, Qwen
keeps getting causal-conv1d as before.
- With setup no longer covering for it, the on-demand install now
decides from the model's config, not only its name:
`resolved_model_is_ssm` maps `nemotron_h`, `falcon_h1`,
`granitemoehybrid`, `bamba`, `jamba`, `zamba`, `zamba2`, `mamba`,
`mamba2`, `falcon_mamba` (and their `_text` sub-configs) to mamba-ssm +
causal-conv1d, for training and for the inference load of the resolved
base. Previously `NVIDIA-Nemotron-Nano-9B-v2`,
`granite-4.0-tiny-preview`, renamed local checkpoints, Jamba, Zamba and
Bamba never got mamba-ssm on demand.
- After an install inside an inference worker that already imported
transformers, the cached `is_causal_conv1d_available` /
`is_mamba_ssm_available` / `is_mamba_2_ssm_available` and cached
hub-kernel misses are cleared, so switching from Qwen3.5 to Nemotron-H
in one session gets the fast path.
- The mamba-ssm error raised when it cannot be installed (e.g. offline)
says to run `unsloth install-kernels` once while online.
- `install_kernel(install_without_gpu=)` is gone; setup was its only
caller.
- Clef still applies the FLA TileLang guard when it skips the install.

Unchanged: LFM2, Mamba / Jamba / Zamba / Bamba still get causal-conv1d
on demand; Nemotron-H, Falcon-H1 and Granite-4.0-H still get
causal-conv1d then mamba-ssm on demand; nothing already installed is
removed, and a usable causal_conv1d still wins inside zoo.

## Tests

- `tests/python/test_ssm_kernels_install_python_stack.py`: setup has no
SSM step; flash-attn is still installed at all three sites; the CLI
kernels are still there.
- `test_windows_torch_flavor_invariant.py`: the torch progress totals
drop by one on Windows and Linux.
- `studio/backend/tests/test_ssm_runtime.py`: Qwen3.5 / 3.6 / Next names
and configs install nothing, the kill switch restores the request, a
mixed config still asks, the Mamba2 hybrids still install both kernels
in order, and the model-type list equals zoo's.
- 21 of the new cases fail against main, and the follow-up cases
(config-based SSM detection, platform check, cache refresh, offline
message) fail against this PR's first commit; all pass here. The touched
test files and the setup / resolver suites pass (test_ssm_runtime 84,
test_training_worker_flash_attn 67, test_install_python_stack 295,
test_cuda_repair 284, test_windows_torch_flavor_invariant 54, among
others).

## Accuracy and speed without causal-conv1d (Qwen3.5)

Tiny Qwen3.5 / Qwen3-Next through Unsloth, bf16: zoo's Triton conv is
bit-identical to torch's reference conv (logits, loss, LoRA grads, 5
optimizer steps); the CUDA package differs from both at bf16 rounding
(5.9e-3 logits, grads cos 0.99993). Prefill plus cached token-by-token
decode matches a full forward equally with and without the package
(4.0e-3 vs 3.9e-3). The profiler shows which kernels ran in every arm.

Qwen3.5-0.8B bf16 on a Colab L4, torch 2.14.1+cu130, 3 alternating
repeats per arm:

| | Without causal-conv1d (zoo Triton) | With causal-conv1d (CUDA) |
|---|---|---|
| LoRA training, batch 4 x 1024, 30 timed steps | 911.5 ms/step (spread
11.2) | 917.5 ms/step (spread 15.9) |
| Greedy decode, 256 new tokens, batch 1 | 19.3 tok/s (spread 0.6) |
19.0 tok/s (spread 0.2) |

Both differences are inside the run-to-run spread. Without the package,
single-token decode uses torch's `conv_depthwise2d`; with it,
`causal_conv1d_update`.

A tiny NemotronH also runs identically with a pure-Python mamba-ssm (the
Mamba2 path never calls `selective_scan_cuda`), and a merged 16-bit
export of a NemotronH LoRA works with neither kernel installed.

## Not covered here
- `test_decision_native.py` / `test_decision_serving.py` were not
collected locally (missing `fastmcp`).
2026-10-15 08:20:03 -07:00
..
assets
auth Studio: accept sk-unsloth API keys in the x-api-key header (#13842) 2026-10-15 06:55:49 -07:00
core Studio: install causal-conv1d and mamba-ssm only when a model needs them (#13861) 2026-10-15 08:20:03 -07:00
hub Studio: stop listing a GGUF's borrowed text encoder and VAE as a model in the picker (#13778) 2026-10-15 06:36:20 -07:00
integrations/blender
loggers Studio: declare the Hub's /api/engines retry in the log budget (#13682) 2026-10-13 19:16:53 -07:00
models Studio: generate images through an external connection (#13756) 2026-10-15 05:06:37 -07:00
picker
plugins
requirements Studio: stop LTX-2 loads crashing Windows with an access violation on 32 GB machines (#13432) 2026-10-13 02:41:26 -07:00
routes Studio: serve /v1/completions from MLX models (#13796) 2026-10-15 07:47:52 -07:00
state
storage Studio: re-embed documents after switching the embedding model (#13702) 2026-10-14 12:23:21 -07:00
studio_mcp Studio MCP: never run server-side tools from the chat tool (#13605) 2026-10-13 09:00:50 -07:00
tests Studio: install causal-conv1d and mamba-ssm only when a model needs them (#13861) 2026-10-15 08:20:03 -07:00
utils Studio: install causal-conv1d and mamba-ssm only when a model needs them (#13861) 2026-10-15 08:20:03 -07:00
vendor
__init__.py
_platform_compat.py
cloudflare_tunnel.py
colab.py
lan_access.py Studio: serve HTTPS from your own certificate (--ssl-certfile / --ssl-keyfile) (#13447) 2026-10-12 20:45:01 -07:00
main.py Studio: accept sk-unsloth API keys in the x-api-key header (#13842) 2026-10-15 06:55:49 -07:00
mcp_server.py Studio: let coding agents use Unsloth Studio over MCP with API keys (#13118) 2026-10-13 05:06:16 -07:00
run.py Studio: stop llama-server crashing on macOS on Ctrl+C (#13782) 2026-10-15 05:48:42 -07:00
startup_banner.py Studio: serve HTTPS from your own certificate (--ssl-certfile / --ssl-keyfile) (#13447) 2026-10-12 20:45:01 -07:00