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
318 stars 129 forks source link

[Issue]: Error linking ckProfiler #1581

Open RandUser123sa opened 1 month ago

RandUser123sa commented 1 month ago

Problem Description

Hello, I'm unable to compile the composable_kernel on my favorite OS. Composable kernel version 6.2.2 and probably 6.2.1 did not compile, version 6.2.0 worked. Here is my configure params: cmake \ -Wno-dev \ -D CMAKE_HIP_COMPILER_ROCM_LIB=/opt/rocm/lib \ -D HIP_LANG=/opt/rocm/lib64 \ -D CMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc \ -D CMAKE_BUILD_TYPE=Release \ -D CMAKE_INSTALL_PREFIX=/opt/rocm \ -D CMAKE_HIP_ARCHITECTURES="gfx900;gfx906:xnack-;gfx908:xnack-;gfx90a:xnack+;gfx90a:xnack-;gfx940;gfx941;gfx942;gfx1010;gfx1012;gfx1030;gfx1100;gfx1101;gfx1102" \ -D BUILD_DEV=OFF \ -D BUILD_TESTING=OFF \ -D USE_OPT_GFX11=ON \ -G Ninja ..

and the error is receiving when the compilation process link ckProfiler. The same error with Ninja or without it. The error is: [380/384] Linking CXX executable bin/ckProfiler FAILED: bin/ckProfiler

-o bin/ckProfiler -Wl,-rpath,::::::::::::::::::::::::::::::::::::::::::::::::::: lib/libutility.a /opt/rocm/lib64/libamdhip64.so.6.2.41134 --hip-link --offload-arch=gfx1100 /opt/rocm/lib/llvm/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a && : ld.lld: error: undefined symbol: ck::tensor_operation::device::instance::add_device_grouped_conv1d_bwd_weight_xdl_gnwc_gkxc_gnwk_f32_instances(std::vector<std::unique_ptr<ck::tensor_operation::device::DeviceGroupedConvBwdWeight<1, ck::tensor_layout::convolution::GNWC, ck::tensor_layout::convolution::GKXC, ck::tensor_layout::convolution::GNWK, float, float, float, ck::tensor_operation::element_wise::PassThrough, ck::tensor_operation::element_wise::PassThrough, ck::tensor_operation::element_wise::PassThrough, float, float>, std::default_delete<ck::tensor_operation::device::DeviceGroupedConvBwdWeight<1, ck::tensor_layout::convolution::GNWC, ck::tensor_layout::convolution::GKXC, ck::tensor_layout::convolution::GNWK, float, float, float, ck::tensor_operation::element_wise::PassThrough, ck::tensor_operation::element_wise::PassThrough, ck::tensor_operation::element_wise::PassThrough, float, float>>>, std::allocator<std::unique_ptr<ck::tensor_operation::device::DeviceGroupedConvBwdWeight<1, ck::tensor_layout::convolution::GNWC, ck::tensor_layout::convolution::GKXC, ck::tensor_layout::convolution::GNWK, float, float, float, ck::tensor_operation::element_wise::PassThrough, ck::tensor_operation::element_wise::PassThrough, ck::tensor_operation::element_wise::PassThrough, float, float>, std::default_delete<ck::tensor_operation::device::DeviceGroupedConvBwdWeight<1, ck::tensor_layout::convolution::GNWC, ck::tensor_layout::convolution::GKXC, ck::tensor_layout::convolution::GNWK, float, float, float, ck::tensor_operation::element_wise::PassThrough, ck::tensor_operation::element_wise::PassThrough, ck::tensor_operation::element_wise::PassThrough, float, float>>>>>&)

referenced by profile_grouped_conv_bwd_weight.cpp profiler/src/CMakeFiles/ckProfiler.dir/profile_grouped_conv_bwd_weight.cpp.o:(bool ck::profiler::profile_grouped_conv_bwd_weight_impl<1, ck::tensor_layout::convolution::GNWC, ck::tensor_layout::convolution::GKXC, ck::tensor_layout::convolution::GNWK, float, float, float, float, float>(int, int, bool, bool, ck::utils::conv::ConvParam const&, int))

Operating System

Slackware 15.0 x86_64

CPU

AMD Ryzen 7 3800X 8-Core Processor

GPU

AMD Radeon RX 7900 XT

Other

No response

ROCm Version

ROCm 6.0.0

ROCm Component

No response

Steps to Reproduce

No response

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

No response

Additional Information

error.log

schung-amd commented 3 weeks ago

Hi @RandUser123sa, can you provide some more info on your problem and configuration?

RandUser123sa commented 2 weeks ago

Hi @schung-amd,

I'm not using docker. The error occurring when running ninja or make (the same error), the cmake process does not generate errors. I'm compiling all the required packages on Slackware. I'm using release package: https://github.com/ROCm/composable_kernel/archive/rocm-6.2.2.tar.gz

illsilin commented 2 weeks ago

Do you really need all those architectures? If you do, please use -DGPU_ARCHS build flag to set them.

schung-amd commented 1 week ago

In addition to using -DGPU_ARCHS (or -DGPU_TARGETS if your target architectures are similar) instead of -DCMAKE_HIP_ARCHITECTURES (which I don't think does anything here) I recommend trying this in a Docker as suggested by the README, as well as building the develop branch rather than one of the release packages and seeing if that builds.