Depreate global_server_args_dict (#11528)
This commit is contained in:
@@ -40,8 +40,9 @@ from sglang.srt.layers.moe import (
|
||||
get_moe_a2a_backend,
|
||||
should_use_flashinfer_cutlass_moe_fp4_allgather,
|
||||
)
|
||||
from sglang.srt.managers.schedule_batch import global_server_args_dict
|
||||
from sglang.srt.model_executor.forward_batch_info import ForwardBatch
|
||||
from sglang.srt.server_args import get_global_server_args
|
||||
from sglang.srt.speculative.spec_info import SpeculativeAlgorithm
|
||||
from sglang.srt.utils import (
|
||||
get_bool_env_var,
|
||||
is_cuda,
|
||||
@@ -168,7 +169,7 @@ class LayerScatterModes:
|
||||
|
||||
|
||||
def enable_moe_dense_fully_dp():
|
||||
return global_server_args_dict["moe_dense_tp_size"] == 1
|
||||
return get_global_server_args().moe_dense_tp_size == 1
|
||||
|
||||
|
||||
class LayerCommunicator:
|
||||
@@ -314,7 +315,9 @@ class LayerCommunicator:
|
||||
def should_fuse_mlp_allreduce_with_next_layer(
|
||||
self, forward_batch: ForwardBatch
|
||||
) -> bool:
|
||||
speculative_algo = global_server_args_dict.get("speculative_algorithm", None)
|
||||
speculative_algo = SpeculativeAlgorithm.from_string(
|
||||
get_global_server_args().speculative_algorithm
|
||||
)
|
||||
if (
|
||||
is_dp_attention_enabled()
|
||||
and speculative_algo is not None
|
||||
@@ -333,7 +336,7 @@ class LayerCommunicator:
|
||||
static_conditions_met = (
|
||||
(not self.is_last_layer)
|
||||
and (self._context.tp_size > 1)
|
||||
and global_server_args_dict.get("enable_flashinfer_allreduce_fusion", False)
|
||||
and get_global_server_args().enable_flashinfer_allreduce_fusion
|
||||
and _is_flashinfer_available
|
||||
)
|
||||
|
||||
@@ -531,7 +534,7 @@ class CommunicateWithAllReduceAndLayerNormFn:
|
||||
(_is_sm100_supported or _is_sm90_supported)
|
||||
and _is_flashinfer_available
|
||||
and hasattr(layernorm, "forward_with_allreduce_fusion")
|
||||
and global_server_args_dict["enable_flashinfer_allreduce_fusion"]
|
||||
and get_global_server_args().enable_flashinfer_allreduce_fusion
|
||||
and hidden_states.shape[0] <= 4096
|
||||
):
|
||||
hidden_states, residual = layernorm.forward_with_allreduce_fusion(
|
||||
|
||||
Reference in New Issue
Block a user