[AMD][Fix] Qwen3.5: make empty-batch guard tuple-aware on fused AR+quant path (#35341)

This commit is contained in:
Bingxu Chen
2026-08-28 01:11:53 -07:00
committed by GitHub
parent 2a7fb511c9
commit 0c7d017dbb
+6 -2
View File
@@ -891,7 +891,9 @@ class Qwen3_5LinearDecoderLayer(nn.Module):
)
)
if not forward_batch.forward_mode.is_idle() and hidden_states.shape[0] > 0:
# fused AR+quant hands down a (fp8, scale) / (bf16, fp8, scale) tuple
hs = hidden_states[0] if isinstance(hidden_states, tuple) else hidden_states
if not forward_batch.forward_mode.is_idle() and hs.shape[0] > 0:
hidden_states = self.linear_attn(
hidden_states,
forward_batch,
@@ -1295,7 +1297,9 @@ class Qwen3_5AttentionDecoderLayer(nn.Module):
)
)
if not forward_batch.forward_mode.is_idle() and hidden_states.shape[0] > 0:
# fused AR+quant hands down a (fp8, scale) / (bf16, fp8, scale) tuple
hs = hidden_states[0] if isinstance(hidden_states, tuple) else hidden_states
if not forward_batch.forward_mode.is_idle() and hs.shape[0] > 0:
hidden_states = self.self_attention(
positions=positions,
hidden_states=hidden_states,