Add the ability to enable and disable the Profiler via HTTP API. (#1626)

This commit is contained in:
科英
2024-10-11 17:34:25 +08:00
committed by GitHub
parent b503881bd2
commit bbd72bfc86
4 changed files with 73 additions and 0 deletions

View File

@@ -46,6 +46,7 @@ from sglang.srt.managers.io_struct import (
EmbeddingReqInput,
FlushCacheReq,
GenerateReqInput,
ProfileReq,
RewardReqInput,
TokenizedEmbeddingReqInput,
TokenizedGenerateReqInput,
@@ -512,6 +513,14 @@ class TokenizerManager:
req = AbortReq(rid)
self.send_to_scheduler.send_pyobj(req)
def start_profile(self):
req = ProfileReq.START_PROFILE
self.send_to_scheduler.send_pyobj(req)
def stop_profile(self):
req = ProfileReq.STOP_PROFILE
self.send_to_scheduler.send_pyobj(req)
async def update_weights(
self, obj: UpdateWeightReqInput, request: Optional[fastapi.Request] = None
):