Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install flash_attn on H100 with CUDA 12.5 #1422

Open
ghadiaravi13 opened this issue Jan 6, 2025 · 0 comments
Open

Unable to install flash_attn on H100 with CUDA 12.5 #1422

ghadiaravi13 opened this issue Jan 6, 2025 · 0 comments

Comments

@ghadiaravi13
Copy link

ghadiaravi13 commented Jan 6, 2025

Hi,

I am trying to install flash_attn on H100 with CUDA driver 12.5, and I already installed torch with cu12.6

torch.cuda.is_available() = True on my system

However, I get the below error when trying to install flash_attn:

`
[9/9] /home1/apps/nvidia/Linux_aarch64/24.7/cuda/12.5/bin/nvcc --generate-dependencies-with-compile --dependency-output /work/10198/ghadiaravi13/ls6/flash_attn_wheels-1.0.9/build/temp.linux-aarch64-cpython-39/csrc/flash_attn/src/fmha_fwd_hdim64.o.d -I/work/10198/ghadiaravi13/ls6/flash_attn_wheels-1.0.9/csrc/flash_attn -I/work/10198/ghadiaravi13/ls6/flash_attn_wheels-1.0.9/csrc/flash_attn/src -I/work/10198/ghadiaravi13/ls6/flash_attn_wheels-1.0.9/csrc/flash_attn/cutlass/include -I/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/torch/include -I/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/torch/include/torch/csrc/api/include -I/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/torch/include/TH -I/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/torch/include/THC -I/home1/apps/nvidia/Linux_aarch64/24.7/cuda/12.5/include -I/work/10198/ghadiaravi13/vista/eff_llm_env_vista/include -I/usr/include/python3.9 -c -c /work/10198/ghadiaravi13/ls6/flash_attn_wheels-1.0.9/csrc/flash_attn/src/fmha_fwd_hdim64.cu -o /work/10198/ghadiaravi13/ls6/flash_attn_wheels-1.0.9/build/temp.linux-aarch64-cpython-39/csrc/flash_attn/src/fmha_fwd_hdim64.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -std=c++17 -U__CUDA_NO_HALF_OPERATORS__ -U__CUDA_NO_HALF_CONVERSIONS__ -U__CUDA_NO_HALF2_OPERATORS__ -U__CUDA_NO_BFLOAT16_CONVERSIONS__ --expt-relaxed-constexpr --expt-extended-lambda --use_fast_math --ptxas-options=-v -lineinfo -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_90,code=sm_90 --threads 4 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="gcc"' '-DPYBIND11_STDLIB="libstdcpp"' '-DPYBIND11_BUILD_ABI="cxxabi1016"' -DTORCH_EXTENSION_NAME=flash_attn_cuda -D_GLIBCXX_USE_CXX11_ABI=1 -ccbin /home1/apps/nvidia/Linux_aarch64/24.7/compilers/bin/nvc
FAILED: /work/10198/ghadiaravi13/ls6/flash_attn_wheels-1.0.9/build/temp.linux-aarch64-cpython-39/csrc/flash_attn/src/fmha_fwd_hdim64.o
/home1/apps/nvidia/Linux_aarch64/24.7/cuda/12.5/bin/nvcc --generate-dependencies-with-compile --dependency-output /work/10198/ghadiaravi13/ls6/flash_attn_wheels-1.0.9/build/temp.linux-aarch64-cpython-39/csrc/flash_attn/src/fmha_fwd_hdim64.o.d -I/work/10198/ghadiaravi13/ls6/flash_attn_wheels-1.0.9/csrc/flash_attn -I/work/10198/ghadiaravi13/ls6/flash_attn_wheels-1.0.9/csrc/flash_attn/src -I/work/10198/ghadiaravi13/ls6/flash_attn_wheels-1.0.9/csrc/flash_attn/cutlass/include -I/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/torch/include -I/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/torch/include/torch/csrc/api/include -I/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/torch/include/TH -I/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/torch/include/THC -I/home1/apps/nvidia/Linux_aarch64/24.7/cuda/12.5/include -I/work/10198/ghadiaravi13/vista/eff_llm_env_vista/include -I/usr/include/python3.9 -c -c /work/10198/ghadiaravi13/ls6/flash_attn_wheels-1.0.9/csrc/flash_attn/src/fmha_fwd_hdim64.cu -o /work/10198/ghadiaravi13/ls6/flash_attn_wheels-1.0.9/build/temp.linux-aarch64-cpython-39/csrc/flash_attn/src/fmha_fwd_hdim64.o -D__CUDA_NO_HALF_OPERATORS
-D__CUDA_NO_HALF_CONVERSIONS
_ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -std=c++17 -U__CUDA_NO_HALF_OPERATORS__ -U__CUDA_NO_HALF_CONVERSIONS__ -U__CUDA_NO_HALF2_OPERATORS__ -U__CUDA_NO_BFLOAT16_CONVERSIONS__ --expt-relaxed-constexpr --expt-extended-lambda --use_fast_math --ptxas-options=-v -lineinfo -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_90,code=sm_90 --threads 4 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1016"' -DTORCH_EXTENSION_NAME=flash_attn_cuda -D_GLIBCXX_USE_CXX11_ABI=1 -ccbin /home1/apps/nvidia/Linux_aarch64/24.7/compilers/bin/nvc
nvcc fatal : Unsupported NVHPC compiler found. nvc++ is the only NVHPC compiler that is supported.
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/torch/utils/cpp_extension.py", line 2219, in _run_ninja_build
subprocess.run(
File "/usr/lib64/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/work/10198/ghadiaravi13/ls6/flash_attn_wheels-1.0.9/setup.py", line 257, in
setup(
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/init.py", line 117, in setup
return distutils.core.setup(**attrs)
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/_distutils/core.py", line 186, in setup
return run_commands(dist)
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
dist.run_commands()
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/_distutils/dist.py", line 983, in run_commands
self.run_command(cmd)
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/dist.py", line 993, in run_command
super().run_command(command)
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command
cmd_obj.run()
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/command/install.py", line 109, in run
self.do_egg_install()
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/command/install.py", line 167, in do_egg_install
self.run_command('bdist_egg')
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/_distutils/cmd.py", line 339, in run_command
self.distribution.run_command(command)
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/dist.py", line 993, in run_command
super().run_command(command)
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command
cmd_obj.run()
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/command/bdist_egg.py", line 177, in run
cmd = self.call_command('install_lib', warn_dir=False)
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/command/bdist_egg.py", line 163, in call_command
self.run_command(cmdname)
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/_distutils/cmd.py", line 339, in run_command
self.distribution.run_command(command)
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/dist.py", line 993, in run_command
super().run_command(command)
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command
cmd_obj.run()
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/command/install_lib.py", line 19, in run
self.build()
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/_distutils/command/install_lib.py", line 110, in build
self.run_command('build_ext')
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/_distutils/cmd.py", line 339, in run_command
self.distribution.run_command(command)
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/dist.py", line 993, in run_command
super().run_command(command)
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command
cmd_obj.run()
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/command/build_ext.py", line 99, in run
_build_ext.run(self)
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 365, in run
self.build_extensions()
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/torch/utils/cpp_extension.py", line 909, in build_extensions
build_ext.build_extensions(self)
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 481, in build_extensions
self._build_extensions_serial()
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 507, in _build_extensions_serial
self.build_extension(ext)
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/command/build_ext.py", line 264, in build_extension
_build_ext.build_extension(self, ext)
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 562, in build_extension
objects = self.compiler.compile(
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/torch/utils/cpp_extension.py", line 722, in unix_wrap_ninja_compile
_write_ninja_file_and_compile_objects(
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/torch/utils/cpp_extension.py", line 1879, in _write_ninja_file_and_compile_objects
_run_ninja_build(
File "/work/10198/ghadiaravi13/vista/eff_llm_env_vista/lib64/python3.9/site-packages/torch/utils/cpp_extension.py", line 2235, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension
`

I also tried to build Pytorch using nvc++ compiler (instead of the default g++) but am unable to do so due to some other errors.

Can someone help suggest if they have faced similar error earlier?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant