facebookresearch / xformers

Hackable and optimized Transformers building blocks, supporting a composable construction.
https://facebookresearch.github.io/xformers/
Other
8.64k stars 614 forks source link

Xformers can't build from source anymore. #892

Open Shaistrong opened 1 year ago

Shaistrong commented 1 year ago

šŸ› Bug

Command pip install -v -U git+https://github.com/facebookresearch/xformers.git@main#egg=xformers

To Reproduce

Steps to reproduce the behavior: C:\Users\joker\OneDrive\Desktop\A.I\xformers\Scripts>C:\Users\joker\OneDrive\Desktop\A.I\xformers\Scripts\activate

(xformers) C:\Users\joker\OneDrive\Desktop\A.I\xformers\Scripts>pip show torch Name: torch Version: 2.1.0+cu121 Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration Home-page: https://pytorch.org/ Author: PyTorch Team Author-email: packages@pytorch.org License: BSD-3 Location: c:\users\joker\onedrive\desktop\a.i\xformers\lib\site-packages Requires: filelock, fsspec, jinja2, networkx, sympy, typing-extensions Required-by: accelerate, audiocraft, demucs, dora-search, encodec, exllama, exllamav2, fairscale, flashy, julius, openunmix, peft, rotary-embedding-torch, suno-bark, timm, torchaudio, torchmetrics, torchsde, torchvision, ultralytics, vocos, xformers

(xformers) C:\Users\joker\OneDrive\Desktop\A.I\xformers\Scripts>pip install -v -U git+https://github.com/facebookresearch/xformers.git@main#egg=xformers --force-reinstall Using pip 22.3.1 from C:\Users\joker\OneDrive\Desktop\A.I\xformers\lib\site-packages\pip (python 3.10) Collecting xformers Cloning https://github.com/facebookresearch/xformers.git (to revision main) to c:\users\joker\appdata\local\temp\pip-install-_m1ytguv\xformers_52442801e8794b6999fb78b007619d88 Running command git version git version 2.41.0.windows.3 Running command git clone --filter=blob:none https://github.com/facebookresearch/xformers.git 'C:\Users\joker\AppData\Local\Temp\pip-install-_m1ytguv\xformers_52442801e8794b6999fb78b007619d88' Cloning into 'C:\Users\joker\AppData\Local\Temp\pip-install-_m1ytguv\xformers_52442801e8794b6999fb78b007619d88'... Updating files: 0% (2/586) Updating files: 1% (6/586) Updating files: 2% (12/586) Updating files: 3% (18/586) Updating files: 4% (24/586) Updating files: 5% (30/586) Updating files: 6% (36/586) Updating files: 7% (42/586) Updating files: 8% (47/586) Updating files: 9% (53/586) Updating files: 10% (59/586) Updating files: 11% (65/586) Updating files: 12% (71/586) Updating files: 13% (77/586) Updating files: 14% (83/586) Updating files: 15% (88/586) Updating files: 16% (94/586) Updating files: 17% (100/586) Updating files: 18% (106/586) Updating files: 19% (112/586) Updating files: 20% (118/586) Updating files: 21% (124/586) Updating files: 22% (129/586) Updating files: 23% (135/586) Updating files: 24% (141/586) Updating files: 25% (147/586) Updating files: 26% (153/586) Updating files: 27% (159/586) Updating files: 28% (165/586) Updating files: 29% (170/586) Updating files: 30% (176/586) Updating files: 31% (182/586) Updating files: 32% (188/586) Updating files: 33% (194/586) Updating files: 34% (200/586) Updating files: 35% (206/586) Updating files: 36% (211/586) Updating files: 37% (217/586) Updating files: 38% (223/586) Updating files: 39% (229/586) Updating files: 40% (235/586) Updating files: 41% (241/586) Updating files: 42% (247/586) Updating files: 43% (252/586) Updating files: 44% (258/586) Updating files: 45% (264/586) Updating files: 46% (270/586) Updating files: 47% (276/586) Updating files: 48% (282/586) Updating files: 49% (288/586) Updating files: 50% (293/586) Updating files: 51% (299/586) Updating files: 52% (305/586) Updating files: 53% (311/586) Updating files: 54% (317/586) Updating files: 55% (323/586) Updating files: 56% (329/586) Updating files: 57% (335/586) Updating files: 58% (340/586) Updating files: 59% (346/586) Updating files: 60% (352/586) Updating files: 61% (358/586) Updating files: 62% (364/586) Updating files: 63% (370/586) Updating files: 64% (376/586) Updating files: 65% (381/586) Updating files: 66% (387/586) Updating files: 67% (393/586) Updating files: 68% (399/586) Updating files: 69% (405/586) Updating files: 70% (411/586) Updating files: 71% (417/586) Updating files: 72% (422/586) Updating files: 73% (428/586) Updating files: 74% (434/586) Updating files: 75% (440/586) Updating files: 76% (446/586) Updating files: 77% (452/586) Updating files: 78% (458/586) Updating files: 79% (463/586) Updating files: 80% (469/586) Updating files: 81% (475/586) Updating files: 82% (481/586) Updating files: 83% (487/586) Updating files: 84% (493/586) Updating files: 85% (499/586) Updating files: 86% (504/586) Updating files: 87% (510/586) Updating files: 88% (516/586) Updating files: 89% (522/586) Updating files: 90% (528/586) Updating files: 91% (534/586) Updating files: 92% (540/586) Updating files: 93% (545/586) Updating files: 94% (551/586) Updating files: 95% (557/586) Updating files: 96% (563/586) Updating files: 97% (569/586) Updating files: 98% (575/586) Updating files: 99% (581/586) Updating files: 100% (586/586) Updating files: 100% (586/586), done. Running command git show-ref main de59cfc23bc42b42f90b95258a38477ce6a9c38b refs/heads/main de59cfc23bc42b42f90b95258a38477ce6a9c38b refs/remotes/origin/main Running command git symbolic-ref -q HEAD refs/heads/main Resolved https://github.com/facebookresearch/xformers.git to commit de59cfc23bc42b42f90b95258a38477ce6a9c38b Running command git submodule update --init --recursive -q Running command git rev-parse HEAD de59cfc23bc42b42f90b95258a38477ce6a9c38b Running command python setup.py egg_info Traceback (most recent call last): File "", line 2, in File "", line 34, in File "C:\Users\joker\AppData\Local\Temp\pip-install-_m1ytguv\xformers_52442801e8794b6999fb78b007619d88\setup.py", line 418, in extensions, extensions_metadata = get_extensions() File "C:\Users\joker\AppData\Local\Temp\pip-install-_m1ytguv\xformers_52442801e8794b6999fb78b007619d88\setup.py", line 260, in get_extensions cuda_version = get_cuda_version(CUDA_HOME) File "C:\Users\joker\AppData\Local\Temp\pip-install-_m1ytguv\xformers_52442801e8794b6999fb78b007619d88\setup.py", line 109, in get_cuda_version raw_output = subprocess.check_output([nvcc_bin, "-V"], universal_newlines=True) File "C:\Users\joker\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 421, in check_output return run(popenargs, stdout=PIPE, timeout=timeout, check=True, File "C:\Users\joker\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 503, in run with Popen(popenargs, **kwargs) as process: File "C:\Users\joker\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 971, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\joker\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1440, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] The system cannot find the file specified error: subprocess-exited-with-error

