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

How to assign ROCm architecture during pip installing #1356

Open
deeptimhe opened this issue Nov 25, 2024 · 0 comments
Open

How to assign ROCm architecture during pip installing #1356

deeptimhe opened this issue Nov 25, 2024 · 0 comments

Comments

@deeptimhe
Copy link

I am installing flash-attn rocm version (2.7.0.post2), but I only have a A100 GPU machine. It gives error when pip install --no-cache-dir flash-attn --no-build-isolation:

Using envvar MAX_JOBS (12) as the number of workers...
      [1/7] /opt/rocm-6.2.4/bin/hipcc  -I/tmp/pip-install-2zfjkyvz/flash-attn_fd8e4c61763a4b06b464c6b98ad7105f/csrc/composable_kernel/include -I/tmp/pip-install-2zfjkyvz/flash-attn_fd8e4c61763a4b06b464c6b98ad7105f/csrc/composable_kernel/library/include -I/tmp/pip-install-2zfjkyvz/flash-attn_fd8e4c61763a4b06b464c6b98ad7105f/csrc/composable_kernel/example/ck_tile/01_fmha -I/usr/local/lib/python3.10/dist-packages/torch/include -I/usr/local/lib/python3.10/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.10/dist-packages/torch/include/TH -I/usr/local/lib/python3.10/dist-packages/torch/include/THC -I/usr/local/lib/python3.10/dist-packages/torch/include/THH -I/opt/rocm-6.2.4/include -I/usr/include/python3.10 -c -c /tmp/pip-install-2zfjkyvz/flash-attn_fd8e4c61763a4b06b464c6b98ad7105f/csrc/flash_attn_ck/mha_bwd.hip -o /tmp/pip-install-2zfjkyvz/flash-attn_fd8e4c61763a4b06b464c6b98ad7105f/build/temp.linux-x86_64-3.10/csrc/flash_attn_ck/mha_bwd.o -fPIC -D__HIP_PLATFORM_AMD__=1 -DUSE_ROCM=1 -DHIPBLAS_V2 -DCUDA_HAS_FP16=1 -D__HIP_NO_HALF_OPERATORS__=1 -D__HIP_NO_HALF_CONVERSIONS__=1 --offload-arch=native -O3 -std=c++17 -DCK_TILE_FMHA_FWD_FAST_EXP2=1 -fgpu-flush-denormals-to-zero -DCK_ENABLE_BF16 -DCK_ENABLE_BF8 -DCK_ENABLE_FP16 -DCK_ENABLE_FP32 -DCK_ENABLE_FP64 -DCK_ENABLE_FP8 -DCK_ENABLE_INT8 -DCK_USE_XDL -DUSE_PROF_API=1 -D__HIP_PLATFORM_HCC__=1 -DCK_TILE_FLOAT_TO_BFLOAT16_DEFAULT=3 -fno-offload-uniform-block -mllvm -enable-post-misched=0 -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false -mllvm -amdgpu-coerce-illegal-types=1 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=flash_attn_2_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -fno-gpu-rdc
      FAILED: /tmp/pip-install-2zfjkyvz/flash-attn_fd8e4c61763a4b06b464c6b98ad7105f/build/temp.linux-x86_64-3.10/csrc/flash_attn_ck/mha_bwd.o
      /opt/rocm-6.2.4/bin/hipcc  -I/tmp/pip-install-2zfjkyvz/flash-attn_fd8e4c61763a4b06b464c6b98ad7105f/csrc/composable_kernel/include -I/tmp/pip-install-2zfjkyvz/flash-attn_fd8e4c61763a4b06b464c6b98ad7105f/csrc/composable_kernel/library/include -I/tmp/pip-install-2zfjkyvz/flash-attn_fd8e4c61763a4b06b464c6b98ad7105f/csrc/composable_kernel/example/ck_tile/01_fmha -I/usr/local/lib/python3.10/dist-packages/torch/include -I/usr/local/lib/python3.10/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.10/dist-packages/torch/include/TH -I/usr/local/lib/python3.10/dist-packages/torch/include/THC -I/usr/local/lib/python3.10/dist-packages/torch/include/THH -I/opt/rocm-6.2.4/include -I/usr/include/python3.10 -c -c /tmp/pip-install-2zfjkyvz/flash-attn_fd8e4c61763a4b06b464c6b98ad7105f/csrc/flash_attn_ck/mha_bwd.hip -o /tmp/pip-install-2zfjkyvz/flash-attn_fd8e4c61763a4b06b464c6b98ad7105f/build/temp.linux-x86_64-3.10/csrc/flash_attn_ck/mha_bwd.o -fPIC -D__HIP_PLATFORM_AMD__=1 -DUSE_ROCM=1 -DHIPBLAS_V2 -DCUDA_HAS_FP16=1 -D__HIP_NO_HALF_OPERATORS__=1 -D__HIP_NO_HALF_CONVERSIONS__=1 --offload-arch=native -O3 -std=c++17 -DCK_TILE_FMHA_FWD_FAST_EXP2=1 -fgpu-flush-denormals-to-zero -DCK_ENABLE_BF16 -DCK_ENABLE_BF8 -DCK_ENABLE_FP16 -DCK_ENABLE_FP32 -DCK_ENABLE_FP64 -DCK_ENABLE_FP8 -DCK_ENABLE_INT8 -DCK_USE_XDL -DUSE_PROF_API=1 -D__HIP_PLATFORM_HCC__=1 -DCK_TILE_FLOAT_TO_BFLOAT16_DEFAULT=3 -fno-offload-uniform-block -mllvm -enable-post-misched=0 -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false -mllvm -amdgpu-coerce-illegal-types=1 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=flash_attn_2_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -fno-gpu-rdc
      clang++: error: cannot determine amdgcn architecture: /opt/rocm-6.2.4/lib/llvm/bin/amdgpu-arch: ; consider passing it via '--offload-arch'
      failed to execute:/opt/rocm-6.2.4/lib/llvm/bin/clang++  --offload-arch=native  -I/tmp/pip-install-2zfjkyvz/flash-attn_fd8e4c61763a4b06b464c6b98ad7105f/csrc/composable_kernel/include -I/tmp/pip-install-2zfjkyvz/flash-attn_fd8e4c61763a4b06b464c6b98ad7105f/csrc/composable_kernel/library/include -I/tmp/pip-install-2zfjkyvz/flash-attn_fd8e4c61763a4b06b464c6b98ad7105f/csrc/composable_kernel/example/ck_tile/01_fmha -I/usr/local/lib/python3.10/dist-packages/torch/include -I/usr/local/lib/python3.10/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.10/dist-packages/torch/include/TH -I/usr/local/lib/python3.10/dist-packages/torch/include/THC -I/usr/local/lib/python3.10/dist-packages/torch/include/THH -I/opt/rocm-6.2.4/include -I/usr/include/python3.10 -c -c -x hip /tmp/pip-install-2zfjkyvz/flash-attn_fd8e4c61763a4b06b464c6b98ad7105f/csrc/flash_attn_ck/mha_bwd.hip -o "/tmp/pip-install-2zfjkyvz/flash-attn_fd8e4c61763a4b06b464c6b98ad7105f/build/temp.linux-x86_64-3.10/csrc/flash_attn_ck/mha_bwd.o" -fPIC -D__HIP_PLATFORM_AMD__=1 -DUSE_ROCM=1 -DHIPBLAS_V2 -DCUDA_HAS_FP16=1 -D__HIP_NO_HALF_OPERATORS__=1 -D__HIP_NO_HALF_CONVERSIONS__=1 -O3 -std=c++17 -DCK_TILE_FMHA_FWD_FAST_EXP2=1 -fgpu-flush-denormals-to-zero -DCK_ENABLE_BF16 -DCK_ENABLE_BF8 -DCK_ENABLE_FP16 -DCK_ENABLE_FP32 -DCK_ENABLE_FP64 -DCK_ENABLE_FP8 -DCK_ENABLE_INT8 -DCK_USE_XDL -DUSE_PROF_API=1 -D__HIP_PLATFORM_HCC__=1 -DCK_TILE_FLOAT_TO_BFLOAT16_DEFAULT=3 -fno-offload-uniform-block -mllvm -enable-post-misched=0 -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false -mllvm -amdgpu-coerce-illegal-types=1 -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=flash_attn_2_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -fno-gpu-rdc

Seems I should assign amdgpu-arch when installing?

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