[ROCm] Enable the aiter top-k/top-p sampler by default (#43331)

Signed-off-by: John Qin <yanyuan.qin@amd.com>
Co-authored-by: TJian <tunjian.tan@embeddedllm.com>
This commit is contained in:
JohnQinAMD
2026-05-28 13:19:59 -05:00
committed by GitHub
co-authored by TJian
parent 5b115bb8a3
commit ed7fe831da
-4
View File
@@ -193,8 +193,6 @@ class TopKTopPSampler(nn.Module):
k: torch.Tensor | None,
p: torch.Tensor | None,
) -> tuple[torch.Tensor, torch.Tensor | None]:
# FIXME: Fix aiter_sampler's accuracy issue and remove this flag
DISABLE_AITER_SAMPLER = True
"""Optimized ROCm/aiter path (same structure as forward_cuda)."""
if (k is None and p is None) or generators:
if generators:
@@ -207,8 +205,6 @@ class TopKTopPSampler(nn.Module):
"processed_logits",
"processed_logprobs",
), "aiter sampler does not support returning logits/logprobs."
if DISABLE_AITER_SAMPLER:
return self.forward_native(logits, generators, k, p)
return self.aiter_sample(logits, k, p, generators), None
def aiter_sample(