Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Xformers fix
Daniel Hancb4d8da5a264
diff --git a/pyproject.toml b/pyproject.tomlindex d26d3645140..eb61d50d889 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -285,10 +285,16 @@ cu130onlytorch290 = ["xformers @ https://download.pytorch.org/whl/cu130/xformers-0.0.33.post1-cp39-abi3-win_amd64.whl ; (sys_platform == 'win32')",]cu126onlytorch291 = [+ "xformers @ https://download.pytorch.org/whl/cu126/xformers-0.0.33.post2-cp39-abi3-manylinux_2_28_x86_64.whl ; ('linux' in sys_platform)",+ "xformers @ https://download.pytorch.org/whl/cu126/xformers-0.0.33.post2-cp39-abi3-win_amd64.whl ; (sys_platform == 'win32')",]cu128onlytorch291 = [+ "xformers @ https://download.pytorch.org/whl/cu128/xformers-0.0.33.post2-cp39-abi3-manylinux_2_28_x86_64.whl ; ('linux' in sys_platform)",+ "xformers @ https://download.pytorch.org/whl/cu128/xformers-0.0.33.post2-cp39-abi3-win_amd64.whl ; (sys_platform == 'win32')",]cu130onlytorch291 = [+ "xformers @ https://download.pytorch.org/whl/cu130/xformers-0.0.33.post2-cp39-abi3-manylinux_2_28_x86_64.whl ; ('linux' in sys_platform)",+ "xformers @ https://download.pytorch.org/whl/cu130/xformers-0.0.33.post2-cp39-abi3-win_amd64.whl ; (sys_platform == 'win32')",]cu118 = ["unsloth[huggingface]",diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.pyindex ad48b28e269..3fdcb1eb697 100644--- a/unsloth/models/_utils.py+++ b/unsloth/models/_utils.py@@ -761,6 +761,13 @@ elif DEVICE_TYPE == "xpu":# =============================================# Get Xformers+# Silence xformers CUDA mismatch warnings before import+try:+ _xformers_logger = logging.getLogger("xformers")+ _xformers_logger.setLevel(_logging.ERROR)+ del _xformers_logger+except:+ passtry:from xformers import __version__ as xformers_version@@ -835,10 +842,11 @@ except ModuleNotFoundError:xformers_attention = Nonexformers_version = Noneexcept Exception as e:- print(- "========\nSwitching to PyTorch attention since your Xformers is broken.\n========\n"- )- print(str(e))+ if os.environ.get("UNSLOTH_ENABLE_LOGGING", "0") != "0":+ print(+ "========\nSwitching to PyTorch attention since your Xformers is broken.\n========\n"+ )+ print(str(e))xformers = Nonexformers_attention = Nonexformers_version = None