[bugfix] fix qwen3-next alt_stream none issue (#17016)

This commit is contained in:
billishyahao
2026-01-16 22:40:25 +08:00
committed by GitHub
parent c771933dc5
commit 6f10e17b4a

View File

@@ -358,7 +358,11 @@ class Qwen3GatedDeltaNet(nn.Module):
DUAL_STREAM_TOKEN_THRESHOLD = 1024
seq_len, _ = hidden_states.shape
if seq_len < DUAL_STREAM_TOKEN_THRESHOLD:
if (
seq_len < DUAL_STREAM_TOKEN_THRESHOLD
and self.alt_stream is not None
and get_is_capture_mode()
):
current_stream = torch.cuda.current_stream()
self.alt_stream.wait_stream(current_stream)
projected_states_qkvz, _ = self.in_proj_qkvz(hidden_states)