ROCm / composable_kernel

Composable Kernel: Performance Portable Programming Model for Machine Learning Tensor Operators
https://rocm.docs.amd.com/projects/composable_kernel/en/latest/
Other
251 stars 102 forks source link

need to add -Wno-nvcc-compt #1330

Closed yxsamliu closed 1 week ago

yxsamliu commented 3 weeks ago

A recent clang change (https://github.com/llvm/llvm-project/pull/77359) caused build failure in composable_kernel:

[2024-06-11T01:46:46.213Z] /jenkins/workspace/compiler-psdb-amd-staging/Libs/composable_kernel/include/ck/utility/f8_utils.hpp:20:23: error: target-attribute based function overloads are not supported by NVCC and will be treated as a function redeclaration:new declaration is __device__ function, old declaration is __host__ function [-Werror,-Wnvcc-compat]
[2024-06-11T01:46:46.213Z] 20 | __device__ inline int clz(uint32_t x) { return __clz(x); }
[2024-06-11T01:46:46.213Z] | ^
[2024-06-11T01:46:46.213Z] /jenkins/workspace/compiler-psdb-amd-staging/Libs/composable_kernel/include/ck/utility/f8_utils.hpp:19:21: note: previous declaration is here
[2024-06-11T01:46:46.213Z] 19 | __host__ inline int clz(uint32_t x) { return __builtin_clz(x); }
[2024-06-11T01:46:46.213Z] | 

This warning is intended for HIP code that is compatible with nvcc (not overloading device/host functions with the same signature) and is off by default. composable_kernel uses overloaded device/host functions with the same signature, therefore has to turn this warning off. Since composable_kernel uses -Weverything, it has to explicitly add -Wno-nvcc-compat to disable this warning.

yxsamliu commented 2 weeks ago

@junliume This is blocking a compiler feature requested by customers. Can some one take a look? Thanks.

bartekxk commented 2 weeks ago

Hi @yxsamliu , could you verify with this PR #1342 ?

aosewski commented 2 weeks ago

@yxsamliu any update? Does it work now?

yxsamliu commented 2 weeks ago

I will try it and get back to you. thanks

yxsamliu commented 2 weeks ago

I can verify the PR fixes the issue.

bartekxk commented 2 weeks ago

Hi @yxsamliu I built llvm-project and Im able to reproduce this bug. I will try to resolve them.

aosewski commented 1 week ago

Fix merged into develop:https://github.com/ROCm/composable_kernel/pull/1342