"torchvision/git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "1140ecf237c8287a315fd293e0a1bb5f710e115a"
Unverified Commit fd7a72d6 authored by fzyzcjy's avatar fzyzcjy Committed by GitHub
Browse files

Super tiny allow profile activities in bench_serving (#12549)

parent 21a8fa16
...@@ -615,7 +615,10 @@ async def async_request_profile(api_url: str) -> RequestFuncOutput: ...@@ -615,7 +615,10 @@ async def async_request_profile(api_url: str) -> RequestFuncOutput:
async with _create_bench_client_session() as session: async with _create_bench_client_session() as session:
output = RequestFuncOutput() output = RequestFuncOutput()
try: try:
async with session.post(url=api_url) as response: body = {
"activities": getattr(args, "profile_activities", []),
}
async with session.post(url=api_url, json=body) as response:
if response.status == 200: if response.status == 200:
output.success = True output.success = True
else: else:
...@@ -2527,6 +2530,14 @@ if __name__ == "__main__": ...@@ -2527,6 +2530,14 @@ if __name__ == "__main__":
help="Use Torch Profiler. The endpoint must be launched with " help="Use Torch Profiler. The endpoint must be launched with "
"SGLANG_TORCH_PROFILER_DIR to enable profiler.", "SGLANG_TORCH_PROFILER_DIR to enable profiler.",
) )
# TODO unify all these
parser.add_argument(
"--profile-activities",
type=str,
nargs="+",
default=["CPU", "GPU"],
choices=["CPU", "GPU", "CUDA_PROFILER"],
)
parser.add_argument( parser.add_argument(
"--lora-name", "--lora-name",
type=str, type=str,
......
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