[AMD][Fix] Qwen3.5: guard zero-grid launch in fused_qk_gemma_rmsnorm(_with_gate) (HIP invalid configuration on idle DP rank) (#31794)

This commit is contained in:
jacky.cheng
2026-08-15 21:02:54 -07:00
committed by GitHub
parent 0f706c33d2
commit 6314e9e4f5
5 changed files with 27 additions and 2 deletions
+4
View File
@@ -45,6 +45,7 @@ if is_musa():
top_p_renorm_prob,
)
_is_hip = is_hip()
_use_aiter = get_bool_env_var("SGLANG_USE_AITER") and is_hip()
if _use_aiter:
from aiter import greedy_sample as _aiter_greedy_sample
@@ -119,6 +120,9 @@ class Sampler(nn.Module):
"""
logits = logits_output.next_token_logits
if _is_hip and logits.shape[0] == 0:
return torch.empty((0,), dtype=torch.int64, device=logits.device)
# Preprocess logits (custom processors and NaN handling)
logits = self._preprocess_logits(logits, sampling_info)
return_sampling_mask = any(sampling_info.return_sampling_masks or [])