From 0eee2d3392801c9d7ed022a07819e3fca378c313 Mon Sep 17 00:00:00 2001 From: "Graner, Johannes" Date: Wed, 28 Jan 2026 09:18:03 -0500 Subject: [PATCH] Fix threshold calculation --- .../profiler/profile_grouped_conv_bwd_weight_impl.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/profiler/include/profiler/profile_grouped_conv_bwd_weight_impl.hpp b/profiler/include/profiler/profile_grouped_conv_bwd_weight_impl.hpp index 078bc51077..afc88150ed 100644 --- a/profiler/include/profiler/profile_grouped_conv_bwd_weight_impl.hpp +++ b/profiler/include/profiler/profile_grouped_conv_bwd_weight_impl.hpp @@ -366,6 +366,11 @@ bool profile_grouped_conv_bwd_weight_impl(int do_verification, const index_t num_accums = output.GetElementSize() / conv_param.K_; const index_t num_accums_split_k = split_k_value; + // Get maximum accumulated value from reference + const std::size_t tensor_size = + weight_device_result.mDesc.GetElementSpaceSize(); + max_accumulated_value = + gpu_reduce_max(gpu_ref_wei_buf.GetDeviceBuffer(), tensor_size); // Calculate thresholds auto rtol = ck::utils::get_relative_threshold( @@ -385,9 +390,7 @@ bool profile_grouped_conv_bwd_weight_impl(int do_verification, rtol = std::max(rtol, rtol_split_k); atol = std::max(atol, atol_split_k); - // Perform GPU verification (max value computed internally on GPU) - const std::size_t tensor_size = - weight_device_result.mDesc.GetElementSpaceSize(); + // Perform GPU verification auto gpu_result = ck::profiler::gpu_verify(wei_device_buf.GetDeviceBuffer(), gpu_ref_wei_buf.GetDeviceBuffer(),