xformers icon indicating copy to clipboard operation
xformers copied to clipboard

Cannot Compile for Older Version of PyTorch

Open 6630507 opened this issue 5 months ago • 5 comments

❓ Questions and Help

Running Ubuntu 22.

I am trying to compile xformers for Pytorch 1.12.1 + CUDA 11.3.

No matter what do, the compile process downloads Pytorch 2, compiles xformers for CUDA 12, and then complains about a mismatch:


    RuntimeError:
    The detected CUDA version (11.3) mismatches the version that was used to compile
    PyTorch (12.1). Please make sure to use the same CUDA versions.

I am running this command, which is supposed to compile for other versions of Pytorch


    Install from source: If you want to use with another version of PyTorch for instance (including nightly-releases)

# (Optional) Makes the build much faster
pip install ninja
# Set TORCH_CUDA_ARCH_LIST if running and building on different GPU types
pip install -v -U git+https://github.com/facebookresearch/xformers.git@main#egg=xformers
# (this can take dozens of minutes)

I keep re-installing PyTorch 1.12 + CUDA 11.3, but no matter what I try, Xformers always downloads Torch 2 and fails to install.

Is it possible to build Xformers for any version of Pytorch other than 2?

6630507 avatar Jan 26 '24 17:01 6630507