composable_kernel icon indicating copy to clipboard operation
composable_kernel copied to clipboard

Compile error in cpp_extension

Open rocking5566 opened this issue 9 months ago • 0 comments

Problem Description

This issue happen in cpp_extension. I use pytorch's cpp_extension to compile the CK instead of regular cmake.

When we cast from __half to _Float16 if to compile the ck Error message is as follow

In file included from /work/flash-attention/csrc/composable_kernel/include/ck_tile/core/utility/random.hpp:7: /work/flash-attention/csrc/composable_kernel/include/ck_tile/core/numeric/half.hpp:132:12: error: no viable conversion from returned value of type '__half' to function return type 'fp16_hip_t' (aka '_Float16') return __float2half(x); ^~~~~~~~~~~~~~~ /opt/rocm-6.0.0/include/hip/amd_detail/amd_hip_fp16.h:235:13: note: candidate function operator __half_raw() const { return __half_raw{data}; } ^ /opt/rocm-6.0.0/include/hip/amd_detail/amd_hip_fp16.h:237:13: note: candidate function operator __half_raw() const volatile ^

Operating System

Ubuntu

CPU

Intel(R) Xeon(R) Platinum 8480C

GPU

AMD Instinct MI300X

Other

No response

ROCm Version

ROCm 6.0.0

ROCm Component

Composable Kernel

Steps to Reproduce

No response

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support

No response

Additional Information

Solution is as follow https://github.com/ROCm/composable_kernel/pull/1292

rocking5566 avatar May 17 '24 09:05 rocking5566