Ɨ python setup.py egg_info did not run successfully. ā”‚ exit code: 1 ā•°ā”€> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip. full command: 'C:\Users\joker\OneDrive\Desktop\A.I\xformers\Scripts\python.exe' -c ' exec(compile('"'"''"'"''"'"'

This is -- a caller that pip uses to run setup.py

#

- It imports setuptools before invoking setup.py, to enable projects that directly

import from distutils.core to work with newer packaging standards.

- It provides a clear error message when setuptools is not installed.

- It sets sys.argv[0] to the underlying setup.py, when invoking setup.py so

setuptools doesn'"'"'t think the script is -c. This avoids the following warning:

manifest_maker: standard file '"'"'-c'"'"' not found".

- It generates a shim setup.py, for handling setup.cfg-only projects.

import os, sys, tokenize

try: import setuptools except ImportError as error: print( "ERROR: Can not execute setup.py since setuptools is not available in " "the build environment.", file=sys.stderr, ) sys.exit(1)

file = %r sys.argv[0] = file

if os.path.exists(file): filename = file with tokenize.open(file) as f: setup_py_code = f.read() else: filename = "" setup_py_code = "from setuptools import setup; setup()"

exec(compile(setup_py_code, filename, "exec")) '"'"''"'"''"'"' % ('"'"'C:\Users\joker\AppData\Local\Temp\pip-install-_m1ytguv\xformers_52442801e8794b6999fb78b007619d88\setup.py'"'"',), "", "exec"))' egg_info --egg-base 'C:\Users\joker\AppData\Local\Temp\pip-pip-egg-info-5_wvrn2p' cwd: C:\Users\joker\AppData\Local\Temp\pip-install-_m1ytguv\xformers_52442801e8794b6999fb78b007619d88\ Preparing metadata (setup.py) ... error error: metadata-generation-failed

Ɨ Encountered error while generating package metadata. ā•°ā”€> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

[notice] A new release of pip available: 22.3.1 -> 23.2.1 [notice] To update, run: python.exe -m pip install --upgrade pip

(xformers) C:\Users\joker\OneDrive\Desktop\A.I\xformers\Scripts>`

  1. attempt to build xformers from source.

Expected behavior expected behavior is to it to function as mentioned on the repository.

You can run the script with:

danthe3rd commented 1 year ago

Hey - just wanted to flag that we have windows builds for cu118 / cu121 (https://github.com/facebookresearch/xformers/tree/main#installing-xformers). The cu121 windows builds now include Flash-Attention, so you shouldn't need to build from source

soulteary commented 10 months ago

no, it can, refs: https://github.com/facebookresearch/xformers/issues/960