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
308 stars 125 forks source link

INSTANCES_ONLY=ON quietly override target list and cause issues #1459

Open junliume opened 2 months ago

junliume commented 2 months ago

composable_kernel/library/src/tensor_operation_instance/gpu/CMakeLists.txt at amd-develop · ROCm/composable_kernel (github.com)

Do not build mha instances if gfx94 targets are not on the target list

However, if one uses:

CXX=/opt/rocm/bin/amdclang++ cmake -DGPU_TARGETS="gfx1100" -DCMAKE_PREFIX_PATH=/opt/rocm -DCMAKE_BUILD_TYPE=Release -DINSTANCES_ONLY=ON ..

-DINSTANCES_ONLY=ON is overriding the target list to default

Should we revisit the behavior of INSTANCES_ONLY=ON? This is not the first time when CK tries to differentiate between GPU_TARGETS while INSTANCES_ONLY=ON gives us uninformed surprises.

illsilin commented 2 months ago

The INSTANCES_ONLY build argument had been re-purposed about a year ago from "do not build tests and examples" to "build the library for all supported targets". As such, it is not compatible with the "GPU_TARGETS" build argument anymore.

If you want to continue using it in its old role, we just need to create a new build argument that would provide the current functionality of the INSTANCES_ONLY.

junliume commented 2 months ago

As discussed with @illsilin these lists need to be updated

https://github.com/ROCm/composable_kernel/blob/ab60b390f892052cee5ccbd68464caecec6981d9/library/src/tensor_operation_instance/gpu/CMakeLists.txt#L83-L88