Repository navigation
Description
Environment
Where are you using Unsloth?
- Unsloth desktop application
- Unsloth web UI (
unsloth studio) - Unsloth CLI
- Python package or notebook
- Colab or Kaggle
Operating system and version: Debian sid (kernel 6.12), KDE Plasma Wayland, x86_64
GPU model(s) and accelerator backend: NVIDIA GeForce RTX 4060 Laptop, driver 550.163.01 (CUDA 12.4; CUDA 13 requires >= r580, so this host is CUDA-12-locked). Backend: NVIDIA CUDA (venv torch 2.9.0+cu126).
Versions: Unsloth desktop 0.1.905-beta (Debian, app-updater-managed). Studio venv: ~/.unsloth/studio/unsloth_studio, Python 3.13.15, torch 2.9.0+cu126, diffusers 0.41.0.dev0 (bundled), xformers 0.0.33.post1.
What happened?
Steps to reproduce:
- Use Unsloth Studio on a CUDA-12-only driver host (driver 550, cannot run CUDA 13).
- Let the app's updater provision/refresh the venv (torch 2.9.0+cu126).
- Try to load any diffusers-based diffusion model (e.g. unsloth/Qwen-Image-2.1 or the FP8/GGUF variants).
Expected behavior: diffusion pipeline loads and generates.
Actual behavior: every pipeline load fails with
diffusion.load_failed: Failed to import diffusers.models.transformers.transformer_qwenimage21 because of the following error (look up to see its traceback):
Failed to import diffusers.loaders.peft because of the following error (look up to see its traceback):
libcudart.so.13: cannot open shared object file: No such file or directory
Full chain from tauri.log:
diffusers/loaders/peft.py:26
-> diffusers/hooks/__init__.py -> faster_cache.py -> models/attention.py
-> diffusers/models/attention_processor.py:37 import xformers.ops (unguarded)
-> xformers/ops/fmha/flash.py:64 import flash_attn (only guarded by `elif find_spec("flash_attn")`, not by try/except)
-> flash_attn_2_cuda.cpython-313-x86_64-linux-gnu.so
-> ImportError: libcudart.so.13
After removing the broken flash-attn, a second, independent failure appears in the same chain:
diffusers/quantizers/torchao/torchao_quantizer.py:55
from torchao.quantization import FqnToConfig, quantize_
ImportError: cannot import name 'FqnToConfig' from 'torchao.quantization'
Model and operation involved: diffusion (image generation) load, Qwen-Image-2.1 family. LLM/chat and LoRA training are NOT affected (unsloth imports fine and prints "Your Flash Attention 2 installation seems to be broken. Using Xformers instead.").
Evidence
-
The flash-attn wheel is the wrong variant for this venv.
flash_attn-2.8.1.dist-info/direct_url.json:
https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.1/flash_attn-2.8.1+cu13torch2.10cxx11abiTRUE-cp313-cp313-linux_x86_64.whl
objdump -p flash_attn_2_cuda*.soshowsNEEDED libcudart.so.13; the venv torch is2.9.0+cu126. -
Satisfying libcudart.so.13 cannot work on this machine. The venv actually contains
nvidia/cu13/lib/libcudart.so.13(leftover from an earlier cu130 provisioning); loading it and callingcudaGetDeviceCountreturnsrc=35 "CUDA driver version is insufficient for CUDA runtime version"(driver 550 < r580). Pre-loading it only moves the failure toundefined symbol: _ZN3c104cuda29c10_cuda_check_implementation…, a torch-2.10 ABI symbol missing in torch 2.9. -
No compatible wheel exists to fix flash-attn by downgrade: flash-attention v2.8.1–2.8.4 publish cp313 wheels for torch 2.5/2.6/2.7/2.8 and 2.10 (cu12), and 2.10 (cu13) — none for torch 2.9 + cu12. Removing flash-attn is the only sane fix; xformers then falls back to torch's native flash attention (
FLASH_VERSION 2.5.7), no performance regression observed. -
The torchao half is a version conflict with the bundled diffusers. The bundled diffusers build requires
torchao.quantization.FqnToConfigunconditionally;FqnToConfigwas introduced in torchao 0.15.0 (0.14.x only hasModuleFqnToConfig). This matches the known, explicitly-unaddressed remainder in Studio: skip xFormers when its torch requirement is unmet #11847 (same failure on torch 2.6 hosts). Installed torchao was 0.14.0+cu126 (what the updater installs when it detects torch 2.9.0+cu126). Local fix:torchao==0.15.0+cu126from download.pytorch.org/whl/cu126 (caveat below). -
The updater's install path and update path disagree. tauri.log, 2026-09-13:
- 03:58 (install):
flash-attn wheel installed but is not importable on this GPU; removed it/Continuing without flash-attn— the guard from Studio: verify the flash-attn import after installing it #8465 works here. - 13:22 (app update, "update" log channel): flash-attn step re-installs the wheel; no importability check line afterwards. Failures start 2026-09-25 and persist (including 2026-10-10, after Studio: skip xFormers when its torch requirement is unmet #11847 merged).
- Earlier the same updater had provisioned
torch 2.12.1+cu130 detected -- installing torchao==0.18.0; the venv was later rolled back to torch 2.9.0+cu126. cu13 residue (site-packages/nvidia/cu13, ~2.2 GB, unusable on driver 550) remains from that provisioning.
- 03:58 (install):
Suggested fixes
- Run the same post-install importability check (Studio: verify the flash-attn import after installing it #8465) after the update-path flash-attn step, or select the wheel variant against the venv's actual torch/CUDA (never a
cu13/torch2.10wheel on a < r580 driver). - Repair the torchao selection for the bundled diffusers: install
>= 0.15.0(hasFqnToConfig) on torch >= 2.9 hosts, or make the diffusers import version-gated. Caveat found locally: torchao 0.15.0's ABI gate whitelists torch 2.9.1, so on exactly torch 2.9.0 its C++ extensions are skipped (same as 0.14.0 was, so no regression).
Diagnostics and logs
- tauri.log events:
diffusion.load_failedwith full tracebacks (2026-09-25T03:48Z, 04:09Z, 2026-10-10T15:00:55Z). - Verified against installed app 0.1.905-beta; installed
studio/backend/...files match repo main (fingerprint check:UNSLOTH_DIFFUSION_AUTO_STEP_SKIPpresent 3x in both installed code and main's diffusion.py).
Related (near-misses, none covers this)
- Studio: verify the flash-attn import after installing it #8465 Studio: verify the flash-attn import after installing it — merged; covers the install path only, this report is about the update path + variant selection.
- Studio: skip xFormers when its torch requirement is unmet #11847 Studio: skip xFormers when its torch requirement is unmet — merged 2026-09-25; explicitly does NOT address the torchao/FqnToConfig failure ("That is not addressed here").
- Studio: fix flash-attn and torchao install on Blackwell (sm_100+) GPUs (Closes #6961) #6970 / [Bug] Unsloth Setup skips Flash Attention for Blackwell, even though wheels are now available + Please upgrade to Torchao 0.17 #6961 flash-attn & torchao install on Blackwell — different gate (Blackwell-vs-non-Blackwell), same class of bug.
- Studio flashattn #5435 Studio flashattn — older, no actionable resolution for this variant issue.
Additional context
Issue provide by Deepseek Flash(Max) with hermes agent
Activity
Studio installer: drop a flash-attn built for a torch that is gone, a…