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:
Windows 10 Pro 22H2, OS build 19045, 64-bit
GPU model(s) and accelerator backend:
NVIDIA Tesla V100-PCIE-32GB, CUDA, driver 581.80; compute capability 7.0 (sm_70), no native bfloat16 support.
Versions at initial reproduction, unless noted:
- Unsloth Studio:
2026.10.5, server commit95f51c8ecd - unsloth_zoo:
2026.9.9 - torch:
2.11.0+cu126 - transformers:
5.5.0 - diffusers:
0.41.0 - safetensors:
0.8.0 - Python:
3.13.14for the initial reproductions;3.13.16for subsequent tests
The relevant guard logic was still unchanged at server commit 66fb355abf (code inspection, 2026-10-20).
Host memory when originally reproduced:
48 GB physical RAM and a fixed 16 GB pagefile, giving an approximately 64 GB system commit limit.
What happened?
Steps to reproduce:
- On the host described above, load a Q4 or Q8 GGUF from
unsloth/Qwen-Image-2.1-Turbo-GGUFin the image tab, usingQwen/Qwen-Image-2.1-Turboas the base repository. - Monitor the Python server process during loading.
The failure occurs when the low-memory route does not engage. I reproduced the same crash pattern with other Qwen-Image variants through both Hub and local scan-folder loads.
Expected behavior:
The loader should use the existing low-memory route when dense loading would exceed available host memory. If even that route cannot fit, it should return the existing "Not enough system RAM to load this model…" error and keep the server running.
Actual behavior:
Weight materialization exhausts system commit, and the Python server terminates with native access violations. No diffusion.load_failed event is logged. Windows Event 2004 confirms resource exhaustion.
By contrast, a load in the same family completed and generated images when the low-memory route engaged and kept the text encoder memory-mapped.
Diagnostics and logs
The original failing loads contain no diffusion.small_host entry and end with:
Windows fatal exception: access violation
File "<venv>/transformers/core_model_loading.py", line 787 in _materialize_copy
File "<venv>/diffusers/pipelines/pipeline_loading_utils.py", line 897 in load_sub_model
File "<repo>/studio/backend/core/inference/diffusion.py", line 7535 in load_pipeline
Windows Event 2004 recorded python.exe committing 44,704,890,880 bytes during one failure.
A successful load logged:
diffusion.small_host: engaged=True (dense float16 load needs ~19230 MiB + 4906 MiB reserve of host RAM, 23420 MiB available)
diffusion.small_host: {'text_encoder': 'memory-mapped, layerwise cast (16717 MiB)'}
Initial analysis
The loader code has three gaps relevant to these failures:
_small_host_decisionexcludes components already supplied throughpipe_kwargs, leaving the pre-built GGUF transformer out of the estimate.- The dense-load estimate does not adequately account for temporary allocations during dtype conversion.
- On Windows, the guard checks available physical RAM without checking remaining system commit capacity.
With local changes addressing these three points, the previously failing Turbo load took the low-memory route, completed successfully, and generated images on the original 48 GB host. I plan to submit these changes as a PR.
Related
The existing low-memory route was introduced in #12480, including support for GGUF companion loads. #13432 documents a related Windows commit-exhaustion crash in _materialize_copy, but its fix is scoped to video loads with fp32-stored text encoders. The open PR #14510 proposes a host-RAM check for single-file safetensors conversion; it does not cover the GGUF companion-load estimate or Windows commit headroom discussed here.
Image Reload safety and possible reuse
During testing, the server also crashed while reloading the same Turbo checkpoint (Q8_0). System commit was exhausted despite the low-memory route being active. The host had 64 GB of physical RAM and a fixed 16 GB pagefile. At the guard check, 31,804 MiB of physical RAM remained available, while commit headroom was 29,844 MiB.
The proposed changes do not cover this case. Replacement-load peaks and the timing of host-memory release need further investigation. I plan to report this separately with additional diagnostic logs.
Conditional reuse may also be worth considering when the requested configuration exactly matches the resident pipeline.
Activity
Studio: read converted shards with pread on Windows, so a converting …
Studio: fix host memory checks and improve logging for GGUF image loa…
danielhanchen commentedon Oct 23, 2026
Fixed! On Windows, converting a model's weights while loading reserved roughly twice the model's size in memory commit, and the memory check only looked at free RAM, so a load it judged safe could still crash. Fixed in #14514: Studio now reads converted weights without that double reservation and also checks the Windows commit budget, switching to the low-memory route when a normal load would not fit. #14856 brings the same weight-reading fix to Unsloth Core on Windows.
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.Studio: stop image loads exhausting Windows commit on Intel Arc iGPUs (…