Repository navigation
Studio: skip causal-conv1d for Qwen3.5 / 3.6 / Qwen3-Next when unsloth-zoo covers decode - #14148
Conversation
…rovision SSM kernels in export - Request causal-conv1d on demand again for Qwen3.5/3.6/Qwen3-Next in training, inference and Clef - mamba-ssm stays required only for nemotron_h, falcon_h1 and granitemoehybrid; newer SSM families continue on the torch path - Resolve local adapter bases and the adapter base pin before deciding kernels - Export worker provisions SSM kernels before importing Unsloth - Inference re-reads modeling sources without importing transformers and respawns the worker once after a fresh install - Setup removes causal-conv1d / mamba-ssm builds that no longer import after a torch change - Skip flash-attn downloads below sm80 at setup and for long-context training
- Stale kernel removal needs proof: torch imports, then the extension import completes with an ImportError / OSError; a broken torch, a signal, a hang or an unrelated exit keeps the kernel - unsloth install-kernels --without-gpu (or UNSLOTH_INSTALL_KERNELS_WITHOUT_GPU=1) provisions GPU-gated kernels in a GPU-less image build; skipped kernels are listed, and a named kernel that was skipped exits non-zero - Inference respawn never spawns over a worker that survived shutdown - SSM restart and Xet fallback each get their own one-use retry, at most three spawns, with an accurate stall message - Restart only for imported modeling modules, including the selected remote-code model's - Export skips SSM provisioning on macOS, MLX and CPU - UV_OFFLINE counts as offline for on-demand kernel installs - Long-context flash-attn: no probe when already importable, reuse the worker's torch, never apply the sm80 floor on ROCm
… matching - install-kernels checks an already-working extension before the wheel, GPU and offline skips (a ROCm source build or a GPU-hidden builder's install is success); skipped kernels are listed and exit 0 as before, --strict opts into exit 2 - install-kernels installs nothing offline (UV_OFFLINE, HF_HUB_OFFLINE, TRANSFORMERS_OFFLINE), and install_wheel never falls back from an offline uv to pip - Restart detection takes the implementation modules from the config's auto_map (any module name) and matches transformers_modules.<checkpoint namespace> exactly, both spellings - Export decides the CPU / MLX / macOS bypass before the connectivity window
… up, lock - A wheel whose HEAD check is unanswered is still downloaded and verified (as setup did); only a real download / import failure falls back, in inference, export and training - A failed install is not retried in the same process (keyed by kernel, torch and toolchain), so a load's preflight and _handle_load share one attempt; configs are read once per process - Optional mamba-ssm families (mamba, mamba2, falcon_mamba, jamba, zamba, zamba2, bamba) get a prebuilt wheel only, never a source build, and are skipped below setup's sm80 / sm75 + Triton 3.4 floor; Nemotron-H, Falcon-H1 and Granite-4.0-H keep the source fallback and no floor - CUDA source builds get the 1800 s deadline ROCm had, and a timeout stops the whole build tree - A failed runtime install removes the distribution whose extension does not import - One cross-process lock per kernel and environment covers precheck, install, verify and cleanup, rechecks after acquiring, reports while waiting and gives up after a bound - Only a CUDA or ROCm torch provisions kernels; export provisions only for a CUDA / ROCm backend
…source builds - The Unsloth prebuilt resolver answers only for (platform, torch, interpreter) cells the release carries: torch 2.13 / 2.14 are cp313 on every platform, so linux_x86_64 cp310-cp312 and win_arm64 cp311 / cp312 no longer get a URL that 404s; no upstream URL for torch 2.13+ either - No source build of the pinned causal-conv1d 1.6.1 / mamba-ssm 2.3.1 on torch 2.13+ (C++17 sources against C++20 torch headers): the prebuilt wheel or the torch path, in inference, export and training - Training stops with the inference error when Nemotron-H, Falcon-H1 or Granite-4.0-H cannot get mamba-ssm on a CUDA / ROCm torch, including Windows without triton-windows - The MLX training-worker test stubs the wheel_utils names the worker now imports
The pinned upstream releases (causal-conv1d v1.6.1.post4, mamba-ssm v2.3.1) publish CUDA 11 / 12 / 13 Linux wheels for a fixed set of torch minors and cp310-cp313 only; CUDA 13 before torch 2.9, aarch64 before 2.7 and abiFALSE after 2.6 were URLs that 404 in front of the source fallback. The cells are now a table read from the two asset lists, and a test ties every URL the resolver can emit to it.
Nemotron-H, Falcon-H1 and Granite-4.0-H keep the source fallback, but a failed install or a Windows torch without triton-windows no longer stops the run: their native transformers path can run without mamba-ssm, so training reports it and continues, as it did before.
Nemotron-H, Falcon-H1 and Granite-4.0-H still try mamba-ssm first (source build included), but a failed install now refuses the chat or export load only when that load imports code that cannot run without it: remote modeling code (auto_map, under trust_remote_code or with no native class) that imports mamba_ssm unconditionally, or a model type the installed transformers has no native implementation of. Their native transformers models run without it, so otherwise the load goes ahead on the torch path with a warning, as before #13861 (a Nemotron-H checkpoint on Windows ROCm was refused).
…nel builds - Training's eager causal-conv1d install and its fast-path hook share the runtime's failed-attempt memo (same key), so a failed CUDA / HIP build is never repeated in one worker - Only successful config reads are cached; a miss is read again next time - A kernel a peer installed while this worker waited counts as new here, so inference refreshes or restarts its already-imported modeling modules - The install lock lives beside the environment (else one per environment in the temp folder), and every mutating entry point takes it: Studio workers, setup's stale-kernel removal and unsloth install-kernels. A lock that cannot be opened or taken skips the install instead of racing unguarded; optional accelerations wait at most 120 s for a peer, required ones 2400 s - Force-terminating a training run first stops the processes its worker started, including a source build in its own session - A runtime install whose installer cannot even start still removes a broken copy and is remembered as failed - Tests never take the environment's real install locks
…amba / Zamba / Bamba _ensure_mamba_ssm defaulted essential to True, so a caller that left it out (the ROCm hardware probe on gfx1151) compiled mamba-ssm from source for a Mamba2 model for 60 s. Unspecified now means the name decides: only Nemotron-H, Falcon-H1 and Granite-4.0-H may build it.
…n CUDA build deadline - Export worker: run the malware and remote-code consent gates (transformers-free, no load-subdir scan) before provisioning SSM kernels, at startup and on each "load" command, so a blocked checkpoint never triggers a kernel build. _handle_load keeps its authoritative re-check through the shared helper. - Export offline window: mark an HF offline set only because the Hub was unreachable; package_installs_offline() and package_installs_offline_env() then honour only UV_OFFLINE, so required kernels can still come from GitHub / PyPI. An operator-set HF offline still blocks installs. - install_python_stack: re-probe a stale SSM extension while holding the kernel install lock and remove it only if it still fails the same way. - unsloth install-kernels --dry-run prints the wheel URL even offline. - ssm_runtime: a model that cannot load without mamba-ssm now fails clearly on a CPU / XPU torch instead of falling through to a torch path that cannot work. - CUDA source builds get their own 7200 s deadline (UNSLOTH_SOURCE_BUILD_TIMEOUT overrides); HIP keeps 1800 s; KERNEL_LOCK_WAIT covers the longer of the two.
…h-zoo covers decode unsloth-zoo now runs the GatedDeltaNet short conv in Triton for prefill, training and cached decode (causal_conv1d_update), so these models no longer need the causal-conv1d binary on a CUDA torch with Triton. The request comes back when the installed zoo lacks the decode kernel (read from its source, nothing imported), the zoo kill switch is set, or the platform cannot run Triton (ROCm, macOS, no triton). Clef skips the install the same way.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Most of the red here comes from the base branch, not from this PR's own diff. This PR targets
The fix belongs on #13971. Either:
This PR should go green once its base carries that. Separately, |
…nsloth into gdn-no-causal-conv1d # Conflicts: # studio/backend/tests/test_flux3_prompt_upsampler.py
Stacked on #13971. Pairs with unslothai/unsloth-zoo#1857.
Qwen3.5 / Qwen3.6 / Qwen3-Next stop downloading causal-conv1d on demand when the installed unsloth-zoo runs their short conv in Triton for prefill, training and cached decode.
Why
unsloth-zoo#1857 adds a Triton
causal_conv1d_updatefor GatedDeltaNet decode (the prefill / training conv was already Triton). On a Kaggle T4 (Qwen3.5-0.8B fp16) decode with it is within noise of the causal-conv1d package (19.79 vs 19.64 and 19.47 vs 19.20 tok/s, two lanes) at 16.5 us per call against 46-48 us for the package, with identical memory and tokens. The binary is then pure download cost for these models.Changes
ssm_runtime.py: Qwen3.5 / 3.6 / Qwen3-Next request causal-conv1d only when zoo cannot cover them: the installed zoo lacks the decode kernel (read from its source onsys.path, nothing imported),UNSLOTH_DISABLE_TRITON_CAUSAL_CONV1D=1is set, or the platform cannot run zoo's Triton conv (ROCm, macOS, no triton). The config check runs before the modeling source scan, since those modeling files mention causal_conv1d. Mixed configs and other conv users (LFM2, the Mamba families) still request it.clef_runtime.py: Clef skips the install the same way and keeps the FLA TileLang guard.Tests
test_ssm_runtime.py,test_clef_fast_paths.py(new cases fail on #13971's head and pass here), withconftest.pypinning the older-zoo answer so the suite does not depend on the host's zoo. 453 passed across the SSM, clef, export, training worker and install stack tests.