Revert RuntimeContext config-namespace reads/roles (#31813–#31817) (#32100)

This commit is contained in:
Cheng Wan
2026-07-22 11:52:41 -07:00
committed by GitHub
parent 0bdd4730af
commit f5dcbe8f14
187 changed files with 1432 additions and 1441 deletions
+3 -3
View File
@@ -16,7 +16,7 @@ from sglang.srt.eplb.expert_location import (
get_global_expert_location_metadata,
)
from sglang.srt.eplb.expert_location_updater import ExpertLocationUpdater
from sglang.srt.runtime_context import get_model
from sglang.srt.runtime_context import get_server_args
if TYPE_CHECKING:
from sglang.srt.configs.model_config import ModelConfig
@@ -274,8 +274,8 @@ def update_expert_location_with_recovery(
else:
# Load the missing weights from disk
update_weights_from_disk_callable(
get_model().model_path,
get_model().load_format,
get_server_args().model_path,
get_server_args().load_format,
weight_name_filter=weight_name_filter,
)
@@ -18,7 +18,7 @@ from typing import Literal, Optional
import torch
from sglang.srt.eplb.expert_location import get_global_expert_location_metadata
from sglang.srt.runtime_context import get_exec
from sglang.srt.runtime_context import get_server_args
@dataclass
@@ -34,7 +34,7 @@ class ExpertLocationDispatchInfo:
@classmethod
def init_new(cls, layer_id: int):
ep_dispatch_algorithm = get_exec().moe.ep_dispatch_algorithm
ep_dispatch_algorithm = get_server_args().ep_dispatch_algorithm
expert_location_metadata = get_global_expert_location_metadata()
assert expert_location_metadata is not None
@@ -26,7 +26,7 @@ from sglang.srt.eplb.expert_location import (
ExpertLocationMetadata,
get_global_expert_location_metadata,
)
from sglang.srt.runtime_context import get_device
from sglang.srt.runtime_context import get_server_args
from sglang.srt.utils import get_bool_env_var
logger = logging.getLogger(__name__)
@@ -107,7 +107,7 @@ def _update_expert_weights_with_canary(
canary_tensor = (
_get_canary_value(old_expert_location_metadata, layer_id)
.clone()
.to(device=get_device().device, non_blocking=True)
.to(device=get_server_args().device, non_blocking=True)
)
routed_experts_weights_of_layer[layer_id].append(canary_tensor)