Repository navigation
Closed
Labels
Description
- Did you update?
pip install --upgrade unsloth unsloth_zoo
Yes ColaborKaggleor local / cloud
Local- Number GPUs used, use
nvidia-smi
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 610.74 KMD Version: 610.74 CUDA UMD Version: 13.3 |
+-----------------------------------------+------------------------+----------------------+
| GPU Name Driver-Model | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 5060 Ti WDDM | 00000000:01:00.0 On | N/A |
| 0% 43C P1 30W / 234W | 2263MiB / 16311MiB | 1% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+ - Which notebook? Please link!
? - Which Unsloth version, TRL version, transformers version, PyTorch version?
v0.1.526-beta
Transformers 4.57.6
Python 3.13.14
Torch 2.10.0+cu130 - Which trainer?
SFTTrainer,GRPOTraineretc
Not using trainer (i think)
Problem
Whenever i want to load a NVFP4 Unsloath tell me that either compressed_tensors is not installed or is the wrong version. But when i do the command pip install compressed-tensors every single time it come out as already installed.
The first time that i had problem was with Qwen 3.6 35B A3B NVFP4 Fast but now i have downloaded Gemma 4 E2B it NVFP4 and it still doesn't work. Saying every time the same error over and over.
Activity
ahmad110abbas commentedon Aug 11, 2026
Why This Happens
Unsloth Studio runs inside its own isolated Python virtual environment (
C:\Users\<YourUsername>\.unsloth\studio\unsloth_studio).When you run
pip install compressed-tensorsin a regular command prompt, it installs the package into your global Python environment, not into Unsloth Studio's virtual environment. That is why Unsloth Studio cannot findcompressed_tensors.Solution
You need to install
compressed-tensorsdirectly into Unsloth's Python environment.On Windows:
Open Command Prompt (
cmd) and run:C:\Users\%USERNAME%\.unsloth\studio\unsloth_studio\Scripts\pip.exe install --upgrade compressed-tensors llm-compressorOn Linux / macOS:
Open Terminal and run:
~/.unsloth/studio/unsloth_studio/bin/pip install --upgrade compressed-tensors llm-compressororo872gioioso commentedon Aug 11, 2026
Thank you but the problem just moved.
Gemma4ForConditionalGeneration LOAD REPORT from: unsloth/gemma-4-E2B-it-NVFP4
Key | Status |
-----------------------------------------------------------------------+------------+-
model.language_model.layers.{0...34}.self_attn.k_scale | UNEXPECTED |
model.language_model.layers.{0...34}.self_attn.v_scale | UNEXPECTED |
model.language_model.layers.{1...23}.mlp.gate_proj.weight | UNEXPECTED |
model.language_model.layers.{1...23}.mlp.up_proj.weight | UNEXPECTED |
model.language_model.layers.{1...23}.mlp.down_proj.weight | UNEXPECTED |
model.language_model.layers.{15...34}.self_attn.v_proj.weight_scale | MISSING |
model.language_model.layers.{1...23}.mlp.down_proj.weight_global_scale | MISSING |
model.language_model.layers.{15...34}.self_attn.k_proj.weight_scale | MISSING |
model.language_model.layers.{15...34}.self_attn.v_proj.weight | MISSING |
model.language_model.layers.{1...23}.mlp.down_proj.input_global_scale | MISSING |
model.language_model.layers.{15...34}.self_attn.k_proj.weight | MISSING |
model.language_model.layers.{1...23}.mlp.up_proj.weight_packed | MISSING |
model.language_model.layers.{1...23}.mlp.gate_proj.input_global_scale | MISSING |
model.language_model.layers.{1...23}.mlp.gate_proj.weight_global_scale | MISSING |
model.language_model.layers.{15...34}.self_attn.k_norm.weight | MISSING |
model.language_model.layers.{1...23}.mlp.up_proj.input_global_scale | MISSING |
model.language_model.layers.{1...23}.mlp.up_proj.weight_global_scale | MISSING |
model.language_model.layers.{1...23}.mlp.gate_proj.weight_packed | MISSING |
model.language_model.layers.{1...23}.mlp.down_proj.weight_packed | MISSING |
lm_head.weight | MISSING
Downloaded directly from unsloth studio
yashb98 commentedon Aug 18, 2026
Reproduced this on a GB10 (Blackwell, aarch64), torch 2.12.1+cu130, transformers 5.15.0, compressed-tensors 0.18.0. Not specific to the 5060 Ti or Studio.
I checked the safetensors header against the quantization_config and the checkpoint is consistent with itself. k_proj/v_proj exist only for layers 0-14 because of num_kv_shared_layers=20, and the MLPs are split exactly as group_0 and group_1 describe. The load path is what breaks, in three places:
I have local patches for 1 and 2 and can turn them into proper PRs for compressed-tensors and transformers if that helps. For 3 the fix is a real specificity ordering for overlapping regex targets. Let me know where you want to track it.
Full load report comparison
My run on transformers 5.15.0 + compressed-tensors 0.18.0 (with bugs 1 and 2 patched) produces the same missing/unexpected pattern as the 4.57.6 report above:
missing (gate_proj.weight_packed, plus the matching scales): layers [1, 2, 3, 10, 11, 12, 13, 14, 15, 19, 20, 23]
unexpected (gate_proj.weight): the same 12 layers
That set is exactly group_0's fp8 target list from the quantization_config, which is why this points at group priority resolution and not at the checkpoint. The {1...23} range in the rendered report is just display collapsing; the actual set is the 12 layers above. I confirmed the collapse on my own run: the rendered table says {1...23} while the raw missing_keys set is the 12 non-contiguous layers.
Generation smoke on GPU dies at model.language_model.layers.1.mlp.gate_proj with "expected mat1 and mat2 to have the same dtype, but got: c10::BFloat16 != float", i.e. the first mis-grouped layer.
Counts: missing=109, unexpected=76.
oro872gioioso commentedon Aug 19, 2026
Thanks for the explanation and for finding the cause!
If the temporary workaround or local patch for bugs 1 and 2 isn't too complex to apply, could you share how to implement it? I'd really like to test it on my setup while waiting for the official PRs to be merged.
yashb98 commentedon Aug 19, 2026
Happy to share. Both are small monkeypatches, applied before
from_pretrained. Save this aspatch_8246.pyand import it at the top of your script (before anything imports transformers):One expectation to set: these two get you past the crashes and the checkpoint loads. They do not fix bug 3 (the nvfp4 group beating the fp8 layer list during target matching), so the 12 mis-grouped MLP layers are still wrongly built and generation will still die with the dtype mismatch. A working model needs the specificity fix in
match_targets, which is the part that belongs upstream. I am turning all three into proper PRs for compressed-tensors and transformers.oro872gioioso commentedon Aug 20, 2026
Hi! Thanks for the detailed breakdown. I tried implementing your patches inside Unsloth Studio, but due to how Unsloth handles isolated subprocesses and my limited familiarity with its codebase, I couldn't get past the second issue. Appreciate the help, and good luck with your PRs!
If anyone has the same problem and more knowledge than me i think they could make good use of your fix. Until then i can only wait.
Thanks for your work!