Repository navigation
Description
name: qLora training on XPU Fails due to tensor offloading issue
about: qLora training on XPU Fails with "Expected all tensors to be on the same device, but found at least two devices, xpu:0 and cpu!"
title: "[Studio Bug] "
labels: bug
assignees: ""
Environment
Where are you using Unsloth?
- Studio desktop application
- Studio web UI (
unsloth studio) - Unsloth CLI
- Python package or notebook
- Colab or Kaggle
Operating system and version:
GPU model(s) and accelerator backend: XPU (Intel Arc B70) + Vulkan
Versions:
Unsloth: v0.1.801-beta
Package: 2026.8.19
Desktop version: 0.1.801-beta
llama.cpp: b10472-mix-4b653db
I am using the latest AppImage to install the latest version in the steps to reproduce below.
What happened?
Steps to reproduce:
1.curl https://raw.githubusercontent.com/unslothai/unsloth/refs/heads/main/scripts/uninstall.sh | sh
2. UNSLOTH_TORCH_INDEX_FAMILY=xpu UNSLOTH_LLAMA_CPP_BACKEND=vulkan unsloth-desktop.AppImage && unsloth-desktop.AppImage
3. go to train tab -> images -> use a model + dataset (anything; I use Krea2+dreambooth dog in my example) -> start training
4. "Loading base model...", "Preparing (cache latents X/X)", then:
"Expected all tensors to be on the same device, but found at least two devices, xpu:0 and cpu!"
I've verified that it's not a VRAM limits issue; I have a fork with a fix for this, and there training only takes up ~28 of my 32 GB of VRAM.
Expected behavior: Step 4 (above) should begin training as usual.
Actual behavior: training never begins, and an error is displayed that not all tensors are loaded on my Arc B70.
Model and operation involved: For my example, I am training a Krea 2 raw qLora
Diagnostics and logs
I have a fork made public that I've verified fixes this issue on my end (https://github.com/ChowChowSonic/unsloth-xpu-training-fix -> #9534) as I have been able to successfully train multiple functioning qLoras with this branch. I may or may not be creating a PR for it once I can verify that all tests pass and my changes are acceptable for main.
I would also like to add that my current system (with an Intel Arc B70) is the only system I have available to test this on. Initially I just wanted to get a usable fix going for myself & didn't plan on publishing this, so I didn't pay too much attention to the contributor/coding guidelines. If any of my changes break stuff for other platforms please let me know and I'll see about fixing that as best I can.
Activity