"""Start recording the expert distribution. Reset the recorder and set the recording flag to True."""
ifself._record==True:
"""Start recording the expert distribution."""
ifself._recording:
logger.warning(
"SGLang server is already recording expert ids. Did you forget to dump the expert ids recorded so far by sending requests to the `/stop_expert_distribution_record` and `/dump_expert_distribution_record` endpoints?"
)
self.reset()
self._record=True
self._reset()
self._recording=True
defstop_record(self):
"""Stop recording the expert distribution. Set the recording flag to False."""
ifself._record==False:
"""Stop recording the expert distribution."""
ifnotself._recording:
logger.warning(
"SGLang server has not been recording expert ids. Did you forget to start recording by sending request to the `/start_expert_distribution_record` endpoint?"
)
self._record=False
defdump_record(self):
"""Dump the expert distribution record to a file. Reset the recorder after dumping."""
help="Select the mode when enable DeepEP MoE, could be `normal`, `low_latency` or `auto`. Default is `auto`, which means `low_latency` for decode batch and `normal` for prefill batch.",