Skip to content
Merged
Changes from all 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
4 changes: 2 additions & 2 deletions python/sglang/srt/layers/flashinfer_comm_fusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def cleanup(self):


def ensure_workspace_initialized(
max_token_num: int = 2048, hidden_dim: int = 4096, use_fp32_lamport: bool = False
max_token_num: int = 16384, hidden_dim: int = 4096, use_fp32_lamport: bool = False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The default value for max_token_num (16384) is used in this function, flashinfer_allreduce_residual_rmsnorm, and fake_flashinfer_allreduce_residual_rmsnorm. To improve maintainability and avoid magic numbers, consider defining this value as a module-level constant (e.g., _DEFAULT_MAX_TOKEN_NUM = 16384) and using this constant in all three function definitions.

):
"""Ensure workspace is initialized"""
if not is_flashinfer_available() or _flashinfer_comm is None:
Expand Down Expand Up @@ -128,7 +128,7 @@ def flashinfer_allreduce_residual_rmsnorm(
residual: torch.Tensor,
weight: torch.Tensor,
eps: float = 1e-6,
max_token_num: int = 2048,
max_token_num: int = 16384,
use_oneshot: Optional[bool] = None,
trigger_completion_at_end: bool = False,
fp32_acc: bool = False,
Expand Down
Loading