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
{{ message }}
Repository navigation
[Feature] Unsloth Studio / Desktop: cap GPU memory for XPU and MPS training, and make image generation honour the VRAM Budget #8178
Most of this issue has landed. What's left is narrower than the original ask, so the title and body now cover only that. Re-checked against main at 5ab5419 (2026-10-21).
Landed
GGUF inference: Make the VRAM budget fraction tunable #8589. VRAM Budget slider in Advanced settings, stored in app_settings, GET/PUT /api/settings/vram-budget, with UNSLOTH_VRAM_FRACTION as the startup default.
That also settles the open question at the bottom of the old body: training and inference have separate controls with their own labels.
Still open
XPU and MPS training are never capped. Both the env cap and the GiB budget only reach CUDA/ROCm devices. _apply_training_vram_budget returns early when torch.cuda isn't available (worker.py:2029), and the env cap block still notes "XPU and MPS are not wired yet" (worker.py:4741). Both backends have set_per_process_memory_fraction (torch.xpu, torch.mps). On MPS, memory is unified with the OS, so the cap matters more there, not less.
Image generation ignores the VRAM Budget. Only llama_cpp.py and engine_adapters.py call get_vram_budget_fraction(). The diffusers image path plans offload against the whole card, and the sd.cpp path sizes --max-vram from free VRAM on its own (sd_cpp_args.py:439). Either wire both to the setting, or label the slider as covering only text models so it doesn't promise more than it does.
hi @olifarhaan it may be but i think I would like to get @danielhanchen 's opinion first as this will be a multi PR issue i think, each gpu glass will likely be a separate pr, and the UI design will need to be thought out as well. I would suggest maybe waiting before doing anything big.
Yes I think adding it in the Advanced settings dropdown can work for Inference - "auto" will be our default, then whatever fraction 90%, 95%, 99% for eg
changed the title [-][Feature] Unsloth Studio: let users cap GPU memory from Settings, not just an env var (AMD, NVIDIA, Intel)[/-][+][Feature] Unsloth Studio / Desktop: cap GPU memory for XPU and MPS training, and make image generation honour the VRAM Budget[/+]on Oct 22, 2026
Activity
olifarhaan commentedon Aug 8, 2026
@LeoBorcherding is this feature open for contribution?
LeoBorcherding commentedon Aug 9, 2026
hi @olifarhaan it may be but i think I would like to get @danielhanchen 's opinion first as this will be a multi PR issue i think, each gpu glass will likely be a separate pr, and the UI design will need to be thought out as well. I would suggest maybe waiting before doing anything big.
danielhanchen commentedon Aug 9, 2026
Yes I think adding it in the Advanced settings dropdown can work for Inference - "auto" will be our default, then whatever fraction 90%, 95%, 99% for eg
olifarhaan commentedon Aug 9, 2026
hi @LeoBorcherding and @danielhanchen, we can structure the split so each backend PR can be merged independently after a small shared groundwork PR.
Proposed order:
Shared inference setting/schema groundwork:
auto | 90% | 95% | 99%load-setting shape.auto.NVIDIA/CUDA inference PR:
AMD inference PR:
Intel inference PR:
UI PR:
Training should stay a later separate PR because it uses PyTorch allocator caps rather than the inference VRAM fitter.
[-][Feature] Unsloth Studio: let users cap GPU memory from Settings, not just an env var (AMD, NVIDIA, Intel)[/-][+][Feature] Unsloth Studio / Desktop: cap GPU memory for XPU and MPS training, and make image generation honour the VRAM Budget[/+]Unsloth Studio / Desktop: image generation ignores the VRAM Budget se…