Skip to content

[Bug] No xformers and Flash-attention under Windows? #4381

Closed

Description

@mykeehu

When I start a training, this is what I see in the console:

==((====))==  Unsloth 2026.3.4: Fast Llama patching. Transformers: 4.57.6.
   \\   /|    NVIDIA GeForce RTX 3090. Num GPUs = 1. Max memory: 24.0 GB. Platform: Windows.
O^O/ \_/ \    Torch: 2.10.0+cu130. CUDA: 8.6. CUDA Toolkit: 13.0. Triton: 3.6.0
\        /    Bfloat16 = TRUE. FA [Xformers = None. FA2 = False]

I'm surprised that both xformers and flash-attention are installed in venv. Here are the details:

Name: xformers
Version: 0.0.35
Summary: XFormers: A collection of composable Transformer building blocks.
Home-page: https://facebookresearch.github.io/xformers/
Author: Facebook AI Research
Author-email: [email protected]
License:
Location: E:\LlamaFactory\venv\Lib\site-packages
Requires: numpy, torch
Required-by: unsloth

Name: flash_attn
Version: 2.8.3
Summary: Flash Attention: Fast and Memory-Efficient Exact Attention
Home-page: https://github.com/Dao-AILab/flash-attention
Author: Tri Dao
Author-email: [email protected]
License:
Location: E:\LlamaFactory\venv\Lib\site-packages
Requires: einops, torch
Required-by:

Name: unsloth
Version: 2026.3.4
Summary: 2-5X faster training, reinforcement learning & finetuning
Home-page: http://www.unsloth.ai
Author: Unsloth AI team
Author-email: [email protected]
License-Expression: Apache-2.0
Location: E:\LlamaFactory\venv\Lib\site-packages
Requires: accelerate, bitsandbytes, datasets, diffusers, hf_transfer, huggingface_hub, numpy, packaging, peft, protobuf, psutil, sentencepiece, torch, torchvision, tqdm, transformers, triton-windows, trl, tyro, unsloth_zoo, wheel, xformers
Required-by:

Name: unsloth_zoo
Version: 2026.3.4
Summary: Utils for Unsloth
Home-page: http://www.unsloth.ai
Author: Unsloth AI team
Author-email: [email protected]
License-Expression: LGPL-3.0-or-later
Location: E:\LlamaFactory\venv\Lib\site-packages
Requires: accelerate, cut_cross_entropy, datasets, filelock, hf_transfer, huggingface_hub, msgspec, numpy, packaging, peft, pillow, protobuf, psutil, regex, sentencepiece, torch, torchao, tqdm, transformers, trl, typing_extensions, tyro, wheel
Required-by: unsloth

So why doesn't unsloth recognize these modules?

Activity

  1. mykeehu commented on Mar 17, 2026

    @mykeehu
    Author

    I see there's a solution for flash-attention, but it hasn't been merged yet...
    #4270
    #4361

  2. danielhanchen commented on Oct 12, 2026

    @danielhanchen
    Member

    Fixed! Sorry on the delay. Both packages in your venv were built for a different torch than 2.10.0+cu130, so their kernels could not load and Unsloth fell back to PyTorch attention without saying why. PyPI's xformers wheel is a CUDA 12.8 build, and flash-attn has no official Windows wheels, so community builds often target another torch. Since #13410, Unsloth says when this happens. Run unsloth install-kernels xformers to install the xformers build that matches your torch (the cu130 one for you).
    To update: uv pip install --upgrade unsloth unsloth_zoo --force-reinstall --no-cache-dir (if it's not in the current release yet it'll be in the next one). Reopen if it still happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions