mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2026-11-05 01:07:28 +00:00
[GH-ISSUE #1150] [Bug] ROCM部署 #801
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/ktransformers#801
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @roundcaky on GitHub (Apr 16, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1150
Originally assigned to: @Azure-Tang on GitHub.
检查清单
问题描述
ROCM部署,每次都卡在cmake编译,单独执行命令后如下报错
cmake /home/roundcaky/ktransformers/csrc/ktransformers_ext -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/roundcaky/ktransformers/build/lib.linux-x86_64-cpython-311/ -DPYTHON_EXECUTABLE=/home/roundcaky/anaconda3/envs/ktransformers/bin/python -DCMAKE_BUILD_TYPE=Release -DKTRANSFORMERS_USE_ROCM=ON -D_GLIBCXX_USE_CXX11_ABI=1 -DLLAMA_NATIVE=ON -DEXAMPLE_VERSION_INFO=0.2.4.post1+rocm68torch26avx2
-- CMAKE_SYSTEM_PROCESSOR: x86_64
-- x86 detected
CMake Deprecation Warning at /home/roundcaky/ktransformers/third_party/pybind11/CMakeLists.txt:13 (cmake_minimum_required):
Compatibility with CMake < 3.10 will be removed from a future version of
CMake.
Update the VERSION argument value. Or, use the ... syntax
to tell CMake that the project requires at least but has been updated
to work with policies introduced by or earlier.
-- pybind11 v2.14.0 dev1
-- Found OpenMP: TRUE (found version "4.5")
-- OpenMP found
-- Warning: ccache not found - consider installing it for faster compilation or disable this warning with LLAMA_CCACHE=OFF
-- CMAKE_SYSTEM_PROCESSOR: x86_64
-- x86 detected
-- enabling CUDA
CMake Error at /home/roundcaky/anaconda3/envs/ktransformers/lib/python3.11/site-packages/cmake/data/share/cmake-4.0/Modules/Internal/CMakeCUDAFindToolkit.cmake:104 (message):
Failed to find nvcc.
Compiler requires the CUDA toolkit. Please set the CUDAToolkit_ROOT
variable.
Call Stack (most recent call first):
/home/roundcaky/anaconda3/envs/ktransformers/lib/python3.11/site-packages/cmake/data/share/cmake-4.0/Modules/CMakeDetermineCUDACompiler.cmake:85 (cmake_cuda_find_toolkit)
CMakeLists.txt:262 (enable_language)
执行了ROCM=ON依然会去检测CUDA。
复现步骤
cmake /home/roundcaky/ktransformers/csrc/ktransformers_ext -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/roundcaky/ktransformers/build/lib.linux-x86_64-cpython-311/ -DPYTHON_EXECUTABLE=/home/roundcaky/anaconda3/envs/ktransformers/bin/python -DCMAKE_BUILD_TYPE=Release -DKTRANSFORMERS_USE_ROCM=ON -D_GLIBCXX_USE_CXX11_ABI=1 -DLLAMA_NATIVE=ON -DEXAMPLE_VERSION_INFO=0.2.4.post1+rocm68torch26avx2
环境信息
环境是ubuntu24.04,torch2.6.2+rocm6.2.4,cmake4.0
@CYSTEV-chn commented on GitHub (Apr 18, 2025):
Failed to find nvcc.
@Azure-Tang commented on GitHub (Apr 21, 2025):
尝试一下#1159merge以后的main分支呢?
@roundcaky commented on GitHub (Apr 22, 2025):
好的我去试试看,我试过0.2.3,0.2.3post1,0.2.3post2,0.2.4和0.2.4post1,都不行
@roundcaky commented on GitHub (Apr 22, 2025):
你好,尝试了#1177后,报了这个ninja错误。
@Azure-Tang commented on GitHub (Apr 22, 2025):
hello, 把falied to execute后面的报错整理成一行命令然后运行一下,看一下具体的编译问题是什么~
@roundcaky commented on GitHub (Apr 22, 2025):
报错如下:
clang++: warning: argument unused during compilation: '-Xcompiler' [-Wunused-command-line-argument]
In file included from /home/roundcaky/ktransformers/csrc/custom_marlin/gptq_marlin/gptq_marlin_repack.hip:3:
/home/roundcaky/ktransformers/csrc/custom_marlin/gptq_marlin/gptq_marlin_hip.cuh:49:43: error: use of undeclared identifier '__cvta_generic_to_shared'
49 | uint32_t smem = static_cast<uint32_t>(__cvta_generic_to_shared(smem_ptr));
| ^
/home/roundcaky/ktransformers/csrc/custom_marlin/gptq_marlin/gptq_marlin_hip.cuh:55:29: error: invalid input constraint 'l' in asm
55 | "r"(smem), "l"(glob_ptr), "n"(BYTES));
| ^
/home/roundcaky/ktransformers/csrc/custom_marlin/gptq_marlin/gptq_marlin_hip.cuh:60:43: error: use of undeclared identifier '__cvta_generic_to_shared'
60 | uint32_t smem = static_cast<uint32_t>(__cvta_generic_to_shared(smem_ptr));
| ^
/home/roundcaky/ktransformers/csrc/custom_marlin/gptq_marlin/gptq_marlin_hip.cuh:64:18: error: invalid input constraint 'l' in asm
64 | "l"(glob_ptr), "n"(BYTES));
| ^
/home/roundcaky/ktransformers/csrc/custom_marlin/gptq_marlin/gptq_marlin_repack.hip:331:3: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]
331 | hipDeviceGetAttribute(&blocks, hipDeviceAttributeMultiprocessorCount, dev);
| ^~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/roundcaky/ktransformers/csrc/custom_marlin/gptq_marlin/gptq_marlin_repack.hip:334:3: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]
334 | hipDeviceGetAttribute(&max_shared_mem,
| ^~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
335 | hipDeviceAttributeMaxSharedMemoryPerBlock, dev);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/roundcaky/ktransformers/csrc/custom_marlin/gptq_marlin/gptq_marlin_repack.hip:340:3: error: no matching function for call to 'hipFuncSetAttribute'
340 | CALL_IF(4, false)
| ^~~~~~~~~~~~~~~~~
/home/roundcaky/ktransformers/csrc/custom_marlin/gptq_marlin/gptq_marlin_repack.hip:268:7: note: expanded from macro 'CALL_IF'
268 | hipFuncSetAttribute(
| ^~~~~~~~~~~~~~~~~~~
/opt/rocm-6.3.0/lib/llvm/bin/../../../include/hip/hip_runtime_api.h:2262:12: note: candidate function not viable: no overload of 'marlin_repack_kernel' matching 'const void ' for 1st argument
2262 | hipError_t hipFuncSetAttribute(const void func, hipFuncAttribute attr, int value);
| ^ ~~~~~~~~~~~~~~~~
/home/roundcaky/ktransformers/csrc/custom_marlin/gptq_marlin/gptq_marlin_repack.hip:341:3: error: no matching function for call to 'hipFuncSetAttribute'
341 | CALL_IF(4, true)
| ^~~~~~~~~~~~~~~~
/home/roundcaky/ktransformers/csrc/custom_marlin/gptq_marlin/gptq_marlin_repack.hip:268:7: note: expanded from macro 'CALL_IF'
268 | hipFuncSetAttribute(
| ^~~~~~~~~~~~~~~~~~~
/opt/rocm-6.3.0/lib/llvm/bin/../../../include/hip/hip_runtime_api.h:2262:12: note: candidate function not viable: no overload of 'marlin_repack_kernel' matching 'const void ' for 1st argument
2262 | hipError_t hipFuncSetAttribute(const void func, hipFuncAttribute attr, int value);
| ^ ~~~~~~~~~~~~~~~~
/home/roundcaky/ktransformers/csrc/custom_marlin/gptq_marlin/gptq_marlin_repack.hip:342:3: error: no matching function for call to 'hipFuncSetAttribute'
342 | CALL_IF(8, false)
| ^~~~~~~~~~~~~~~~~
/home/roundcaky/ktransformers/csrc/custom_marlin/gptq_marlin/gptq_marlin_repack.hip:268:7: note: expanded from macro 'CALL_IF'
268 | hipFuncSetAttribute(
| ^~~~~~~~~~~~~~~~~~~
/opt/rocm-6.3.0/lib/llvm/bin/../../../include/hip/hip_runtime_api.h:2262:12: note: candidate function not viable: no overload of 'marlin_repack_kernel' matching 'const void ' for 1st argument
2262 | hipError_t hipFuncSetAttribute(const void func, hipFuncAttribute attr, int value);
| ^ ~~~~~~~~~~~~~~~~
/home/roundcaky/ktransformers/csrc/custom_marlin/gptq_marlin/gptq_marlin_repack.hip:343:3: error: no matching function for call to 'hipFuncSetAttribute'
343 | CALL_IF(8, true)
| ^~~~~~~~~~~~~~~~
/home/roundcaky/ktransformers/csrc/custom_marlin/gptq_marlin/gptq_marlin_repack.hip:268:7: note: expanded from macro 'CALL_IF'
268 | hipFuncSetAttribute(
| ^~~~~~~~~~~~~~~~~~~
/opt/rocm-6.3.0/lib/llvm/bin/../../../include/hip/hip_runtime_api.h:2262:12: note: candidate function not viable: no overload of 'marlin_repack_kernel' matching 'const void ' for 1st argument
2262 | hipError_t hipFuncSetAttribute(const void func, hipFuncAttribute attr, int value);
| ^ ~~~~~~~~~~~~~~~~
2 warnings and 8 errors generated when compiling for gfx1030.
@roundcaky commented on GitHub (Apr 22, 2025):
实际显卡是MI50,核心是gfx906,不知道为什么error log里显示的是gfx1030