From 6af7d029b95111836f4909928568ec089ca178a2 Mon Sep 17 00:00:00 2001 From: "tanqingquan.tqq" Date: Wed, 12 Aug 2026 15:07:00 +0800 Subject: [PATCH] fix(sm90_mega_moe): disambiguate chained member-template-id with .template on nvcc13 On nvcc 13.x (EDG frontend), the chained call (*l1_topk_weights_buffer).get_data_buffer(idx).get_base_ptr() fails to compile inside the deferred/dependent scope of the SM90 MegaMoE epilogue, with: error: type name is not allowed error: expected an expression because EDG parses the unqualified '<' as the less-than operator instead of the start of an explicit template-argument list. Add the standard dependent-name disambiguator `.template` to the four chained `.get_data_buffer(...).get_base_ptr()` call sites in sm90_fp8_mega_moe_impl() that are reported by nvcc13 (L1655/L1666/L1824/L1827). Behavior is unchanged on nvcc <= 12 where `.template` is a no-op when not strictly required, so this is a pure compile-fix. --- deep_gemm/include/deep_gemm/impls/sm90_fp8_mega_moe.cuh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deep_gemm/include/deep_gemm/impls/sm90_fp8_mega_moe.cuh b/deep_gemm/include/deep_gemm/impls/sm90_fp8_mega_moe.cuh index 222908412e..37dc89f273 100644 --- a/deep_gemm/include/deep_gemm/impls/sm90_fp8_mega_moe.cuh +++ b/deep_gemm/include/deep_gemm/impls/sm90_fp8_mega_moe.cuh @@ -1652,7 +1652,7 @@ sm90_fp8_mega_moe_impl(void* y, clamp_up(u0); const float weight_0 = *l1_topk_weights_buffer .get_data_buffer(m_idx + token_0) - .get_base_ptr(); + .template get_base_ptr(); smem_cd_swap_l1_fp32[token_0 * L1_OUT_BLOCK_N + out_col_base] = silu(g0) * u0 * weight_0; } @@ -1663,7 +1663,7 @@ sm90_fp8_mega_moe_impl(void* y, clamp_up(u1); const float weight_1 = *l1_topk_weights_buffer .get_data_buffer(m_idx + token_1) - .get_base_ptr(); + .template get_base_ptr(); smem_cd_swap_l1_fp32[token_1 * L1_OUT_BLOCK_N + out_col_base] = silu(g1) * u1 * weight_1; } @@ -1821,10 +1821,10 @@ sm90_fp8_mega_moe_impl(void* y, // Apply token weight: SwiGLU * topk_weight (single load per row) const float weight_r0 = valid_r0 ? *l1_topk_weights_buffer .get_data_buffer(m_idx + row_offset_r0) - .get_base_ptr() : 0.0f; + .template get_base_ptr() : 0.0f; const float weight_r1 = valid_r1 ? *l1_topk_weights_buffer .get_data_buffer(m_idx + row_offset_r1) - .get_base_ptr() : 0.0f; + .template get_base_ptr() : 0.0f; #pragma unroll for (uint32_t p = 0; p < kNumPairs; ++ p) { swiglu_r0[p][0] *= weight_r0;