You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: Please do not remove the questions. Answer beside them.
Did you update? pip install --upgrade unsloth unsloth_zoo I should have updated it by runningirm https://unsloth.ai/install.ps1 | iex
Colab or Kaggle or local / cloud This is the local Unsloth Studio.
Number GPUs used, use nvidia-smi Since I'm on Windows, I checked using Task Manager. RTX 4060 Ti, 8GB VRAM.
Which notebook? Please link!
Which Unsloth version, TRL version, transformers version, PyTorch version? This is v0.1.481-beta
Which trainer? SFTTrainer, GRPOTrainer etc
Error Details
When attempting to run Gemma4 e2b, the following error occurs:
I selected the model installation from Fine-tuning Studio and installed unsloth/gemma-4-E2B-it, but the actual model is unsloth/gemma-4-e2b-it-unsloth-bnb-4bit. I'm unsure if this is normal behavior.
As indicated in the model selection, I believe it can run with approximately 6GB of VRAM.
Most likely fixed! Sorry on the delay. Gemma 4 E2B's 4-bit checkpoint is 8.1 GB, and 4.4 GB of that is one per-layer embedding table, so it cannot fit on an 8 GB card as is. Setting Offload layers to Auto in the training parameters moves that table to system RAM, but the first training step used to pull it back onto the GPU and run out of memory. That is fixed in #13320.
Gemma 4 E2B 4-bit, LoRA r=16, batch 2, 5 steps, on a card capped at 8 GB with 7.3 GB free:
Run
Result
Peak VRAM
Losses
Before, Offload layers off
does not fit in GPU memory (cuda:0 has 7.26 GB free)
-
-
Before, Offload layers Auto
loads at 2.83 GB, then out of memory at step 1 (7.30 GB allocated)
7.43 GB
-
After, Offload layers Auto
trains
5.74 GB
7.1479, 7.198, 6.5079, 5.3274, 4.7686
Reference, no offload, no 8 GB cap
trains
7.93 GB
7.1479, 7.198, 6.5079, 5.3274, 4.7686
The losses match the run without offloading exactly. One caveat for Windows: Unsloth currently keeps embedding offload off on Windows and WSL, so there Auto can only offload decoder layers. If it still fails for you on Windows after updating, please reopen and we'll look at enabling it there.
To update: Unsloth Desktop will have an update banner. For Studio, use unsloth studio update. For Docker, use docker exec <container> unsloth-studio-update. Reopen if it still happens.
Activity
danielhanchen commentedon Oct 11, 2026
Most likely fixed! Sorry on the delay. Gemma 4 E2B's 4-bit checkpoint is 8.1 GB, and 4.4 GB of that is one per-layer embedding table, so it cannot fit on an 8 GB card as is. Setting Offload layers to Auto in the training parameters moves that table to system RAM, but the first training step used to pull it back onto the GPU and run out of memory. That is fixed in #13320.
Gemma 4 E2B 4-bit, LoRA r=16, batch 2, 5 steps, on a card capped at 8 GB with 7.3 GB free:
does not fit in GPU memory (cuda:0 has 7.26 GB free)The losses match the run without offloading exactly. One caveat for Windows: Unsloth currently keeps embedding offload off on Windows and WSL, so there Auto can only offload decoder layers. If it still fails for you on Windows after updating, please reopen and we'll look at enabling it there.
To update: Unsloth Desktop will have an update banner. For Studio, use
unsloth studio update. For Docker, usedocker exec <container> unsloth-studio-update. Reopen if it still happens.