Support sanity checking weight consistency especially for RL (#13854)

This commit is contained in:
fzyzcjy
2025-11-27 20:25:12 +08:00
committed by GitHub
parent 2bc8ee8b74
commit 25758647b1
7 changed files with 156 additions and 0 deletions

View File

@@ -76,6 +76,7 @@ from sglang.srt.environ import envs
from sglang.srt.function_call.function_call_parser import FunctionCallParser
from sglang.srt.managers.io_struct import (
AbortReq,
CheckWeightsReqInput,
CloseSessionReqInput,
ConfigureLoggingReq,
ContinueGenerationReqInput,
@@ -956,6 +957,15 @@ async def resume_memory_occupation(
return _create_error_response(e)
@app.post("/weights_checker")
async def check_weights(obj: CheckWeightsReqInput, request: Request):
success, message = await _global_state.tokenizer_manager.check_weights(obj, request)
return ORJSONResponse(
{"success": success, "message": message},
status_code=200 if success else HTTPStatus.BAD_REQUEST,
)
@app.api_route("/slow_down", methods=["GET", "POST"])
async def slow_down(obj: SlowDownReqInput, request: Request):
"""Slow down the system deliberately. Only for testing. Example scenario: