config: delete the dead get_server_args() bindings across the repo (#33888)
This commit is contained in:
@@ -115,7 +115,6 @@ class InklingShortConvAttnBackend(ShortConvAttnBackend):
|
||||
"""Sized from the CONFIGURED capture shapes, once, never reallocated:
|
||||
growing a buffer after a graph captured it moves the address that graph
|
||||
reads, and prefill captures before the decode runner reports its bounds."""
|
||||
server_args = get_server_args()
|
||||
cuda_graph_config = get_exec().graph.cuda_graph_config
|
||||
decode_bs: list[int] = []
|
||||
prefill_tokens: list[int] = []
|
||||
|
||||
@@ -1374,7 +1374,7 @@ def _eplb_remap_enabled() -> bool:
|
||||
from sglang.srt.runtime_context import get_server_args
|
||||
|
||||
try:
|
||||
server_args = get_server_args()
|
||||
get_server_args() # probes that a config is published
|
||||
except ValueError:
|
||||
# Global server args are not initialized outside the server runtime
|
||||
# (e.g. in unit tests that call select_experts directly). In that case
|
||||
|
||||
@@ -3244,7 +3244,6 @@ class ScheduleBatch(ScheduleBatchDisaggregationDecodeMixin):
|
||||
def maybe_evict_swa(self):
|
||||
if self.tree_cache.supports_swa():
|
||||
sliding_window_size = self.tree_cache.sliding_window_size
|
||||
server_args = get_server_args()
|
||||
|
||||
release_leaf_lock = (
|
||||
envs.SGLANG_OPT_SWA_RELEASE_LEAF_LOCK_AFTER_WINDOW.get()
|
||||
|
||||
@@ -21,7 +21,7 @@ from sglang.srt.environ import envs
|
||||
from sglang.srt.mem_cache.base_swa_memory_pool import BaseSWAKVPool
|
||||
from sglang.srt.mem_cache.deepseek_v4_compress_state import CompressStatePool
|
||||
from sglang.srt.mem_cache.memory_pool import KVCache
|
||||
from sglang.srt.runtime_context import get_exec, get_server_args, get_spec
|
||||
from sglang.srt.runtime_context import get_exec, get_spec
|
||||
from sglang.srt.utils import ceil_div, is_hip
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -575,7 +575,6 @@ class DeepSeekV4TokenToKVPool(BaseSWAKVPool):
|
||||
self.swa_kv_pool = None
|
||||
self.c4_kv_pool = None
|
||||
self.c128_kv_pool = None
|
||||
server_args = get_server_args()
|
||||
spec_extra = (
|
||||
(get_spec().speculative_num_draft_tokens - 1)
|
||||
if get_spec().speculative_algorithm is not None
|
||||
@@ -658,7 +657,6 @@ class DeepSeekV4TokenToKVPool(BaseSWAKVPool):
|
||||
self.full_to_swa_index_mapping = full_to_swa_index_mapping
|
||||
|
||||
def get_ring_size(self, compress_ratio: int) -> int:
|
||||
server_args = get_server_args()
|
||||
is_speculative = get_spec().speculative_algorithm is not None
|
||||
return get_compress_state_ring_size(compress_ratio, is_speculative)
|
||||
|
||||
|
||||
@@ -391,9 +391,6 @@ class FlexKVRadixCache(RadixCache):
|
||||
return
|
||||
|
||||
# Compute the committed prefix mirroring LMCRadixCache's logic.
|
||||
from sglang.srt.runtime_context import get_server_args
|
||||
|
||||
global_server_args = get_server_args()
|
||||
topk = get_spec().speculative_eagle_topk
|
||||
enable_kv_committed_len = topk is None or topk == 1
|
||||
if enable_kv_committed_len:
|
||||
|
||||
@@ -16,7 +16,7 @@ from sglang.srt.mem_cache.base_prefix_cache import (
|
||||
MatchResult,
|
||||
)
|
||||
from sglang.srt.mem_cache.radix_cache import RadixCache, RadixKey, TreeNode
|
||||
from sglang.srt.runtime_context import get_memory, get_server_args, get_spec
|
||||
from sglang.srt.runtime_context import get_memory, get_spec
|
||||
from sglang.srt.utils import create_device_stream, device_stream_context
|
||||
|
||||
try:
|
||||
@@ -447,7 +447,6 @@ class LMCRadixCache(RadixCache):
|
||||
self.lmcache_connector.end_session(req.rid)
|
||||
return
|
||||
|
||||
global_server_args = get_server_args()
|
||||
topk = get_spec().speculative_eagle_topk
|
||||
enable_kv_committed_len = topk is None or topk == 1
|
||||
if enable_kv_committed_len:
|
||||
|
||||
@@ -586,7 +586,6 @@ class DefaultModelLoader(BaseModelLoader):
|
||||
hf_weights_files,
|
||||
)
|
||||
elif use_safetensors:
|
||||
server_args = get_server_args()
|
||||
weight_loader_disable_mmap = get_model().weight_loader_disable_mmap
|
||||
weight_loader_prefetch = get_model().weight_loader_prefetch_checkpoints
|
||||
prefetch_num_threads = get_model().weight_loader_prefetch_num_threads
|
||||
|
||||
@@ -69,7 +69,7 @@ from sglang.srt.models.deepseek_common.utils import (
|
||||
_use_aiter_bpreshuffle_gfx95,
|
||||
_use_aiter_gfx95,
|
||||
)
|
||||
from sglang.srt.runtime_context import get_exec, get_parallel, get_server_args
|
||||
from sglang.srt.runtime_context import get_exec, get_parallel
|
||||
from sglang.srt.state_capturer.indexer_topk import (
|
||||
maybe_capture_indexer_topk,
|
||||
)
|
||||
@@ -1280,7 +1280,6 @@ class DeepseekMLAForwardMixin:
|
||||
"""
|
||||
Check if we should skip rope and use fused rope+cache path for TileLang DSA on gfx95.
|
||||
"""
|
||||
server_args = get_server_args()
|
||||
return (
|
||||
_use_aiter_gfx95
|
||||
and self.current_attention_backend in ("dsa", "nsa")
|
||||
|
||||
@@ -954,7 +954,6 @@ class DeepseekV2MoE(nn.Module):
|
||||
has_shared_output = (
|
||||
hidden_states.shape[0] > 0 and self.num_fused_shared_experts == 0
|
||||
)
|
||||
server_args = get_server_args()
|
||||
dispatch_info = (
|
||||
ExpertLocationDispatchInfo.init_new(layer_id=self.layer_id)
|
||||
if get_exec().moe.enable_eplb and not self.is_nextn
|
||||
@@ -1055,7 +1054,6 @@ class DeepseekV2MoE(nn.Module):
|
||||
self.shared_experts.gate_up_proj
|
||||
):
|
||||
return self.forward_cpu(hidden_states)
|
||||
server_args = get_server_args()
|
||||
dispatch_info = (
|
||||
ExpertLocationDispatchInfo.init_new(layer_id=self.layer_id)
|
||||
if get_exec().moe.enable_eplb and not self.is_nextn
|
||||
@@ -2972,7 +2970,6 @@ class DeepseekV2ForCausalLM(nn.Module, DeepseekV2WeightLoaderMixin):
|
||||
self, architecture: str = "DeepseekV3ForCausalLM"
|
||||
):
|
||||
self.num_fused_shared_experts = 0
|
||||
server_args = get_server_args()
|
||||
|
||||
if get_exec().moe.disable_shared_experts_fusion:
|
||||
return
|
||||
|
||||
@@ -43,7 +43,7 @@ from sglang.srt.models.minimax_vl_common import (
|
||||
merge_vit_qkv_weights,
|
||||
)
|
||||
from sglang.srt.models.utils import WeightsMapper
|
||||
from sglang.srt.runtime_context import get_exec, get_mm, get_parallel, get_server_args
|
||||
from sglang.srt.runtime_context import get_exec, get_mm, get_parallel
|
||||
from sglang.srt.utils import add_prefix, get_device_sm, is_cuda, log_info_on_rank0
|
||||
from sglang.srt.utils.hf_transformers_utils import get_rope_config
|
||||
|
||||
@@ -134,7 +134,6 @@ class MiniMaxM3SparseForConditionalGeneration(nn.Module):
|
||||
|
||||
def _determine_num_fused_shared_experts(self) -> None:
|
||||
text_config = self.config.text_config
|
||||
server_args = get_server_args()
|
||||
if get_exec().moe.disable_shared_experts_fusion:
|
||||
return
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ from sglang.srt.constrained.base_grammar_backend import (
|
||||
GrammarMask,
|
||||
GrammarRow,
|
||||
)
|
||||
from sglang.srt.runtime_context import get_exec, get_server_args
|
||||
from sglang.srt.runtime_context import get_exec
|
||||
from sglang.srt.sampling.custom_logit_processor import CustomLogitProcessor
|
||||
from sglang.srt.sampling.penaltylib.repetition_penalty import apply_scaling_penalties
|
||||
from sglang.srt.sampling.sampling_params import TOP_K_ALL
|
||||
@@ -85,7 +85,6 @@ class SamplingBatchInfo:
|
||||
|
||||
@classmethod
|
||||
def from_schedule_batch(cls, batch: ScheduleBatch, vocab_size: int):
|
||||
global_server_args = get_server_args()
|
||||
enable_deterministic = get_exec().deterministic.enable_deterministic_inference
|
||||
|
||||
reqs = batch.reqs
|
||||
|
||||
@@ -21,8 +21,6 @@ class IndexerTopkCapturer(BaseTopkCapturer):
|
||||
max_running_requests: int,
|
||||
device: str,
|
||||
):
|
||||
from sglang.srt.runtime_context import get_server_args
|
||||
|
||||
self.num_indexer_layers = num_indexer_layers
|
||||
self.index_topk = index_topk
|
||||
|
||||
@@ -31,7 +29,6 @@ class IndexerTopkCapturer(BaseTopkCapturer):
|
||||
|
||||
# DP-attention capture is per-rank-local: each rank writes [:local_batch, ...]
|
||||
# to its own device_cache, so the buffer only needs to fit one rank's batch.
|
||||
server_args = get_server_args()
|
||||
max_batch_size = max(get_schedule().chunked_prefill_size, max_running_requests)
|
||||
|
||||
super().__init__(
|
||||
|
||||
@@ -16,7 +16,6 @@ from sglang.srt.runtime_context import (
|
||||
get_exec,
|
||||
get_parallel,
|
||||
get_schedule,
|
||||
get_server_args,
|
||||
)
|
||||
from sglang.srt.state_capturer.base import BaseTopkCapturer
|
||||
|
||||
@@ -40,7 +39,6 @@ class RoutedExpertsCapturer(BaseTopkCapturer):
|
||||
max_running_requests: int,
|
||||
device: str,
|
||||
) -> Optional["RoutedExpertsCapturer"]:
|
||||
server_args = get_server_args()
|
||||
if not get_exec().features.enable_return_routed_experts:
|
||||
return None
|
||||
if not get_exec().moe.disable_shared_experts_fusion and hasattr(
|
||||
|
||||
Reference in New Issue
Block a user