config: read resolved config via namespace accessors (#31814)
This commit is contained in:
@@ -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_server_args
|
||||
from sglang.srt.runtime_context import get_model
|
||||
|
||||
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_server_args().model_path,
|
||||
get_server_args().load_format,
|
||||
get_model().model_path,
|
||||
get_model().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_server_args
|
||||
from sglang.srt.runtime_context import get_exec
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -34,7 +34,7 @@ class ExpertLocationDispatchInfo:
|
||||
|
||||
@classmethod
|
||||
def init_new(cls, layer_id: int):
|
||||
ep_dispatch_algorithm = get_server_args().ep_dispatch_algorithm
|
||||
ep_dispatch_algorithm = get_exec().moe.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_server_args
|
||||
from sglang.srt.runtime_context import get_device
|
||||
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_server_args().device, non_blocking=True)
|
||||
.to(device=get_device().device, non_blocking=True)
|
||||
)
|
||||
routed_experts_weights_of_layer[layer_id].append(canary_tensor)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user