From e01d4acbb1ea559379825072afd7595fd0160d1f Mon Sep 17 00:00:00 2001 From: Andreas Karatzas Date: Tue, 1 Sep 2026 18:04:14 -0500 Subject: [PATCH] [ROCm][CI] Handle tied experts in softplus sqrt top-k test (#52679) Signed-off-by: Andreas Karatzas Signed-off-by: Andreas Karatzas --- tests/kernels/moe/test_topk_softplus_sqrt.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/kernels/moe/test_topk_softplus_sqrt.py b/tests/kernels/moe/test_topk_softplus_sqrt.py index f50d9731e9..47202f482c 100644 --- a/tests/kernels/moe/test_topk_softplus_sqrt.py +++ b/tests/kernels/moe/test_topk_softplus_sqrt.py @@ -277,6 +277,8 @@ def test_fused_topk_softplus_sqrt_padding( indices_dtype = torch.int32 gating_output = torch.randn((num_tokens, num_experts), dtype=dtype, device="cuda") + # Exercise top-k cutoff ties without relying on random low-precision collisions. + gating_output[0] = 0 padding_rows = torch.zeros(num_tokens, dtype=torch.bool, device="cuda") padding_rows[1::2] = True