daquexian / faster-rwkv

123 stars 11 forks source link

编译错误:error: more than one conversion function from "half" to a built-in type applies #26

Closed Wanglongzhi2001 closed 1 year ago

Wanglongzhi2001 commented 1 year ago

6 errors detected in the compilation of "/root/Dev/MyPR/faster-rwkv/kernels/cuda/layer_norm.cu". [118/286] Building CUDA object CMakeFiles/faster_rwkv_internal.dir/kernels/cuda/cat.cu.o ninja: build stopped: subcommand failed.


- OS: WSL2(Ubuntu 20.04)
- cmake version: 3.27.0
- cmake 命令: `cmake -DFR_ENABLE_CUDA=ON -DCMAKE_BUILD_TYPE=Release -GNinja ..`
Wanglongzhi2001 commented 1 year ago

请问是我这边的问题嘛?回退到前几个 commit 的版本依旧编译报错

AsakusaRinne commented 1 year ago

master分支有一个被## ===================== A solution for compiling error of half caused by low cuda arch detected =======================包裹的几行代码,把那几行取消掉注释可以解决这个问题,即以下代码:

# include(FindCUDA/select_compute_arch)
# CUDA_DETECT_INSTALLED_GPUS(INSTALLED_GPU_CCS_1)
# string(STRIP "${INSTALLED_GPU_CCS_1}" INSTALLED_GPU_CCS_2)
# string(REPLACE " " "\;" INSTALLED_GPU_CCS_3 "${INSTALLED_GPU_CCS_2}")
# string(REPLACE "." "" CUDA_ARCH_LIST "${INSTALLED_GPU_CCS_3}")
# STRING(FIND "${CUDA_ARCH_LIST}" "\;" LAST_SEMICOLON_INDEX REVERSE)
# math(EXPR SPLIT_START_INDEX "${LAST_SEMICOLON_INDEX} + 1")
# STRING(SUBSTRING "${CUDA_ARCH_LIST}" ${SPLIT_START_INDEX} -1 FILTERED_CUDA_ARCH_LIST)
# set(CMAKE_CUDA_ARCHITECTURES ${FILTERED_CUDA_ARCH_LIST})
Wanglongzhi2001 commented 1 year ago

master分支有一个被## ===================== A solution for compiling error of half caused by low cuda arch detected =======================包裹的几行代码,把那几行取消掉注释可以解决这个问题,即以下代码:

# include(FindCUDA/select_compute_arch)
# CUDA_DETECT_INSTALLED_GPUS(INSTALLED_GPU_CCS_1)
# string(STRIP "${INSTALLED_GPU_CCS_1}" INSTALLED_GPU_CCS_2)
# string(REPLACE " " "\;" INSTALLED_GPU_CCS_3 "${INSTALLED_GPU_CCS_2}")
# string(REPLACE "." "" CUDA_ARCH_LIST "${INSTALLED_GPU_CCS_3}")
# STRING(FIND "${CUDA_ARCH_LIST}" "\;" LAST_SEMICOLON_INDEX REVERSE)
# math(EXPR SPLIT_START_INDEX "${LAST_SEMICOLON_INDEX} + 1")
# STRING(SUBSTRING "${CUDA_ARCH_LIST}" ${SPLIT_START_INDEX} -1 FILTERED_CUDA_ARCH_LIST)
# set(CMAKE_CUDA_ARCHITECTURES ${FILTERED_CUDA_ARCH_LIST})

谢谢,已解决~

daquexian commented 1 year ago

最新的 commit 修复了这个问题~ 不取消那几行代码的注释也不会编译错误了

Wanglongzhi2001 commented 1 year ago

最新的 commit 修复了这个问题~ 不取消那几行代码的注释也不会编译错误了

好的,我拉取下最新的代码

daquexian commented 1 year ago

最新的 commit 修复了这个问题~ 不取消那几行代码的注释也不会编译错误了

好的,我拉取下最新的代码

好的,有任何问题都可以继续提出!