Closed nktice closed 1 week ago
I tried this again, and thought that I would share this output from trying..
git clone --recurse-submodules https://github.com/ROCmSoftwarePlatform/flash-attention.git
cd flash-attention
python setup.py build | grep -i error
# output follows
/home/n/flash-attention/csrc/composable_kernel/include/ck_tile/host/hip_check_error.hpp -> /home/n/flash-attention/csrc/composable_kernel/include/ck_tile/host/hip_check_error.hpp [skipped, no changes]
Successfully preprocessed all matching files.
/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/setuptools/__init__.py:85: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!
********************************************************************************
Requirements should be satisfied by a PEP 517 installer.
If you are using pip, you can try `pip install --use-pep517`.
********************************************************************************
!!
dist.fetch_build_eggs(dist.setup_requires)
Emitting ninja build file /home/n/flash-attention/build/temp.linux-x86_64-cpython-311/build.ninja...
Compiling objects...
Using envvar MAX_JOBS (6) as the number of workers...
/home/n/flash-attention/csrc/composable_kernel/include/ck_tile/core/arch/generic_memory_space_atomic_hip.hpp:66:19: error: static assertion failed due to requirement '(std::is_same<_Float16, int>::value && (4 == 1)) || (std::is_same<_Float16, unsigned int>::value && (4 == 1)) || (std::is_same<_Float16, float>::value && (4 == 1 || 4 == 2)) || (std::is_same<_Float16, double>::value && (4 == 1 || 4 == 2)) || (std::is_same<_Float16, unsigned short>::value && (4 == 2 || 4 == 4))': wrong! not implemented
1 error generated when compiling for gfx1100.
/home/n/flash-attention/csrc/composable_kernel/include/ck_tile/core/arch/generic_memory_space_atomic_hip.hpp:66:19: error: static assertion failed due to requirement '(std::is_same<_Float16, int>::value && (4 == 1)) || (std::is_same<_Float16, unsigned int>::value && (4 == 1)) || (std::is_same<_Float16, float>::value && (4 == 1 || 4 == 2)) || (std::is_same<_Float16, double>::value && (4 == 1 || 4 == 2)) || (std::is_same<_Float16, unsigned short>::value && (4 == 2 || 4 == 4))': wrong! not implemented
1 error generated when compiling for gfx1100.
/home/n/flash-attention/csrc/composable_kernel/include/ck_tile/core/arch/generic_memory_space_atomic_hip.hpp:66:19: error: static assertion failed due to requirement '(std::is_same<_Float16, int>::value && (4 == 1)) || (std::is_same<_Float16, unsigned int>::value && (4 == 1)) || (std::is_same<_Float16, float>::value && (4 == 1 || 4 == 2)) || (std::is_same<_Float16, double>::value && (4 == 1 || 4 == 2)) || (std::is_same<_Float16, unsigned short>::value && (4 == 2 || 4 == 4))': wrong! not implemented
1 error generated when compiling for gfx1100.
/home/n/flash-attention/csrc/composable_kernel/include/ck_tile/core/arch/generic_memory_space_atomic_hip.hpp:66:19: error: static assertion failed due to requirement '(std::is_same<_Float16, int>::value && (4 == 1)) || (std::is_same<_Float16, unsigned int>::value && (4 == 1)) || (std::is_same<_Float16, float>::value && (4 == 1 || 4 == 2)) || (std::is_same<_Float16, double>::value && (4 == 1 || 4 == 2)) || (std::is_same<_Float16, unsigned short>::value && (4 == 2 || 4 == 4))': wrong! not implemented
1 error generated when compiling for gfx1100.
/home/n/flash-attention/csrc/composable_kernel/include/ck_tile/core/arch/generic_memory_space_atomic_hip.hpp:66:19: error: static assertion failed due to requirement '(std::is_same<_Float16, int>::value && (4 == 1)) || (std::is_same<_Float16, unsigned int>::value && (4 == 1)) || (std::is_same<_Float16, float>::value && (4 == 1 || 4 == 2)) || (std::is_same<_Float16, double>::value && (4 == 1 || 4 == 2)) || (std::is_same<_Float16, unsigned short>::value && (4 == 2 || 4 == 4))': wrong! not implemented
1 error generated when compiling for gfx1100.
/home/n/flash-attention/csrc/composable_kernel/include/ck_tile/core/arch/generic_memory_space_atomic_hip.hpp:66:19: error: static assertion failed due to requirement '(std::is_same<_Float16, int>::value && (4 == 1)) || (std::is_same<_Float16, unsigned int>::value && (4 == 1)) || (std::is_same<_Float16, float>::value && (4 == 1 || 4 == 2)) || (std::is_same<_Float16, double>::value && (4 == 1 || 4 == 2)) || (std::is_same<_Float16, unsigned short>::value && (4 == 2 || 4 == 4))': wrong! not implemented
1 error generated when compiling for gfx1100.
Traceback (most recent call last):
File "/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 2104, in _run_ninja_build
subprocess.run(
File "/home/n/miniconda3/envs/textgen/lib/python3.11/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v', '-j', '6']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/n/flash-attention/setup.py", line 490, in <module>
setup(
File "/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/setuptools/__init__.py", line 108, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 184, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
dist.run_commands()
File "/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 970, in run_commands
self.run_command(cmd)
File "/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/setuptools/dist.py", line 945, in run_command
super().run_command(command)
File "/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 989, in run_command
cmd_obj.run()
File "/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
self.distribution.run_command(command)
File "/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/setuptools/dist.py", line 945, in run_command
super().run_command(command)
File "/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 989, in run_command
cmd_obj.run()
File "/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 93, in run
_build_ext.run(self)
File "/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 359, in run
self.build_extensions()
File "/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 868, in build_extensions
build_ext.build_extensions(self)
File "/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 479, in build_extensions
self._build_extensions_serial()
File "/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 505, in _build_extensions_serial
self.build_extension(ext)
File "/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 254, in build_extension
_build_ext.build_extension(self, ext)
File "/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/Cython/Distutils/build_ext.py", line 135, in build_extension
super(build_ext, self).build_extension(ext)
File "/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 560, in build_extension
objects = self.compiler.compile(
^^^^^^^^^^^^^^^^^^^^^^
File "/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 681, in unix_wrap_ninja_compile
_write_ninja_file_and_compile_objects(
File "/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 1784, in _write_ninja_file_and_compile_objects
_run_ninja_build(
File "/home/n/miniconda3/envs/textgen/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 2120, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension
So I note errors in flash-attention/csrc/composable_kernel/include/ck_tile/core/arch/generic_memory_space_atomic_hip.hpp:66:19
where something's missing for my architecture ( gfx1100 )
Hi @nktice. Internal ticket has been created to investigate your issue. Thanks!
Hi @nktice,
Thanks for reporting this issue. I tried building on an 7900XT and was able to run into a similar issue. Currently, flash-attention does not support Navi31 architecture and is exclusively for CDNA 2/3 (MI200's and 300's) (see README). However, I spoke with the internal team and there is currently an effort to add a Triton backend alongside the current CK backend which should allow for flash-attention to support RDNA Machines.
Problem Description
Unable to compile from sources... new python package errors don't give much info.
This is concluding with the following message that's lacking detail...
Operating System
NAME="Ubuntu" VERSION="24.04 LTS (Noble Numbat)"
CPU
model name : AMD Ryzen 9 5950X 16-Core Processor
GPU
AMD Radeon RX 7900 XTX
ROCm Version
ROCm 6.1.0
ROCm Component
No response
Steps to Reproduce
I've been maintaining instructions for installing a few AI tools on AMD gear, at the following address ( elsewhere on github ) http://github.com/nktice/AMD-AI There's a few versions based on different configs - note this dev version https://github.com/nktice/AMD-AI/blob/main/dev.md It has the commands for where flash-attention was being installed from. In stable version I had removed this section, due to FA's age, with the new version, I would like to add it back, once it is working.
As these instructions are no longer functional I thought I would write, as it is likely others will have these issues and may like to know what resolution may be found for these problems so they can use it.
With the new version I can not build from sources ( older versions did ).
Note message above in the problem description for text from console...
Could you please post the instructions you are using to get it to build - and requirements that are possibly missing that could be at fault?
Tried working around using pre-built packages that have been posted. I've written this page to install from packages that you have posted... https://github.com/nktice/AMD-AI/blob/main/flash-attention.md Version specific and with some odd requirements, so I wrote that down.
Loading TWG exllama wasn't using the new FA2 - so I wrote turboderp, to report these issues there, so they are aware. https://github.com/turboderp/exllamav2/issues/397
(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support
Additional Information
No response