From 5fbad9e7b55b256cc485e2d429245ef6d8fb1949 Mon Sep 17 00:00:00 2001 From: JiaLuo-CAN Date: Tue, 18 Aug 2026 12:24:37 -0400 Subject: [PATCH 1/2] workaround for CI: change static assert for ActivationOperation to warnings --- .../grid/gridwise_moe_mx_gemm_bpreshuffle.hpp | 42 ++++++++++++++----- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/projects/composablekernel/include/ck/tensor_operation/gpu/grid/gridwise_moe_mx_gemm_bpreshuffle.hpp b/projects/composablekernel/include/ck/tensor_operation/gpu/grid/gridwise_moe_mx_gemm_bpreshuffle.hpp index 9b2bd6536435..7d98ce8a8e55 100644 --- a/projects/composablekernel/include/ck/tensor_operation/gpu/grid/gridwise_moe_mx_gemm_bpreshuffle.hpp +++ b/projects/composablekernel/include/ck/tensor_operation/gpu/grid/gridwise_moe_mx_gemm_bpreshuffle.hpp @@ -27,6 +27,28 @@ namespace ck { +namespace detail { +// Downgrades the unsupported-activation check from a hard error to a diagnostic so callers that +// request an unimplemented activation still build. Instantiating the false specialization emits +// -Wdeprecated-declarations at the call site. +template +struct moe_mx_bpreshuffle_activation_support +{ + __host__ __device__ static constexpr void check() {} +}; + +template <> +struct moe_mx_bpreshuffle_activation_support +{ + [[deprecated("gridwise_moe_mx_gemm_bpreshuffle: requested activation is not implemented; " + "stage-1 output is left unwritten and results will be wrong")]] __host__ __device__ + static constexpr void + check() + { + } +}; +} // namespace detail + // Currently we do not have a elegant way to put single lds buffer & double lds buffer pipe in same // kernel function Blockers: // 1. Two separted declaration of __shared__ pointer is the key to make sure data access operate on @@ -1240,11 +1262,11 @@ struct GridwiseMoeGemmMX_BPreshuffle CElementwiseOperation c_element_op) { static_assert(KPackPerGroup == BlockwiseGemmPipe::KThreadChunk); - static_assert(ActivationOperation == Activation::gelu_and_mul || - ActivationOperation == Activation::silu_and_mul || - ActivationOperation == Activation::gelu_tanh_and_mul, - "gridwise_moe_mx_gemm_bpreshuffle only supports gelu_and_mul, silu_and_mul " - "and gelu_tanh_and_mul."); + // Only stage-1 consumes ActivationOperation, so stage-2 instances stay silent. + detail::moe_mx_bpreshuffle_activation_support< + !IsInputGemm || ActivationOperation == Activation::gelu_and_mul || + ActivationOperation == Activation::silu_and_mul || + ActivationOperation == Activation::gelu_tanh_and_mul>::check(); ignore = a_element_op; ignore = b_element_op; index_t BN0Shuffled = CalculateBN0Shuffled(problem.N); @@ -1757,11 +1779,11 @@ struct GridwiseMoeGemmMX_BPreshuffle CElementwiseOperation c_element_op) { static_assert(KPackPerGroup == BlockwiseGemmPipe::KThreadChunk); - static_assert(ActivationOperation == Activation::gelu_and_mul || - ActivationOperation == Activation::silu_and_mul || - ActivationOperation == Activation::gelu_tanh_and_mul, - "gridwise_moe_mx_gemm_bpreshuffle only supports gelu_and_mul, silu_and_mul " - "and gelu_tanh_and_mul."); + // Only stage-1 consumes ActivationOperation, so stage-2 instances stay silent. + detail::moe_mx_bpreshuffle_activation_support< + !IsInputGemm || ActivationOperation == Activation::gelu_and_mul || + ActivationOperation == Activation::silu_and_mul || + ActivationOperation == Activation::gelu_tanh_and_mul>::check(); ignore = a_element_op; ignore = b_element_op; index_t BN0Shuffled = CalculateBN0Shuffled(problem.N); From 11c394340681671bed306b821c989bb7ede62888 Mon Sep 17 00:00:00 2001 From: JiaLuo-CAN Date: Tue, 18 Aug 2026 12:43:35 -0400 Subject: [PATCH 2/2] clang format fix --- .../gpu/grid/gridwise_moe_mx_gemm_bpreshuffle.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/composablekernel/include/ck/tensor_operation/gpu/grid/gridwise_moe_mx_gemm_bpreshuffle.hpp b/projects/composablekernel/include/ck/tensor_operation/gpu/grid/gridwise_moe_mx_gemm_bpreshuffle.hpp index 7d98ce8a8e55..7dad30e91b39 100644 --- a/projects/composablekernel/include/ck/tensor_operation/gpu/grid/gridwise_moe_mx_gemm_bpreshuffle.hpp +++ b/projects/composablekernel/include/ck/tensor_operation/gpu/grid/gridwise_moe_mx_gemm_bpreshuffle.hpp @@ -41,9 +41,9 @@ template <> struct moe_mx_bpreshuffle_activation_support { [[deprecated("gridwise_moe_mx_gemm_bpreshuffle: requested activation is not implemented; " - "stage-1 output is left unwritten and results will be wrong")]] __host__ __device__ - static constexpr void - check() + "stage-1 output is left unwritten and results will be wrong")]] __host__ + __device__ static constexpr void + check() { } };