Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions python/sglang/srt/models/qwen3_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
_is_gfx95 = is_gfx95_supported()
_is_hip = is_hip()
_use_aiter = get_bool_env_var("SGLANG_USE_AITER") and _is_hip
_hip_use_alt_stream = get_bool_env_var("SGLANG_HIP_ALT_STREAM") and _is_hip
Comment thread
At1a8 marked this conversation as resolved.
Resolved
_is_amx_available = cpu_has_amx_support()

cached_get_processor = lru_cache(get_processor)
Expand Down Expand Up @@ -814,7 +815,7 @@ def _apply_qk_norm(
self, q: torch.Tensor, k: torch.Tensor
) -> Tuple[torch.Tensor, torch.Tensor]:
"""Apply Q/K normalization with optional alt_stream overlap."""
if self.alt_stream is not None and get_is_capture_mode():
if self.alt_stream is not None and get_is_capture_mode() and get_bool_env_var("SGLANG_QK_NORM_ALT_STREAM", "True"):
Comment thread
At1a8 marked this conversation as resolved.
Resolved
current_stream = torch.cuda.current_stream()
self.alt_stream.wait_stream(current_stream)
q_by_head = q.reshape(-1, self.head_dim)
Expand Down Expand Up @@ -1019,7 +1020,7 @@ def __init__(
self.hidden_size = config.hidden_size
self.pp_group = get_pp_group()

alt_stream = torch.cuda.Stream() if _is_cuda else None
alt_stream = torch.cuda.Stream() if _is_cuda or _hip_use_alt_stream else None

# Embedding layer
if self.pp_group.is_first_rank:
Expand Down
Loading