Skip to content

[Bug] Studio update channel installs a CUDA-13 / torch-2.10 flash-attn wheel into a CUDA-12 (driver-locked) venv; diffusers image generation then fails: libcudart.so.13 → torchao FqnToConfig #13244

Closed

Description

@dipping5115

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:

  1. Use Unsloth Studio on a CUDA-12-only driver host (driver 550, cannot run CUDA 13).
  2. Let the app's updater provision/refresh the venv (torch 2.9.0+cu126).
  3. 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

  1. 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*.so shows NEEDED libcudart.so.13; the venv torch is 2.9.0+cu126.

  2. 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 calling cudaGetDeviceCount returns rc=35 "CUDA driver version is insufficient for CUDA runtime version" (driver 550 < r580). Pre-loading it only moves the failure to undefined symbol: _ZN3c104cuda29c10_cuda_check_implementation…, a torch-2.10 ABI symbol missing in torch 2.9.

  3. 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.

  4. The torchao half is a version conflict with the bundled diffusers. The bundled diffusers build requires torchao.quantization.FqnToConfig unconditionally; FqnToConfig was introduced in torchao 0.15.0 (0.14.x only has ModuleFqnToConfig). 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+cu126 from download.pytorch.org/whl/cu126 (caveat below).

  5. 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.

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.10 wheel on a < r580 driver).
  • Repair the torchao selection for the bundled diffusers: install >= 0.15.0 (has FqnToConfig) 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_failed with 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_SKIP present 3x in both installed code and main's diffusion.py).

Related (near-misses, none covers this)

Additional context

Issue provide by Deepseek Flash(Max) with hermes agent

Activity

  1. added
    feature request
    on Oct 10, 2026
  2. added a commit that references this issue on Oct 11, 2026
    6d7c6e9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfeature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions