triton
triton copied to clipboard
Compilation problems on windows 11
hello! i am using a x86 machine and running windows 11 try to compile and install triton on it. so i follow the official instruction
git clone https://github.com/openai/triton.git;
cd triton/python;
pip install cmake; # build-time dependency
pip install -e .
but i got an error
Building editable for triton (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building editable for triton (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [133 lines of output]
the full log is
PS C:\Users\admin\Desktop\triton\python> pip install -e .
Obtaining file:///C:/Users/admin/Desktop/triton/python
Installing build dependencies ... done
Checking if build backend supports build_editable ... done
Getting requirements to build editable ... done
Preparing editable metadata (pyproject.toml) ... done
Requirement already satisfied: filelock in c:\users\admin\appdata\local\programs\python\python310\lib\site-packages (from triton==2.1.0) (3.12.0)
Building wheels for collected packages: triton
Building editable for triton (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building editable for triton (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [133 lines of output]
running editable_wheel
creating C:\Users\admin\AppData\Local\Temp\pip-wheel-ycx1h9gz\.tmp-_pb7yrz3\triton.egg-info
writing C:\Users\admin\AppData\Local\Temp\pip-wheel-ycx1h9gz\.tmp-_pb7yrz3\triton.egg-info\PKG-INFO
writing dependency_links to C:\Users\admin\AppData\Local\Temp\pip-wheel-ycx1h9gz\.tmp-_pb7yrz3\triton.egg-info\dependency_links.txt
writing requirements to C:\Users\admin\AppData\Local\Temp\pip-wheel-ycx1h9gz\.tmp-_pb7yrz3\triton.egg-info\requires.txt
writing top-level names to C:\Users\admin\AppData\Local\Temp\pip-wheel-ycx1h9gz\.tmp-_pb7yrz3\triton.egg-info\top_level.txt
writing manifest file 'C:\Users\admin\AppData\Local\Temp\pip-wheel-ycx1h9gz\.tmp-_pb7yrz3\triton.egg-info\SOURCES.txt'
reading manifest file 'C:\Users\admin\AppData\Local\Temp\pip-wheel-ycx1h9gz\.tmp-_pb7yrz3\triton.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: manifest_maker: MANIFEST.in, line 3: path 'triton/runtime/backends/' cannot end with '/'
writing manifest file 'C:\Users\admin\AppData\Local\Temp\pip-wheel-ycx1h9gz\.tmp-_pb7yrz3\triton.egg-info\SOURCES.txt'
creating 'C:\Users\admin\AppData\Local\Temp\pip-wheel-ycx1h9gz\.tmp-_pb7yrz3\triton-2.1.0.dist-info'
C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\wheel\bdist_wheel.py:100: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
if get_flag("Py_DEBUG", hasattr(sys, "gettotalrefcount"), warn=(impl == "cp")):
creating C:\Users\admin\AppData\Local\Temp\pip-wheel-ycx1h9gz\.tmp-_pb7yrz3\triton-2.1.0.dist-info\WHEEL
running build_py
running build_ext
Traceback (most recent call last):
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 155, in run
self._create_wheel_file(bdist_wheel)
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 344, in _create_wheel_file
files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp)
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 267, in _run_build_commands
self._run_build_subcommands()
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 294, in _run_build_subcommands
self.run_command(name)
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\dist.py", line 1243, in run_command
super().run_command(command)
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "<string>", line 162, in run
File "<string>", line 180, in build_extension
File "<string>", line 93, in get_thirdparty_packages
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 216, in urlopen
return opener.open(url, data, timeout)
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 503, in open
req = Request(fullurl, data)
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 322, in __init__
self.full_url = url
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 348, in full_url
self._parse()
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 377, in _parse
raise ValueError("unknown url type: %r" % self.full_url)
ValueError: unknown url type: ''
C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\_distutils\dist.py:988: _DebuggingTips: Problem in editable installation.
!!
********************************************************************************
An error happened while installing `triton` in editable mode.
The following steps are recommended to help debug this problem:
- Try to install the project normally, without using the editable mode.
Does the error still persist?
(If it does, try fixing the problem before attempting the editable mode).
- If you are using binary extensions, make sure you have all OS-level
dependencies installed (e.g. compilers, toolchains, binary libraries, ...).
- Try the latest version of setuptools (maybe the error was already fixed).
- If you (or your project dependencies) are using any setuptools extension
or customization, make sure they support the editable mode.
After following the steps above, if the problem still persists and
you think this is related to how setuptools handles editable installations,
please submit a reproducible example
(see https://stackoverflow.com/help/minimal-reproducible-example) to:
https://github.com/pypa/setuptools/issues
See https://setuptools.pypa.io/en/latest/userguide/development_mode.html for details.
********************************************************************************
!!
cmd_obj.run()
downloading and extracting ...
Traceback (most recent call last):
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
main()
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 273, in build_editable
return hook(wheel_directory, config_settings, metadata_directory)
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\build_meta.py", line 445, in build_editable
return self._build_with_temp_dir(
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\build_meta.py", line 401, in _build_with_temp_dir
self.run_setup()
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup
super(_BuildMetaLegacyBackend,
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup
exec(code, locals())
File "<string>", line 231, in <module>
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\__init__.py", line 107, in setup
return distutils.core.setup(**attrs)
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\dist.py", line 1243, in run_command
super().run_command(command)
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 155, in run
self._create_wheel_file(bdist_wheel)
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 344, in _create_wheel_file
files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp)
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 267, in _run_build_commands
self._run_build_subcommands()
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 294, in _run_build_subcommands
self.run_command(name)
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\dist.py", line 1243, in run_command
super().run_command(command)
File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "<string>", line 162, in run
File "<string>", line 180, in build_extension
File "<string>", line 93, in get_thirdparty_packages
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 216, in urlopen
return opener.open(url, data, timeout)
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 503, in open
req = Request(fullurl, data)
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 322, in __init__
self.full_url = url
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 348, in full_url
self._parse()
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 377, in _parse
raise ValueError("unknown url type: %r" % self.full_url)
ValueError: unknown url type: ''
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building editable for triton
Failed to build triton
ERROR: Could not build wheels for triton, which is required to install pyproject.toml-based projects
is any way to install triton on windows 11? thank you!
I also have the same problem
I also have the same problem on win10
I'm also having the same issue on Win11 x64. Triton-install-Log.txt
I also have the same problem
https://github.com/openai/triton#compatibility Only supports Linux. (Or WSL2, but not guaranteed)
https://github.com/openai/triton#compatibility Only supports Linux. (Or WSL2, but not guaranteed)
But someone did make it work:
pip install https://huggingface.co/r4ziel/xformers_pre_built/resolve/main/triton-2.0.0-cp310-cp310-win_amd64.whl
https://github.com/openai/triton#compatibility Only supports Linux. (Or WSL2, but not guaranteed)
But someone did make it work:
pip install https://huggingface.co/r4ziel/xformers_pre_built/resolve/main/triton-2.0.0-cp310-cp310-win_amd64.whl
Thank you very much. I tried it and it only encapsulated a Whl file without modifying the Linux path inside. The error still exists
https://github.com/openai/triton#compatibility Only supports Linux. (Or WSL2, but not guaranteed)
But someone did make it work:
pip install https://huggingface.co/r4ziel/xformers_pre_built/resolve/main/triton-2.0.0-cp310-cp310-win_amd64.whl
Thanks, you save my time, Triton is now installed in Windows 11
But someone did make it work:
pip install https://huggingface.co/r4ziel/xformers_pre_built/resolve/main/triton-2.0.0-cp310-cp310-win_amd64.whl
I get this error
ERROR: triton-2.0.0-cp310-cp310-win_amd64.whl is not a supported wheel on this platform.
https://github.com/openai/triton#compatibility僅支援Linux。 (或WSL2,但不保證)
但確實有人讓它成功了: pip安裝https://huggingface.co/r4ziel/xformers_pre_built/resolve/main/triton-2.0.0-cp310-cp310-win_amd64.whl
謝謝,你節省了我的時間,Triton現在安裝在Windows 11中
I don't know how to modify it
def default_cache_dir(): return os.path.join(os.environ["HOMEPATH"], ".triton", "cache")
def libcuda_dirs(): locs = subprocess.check_output(["whereis", "libcuda.so"]).decode().strip().split()[1:] return [os.path.dirname(loc) for loc in locs]
File "C:\Users\b1303\AppData\Roaming\Python\Python310\site-packages\triton\compiler.py", line 1155, in _build cuda_lib_dirs = libcuda_dirs() File "C:\Users\b1303\AppData\Roaming\Python\Python310\site-packages\triton\compiler.py", line 1134, in libcuda_dirs locs = subprocess.check_output(["whereis", "libcuda.so"]).decode().strip().split()[1:] File "G:\ProgramData\anaconda3\lib\subprocess.py", line 421, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "G:\ProgramData\anaconda3\lib\subprocess.py", line 503, in run with Popen(*popenargs, **kwargs) as process: File "G:\ProgramData\anaconda3\lib\subprocess.py", line 971, in init self._execute_child(args, executable, preexec_fn, close_fds, File "G:\ProgramData\anaconda3\lib\subprocess.py", line 1440, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2]
Please add Windows support already
see also https://github.com/openai/triton/pull/2738
any1 got a fix? even install from source wont work
Start dos prompt wsl.exe --set-default [ubuntu distribution] reboot windows try again