"vscode:/vscode.git/clone" did not exist on "e290f87ca949c077803d2da02c48173607ce70e4"
Unverified Commit 9efb2993 authored by fzyzcjy's avatar fzyzcjy Committed by GitHub
Browse files

Tiny add logs for expert location updater (#7308)

parent a5317b2f
...@@ -30,6 +30,9 @@ from sglang.srt.utils import get_bool_env_var ...@@ -30,6 +30,9 @@ from sglang.srt.utils import get_bool_env_var
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
_LOG_INPUT = get_bool_env_var("SGLANG_EXPERT_LOCATION_UPDATER_LOG_INPUT")
class ExpertLocationUpdater: class ExpertLocationUpdater:
def __init__(self): def __init__(self):
self._first_execution = True self._first_execution = True
...@@ -175,6 +178,19 @@ def update_expert_weights_single_layer( ...@@ -175,6 +178,19 @@ def update_expert_weights_single_layer(
assert isinstance(old_physical_to_logical_map, list) assert isinstance(old_physical_to_logical_map, list)
assert isinstance(new_physical_to_logical_map, list) assert isinstance(new_physical_to_logical_map, list)
if _LOG_INPUT:
logger.info(
"update_expert_weights_single_layer "
f"{[x.shape for x in routed_experts_weights]=} "
f"{[x.shape for x in temp_buffers]=} "
f"{old_physical_to_logical_map=} "
f"{new_physical_to_logical_map=} "
f"{num_local_physical_experts=} "
f"{num_gpu_per_node=} "
f"{rank=} "
f"{world_size=} "
)
output_logs = [] if debug else None output_logs = [] if debug else None
num_physical_experts = len(old_physical_to_logical_map) num_physical_experts = len(old_physical_to_logical_map)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment