From 4975bd0c8e17a54bdc27c746527a385e7383bb07 Mon Sep 17 00:00:00 2001 From: Harkirat Gill <170955491+harkgill-amd@users.noreply.github.com> Date: Fri, 10 Jul 2026 12:22:23 +0000 Subject: [PATCH] [rocm-libraries] ROCm/rocm-libraries#9232 (commit 2d25e39) fix: guard arg.Print() in WMMA bwd data grouped conv with log level check (#9232) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Motivation Resolves https://github.com/ROCm/ROCm/issues/6403. ## Technical Details Stray `arg.Print()` was causing a flood of debug lines when running a torch reproducer that triggers backward-data WMMA grouped-conv path on gfx1151. For example, ``` a_grid_desc_m_ak_container{7744, 7520} b_grid_desc_n_bk_container_{64, 7520} e_grid_desc_mblock_mperblock_nblock_nperblock_container_{7744, 64} a_grid_desc_m_ak_container_{7808, 5024} b_grid_desc_n_bk_container_{128, 5024} e_grid_desc_mblock_mperblock_nblock_nperblock_container_{7808, 128} ``` Guarded the `arg.Print()` with a log level check `stream_config.log_level_ > 0`, matching the logic found in other ``arg.Print()`` statements, [ref](https://github.com/ROCm/rocm-libraries/blob/develop/projects/composablekernel/include/ck/tensor_operation/gpu/device/impl/device_grouped_conv_bwd_data_multiple_d_wmma_cshuffle_v3.hpp#L1311-L1314). ## Test Plan Compile example (`example/38_grouped_conv_bwd_data_multiple_d/grouped_conv_bwd_data_wmma_v3_fp16.cpp`) and run binary against both patched and unpatched header. Check output to see that debug logging is no longer present with patched version. ## Test Result Unpatched output (flood present): ``` out: dim 5, lengths {32, 4, 192, 28, 28}, strides {602112, 150528, 1, 5376, 192} wei: dim 5, lengths {32, 192, 192, 3, 3}, strides {331776, 1728, 1, 576, 192} in: dim 5, lengths {32, 4, 192, 28, 28}, strides {602112, 150528, 1, 5376, 192} a_grid_desc_m_ak_container_{3136, 1728} b_grid_desc_n_bk_container_{192, 1728} e_grid_desc_mblock_mperblock_nblock_nperblock_container_{3136, 192} Perf: 0 ms, inf TFlops, inf GB/s ``` Patched output (flood gone, conv still runs): ``` out: dim 5, lengths {32, 4, 192, 28, 28}, strides {602112, 150528, 1, 5376, 192} wei: dim 5, lengths {32, 192, 192, 3, 3}, strides {331776, 1728, 1, 576, 192} in: dim 5, lengths {32, 4, 192, 28, 28}, strides {602112, 150528, 1, 5376, 192} Perf: 0 ms, inf TFlops, inf GB/s ``` ## Submission Checklist - [X] Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests. --- ...ice_grouped_conv_bwd_data_multiple_d_wmma_cshuffle_v3.hpp | 5 ++++- .../grouped_convnd_bwd_data/test_grouped_convnd_bwd_data.cpp | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/ck/tensor_operation/gpu/device/impl/device_grouped_conv_bwd_data_multiple_d_wmma_cshuffle_v3.hpp b/include/ck/tensor_operation/gpu/device/impl/device_grouped_conv_bwd_data_multiple_d_wmma_cshuffle_v3.hpp index 8dbbf1aa06..2dd802e8ae 100644 --- a/include/ck/tensor_operation/gpu/device/impl/device_grouped_conv_bwd_data_multiple_d_wmma_cshuffle_v3.hpp +++ b/include/ck/tensor_operation/gpu/device/impl/device_grouped_conv_bwd_data_multiple_d_wmma_cshuffle_v3.hpp @@ -1402,7 +1402,10 @@ struct DeviceGroupedConvBwdDataMultipleD_Wmma_CShuffleV3 ave_time += RunMultiDGemm(arg, stream_config); } - arg.Print(); + if(stream_config.log_level_ > 0) + { + arg.Print(); + } // Transpose from NHWGC to NGCHW if constexpr(NeedTransposeKernel) diff --git a/test/grouped_convnd_bwd_data/test_grouped_convnd_bwd_data.cpp b/test/grouped_convnd_bwd_data/test_grouped_convnd_bwd_data.cpp index 998e114572..41b020c7aa 100644 --- a/test/grouped_convnd_bwd_data/test_grouped_convnd_bwd_data.cpp +++ b/test/grouped_convnd_bwd_data/test_grouped_convnd_bwd_data.cpp @@ -139,7 +139,6 @@ TYPED_TEST(TestGroupedConvndBwdData2d, Test2D) this->conv_params.push_back({2, 1, 1, 1, 32, {8, 8}, {16, 16}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}); this->conv_params.push_back({2, 1, 1, 64, 3, {8, 8}, {16, 16}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}); this->conv_params.push_back({2, 1, 1, 1, 1, {8, 8}, {16, 16}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}); - // G=1, stride>1, 2D, no D-tensors. gemms_count in {4, 9, 36}. this->conv_params.push_back( {2, 1, 16, 256, 128, {5, 5}, {40, 175}, {2, 2}, {1, 1}, {1, 1}, {1, 1}});