[diffusion] CI: add performance tracking job to nightly (#21091)
This commit is contained in:
@@ -136,6 +136,7 @@ async def generations(
|
||||
enable_upscaling=request.enable_upscaling,
|
||||
upscaling_model_path=request.upscaling_model_path,
|
||||
upscaling_scale=request.upscaling_scale,
|
||||
perf_dump_path=request.perf_dump_path,
|
||||
)
|
||||
batch = prepare_request(
|
||||
server_args=server_args,
|
||||
|
||||
@@ -53,6 +53,8 @@ class ImageGenerationsRequest(BaseModel):
|
||||
upscaling_model_path: Optional[str] = None
|
||||
upscaling_scale: Optional[int] = 4
|
||||
diffusers_kwargs: Optional[Dict[str, Any]] = None # kwargs for diffusers backend
|
||||
# Performance profiling
|
||||
perf_dump_path: Optional[str] = None
|
||||
|
||||
|
||||
# Video API protocol models
|
||||
@@ -109,6 +111,8 @@ class VideoGenerationsRequest(BaseModel):
|
||||
output_compression: Optional[int] = None
|
||||
output_path: Optional[str] = None
|
||||
diffusers_kwargs: Optional[Dict[str, Any]] = None # kwargs for diffusers backend
|
||||
# Performance profiling
|
||||
perf_dump_path: Optional[str] = None
|
||||
|
||||
|
||||
class VideoListResponse(BaseModel):
|
||||
|
||||
@@ -81,6 +81,7 @@ def _build_video_sampling_params(request_id: str, request: VideoGenerationsReque
|
||||
output_path=request.output_path,
|
||||
output_compression=request.output_compression,
|
||||
output_quality=request.output_quality,
|
||||
perf_dump_path=request.perf_dump_path,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ from sglang.multimodal_gen.runtime.layers.vocab_parallel_embedding import (
|
||||
)
|
||||
from sglang.multimodal_gen.utils import get_mixed_precision_state
|
||||
|
||||
torch._dynamo.config.recompile_limit = 16
|
||||
torch._dynamo.config.recompile_limit = 64
|
||||
|
||||
|
||||
class BaseLayerWithLoRA(nn.Module):
|
||||
|
||||
@@ -297,6 +297,19 @@ class GPUWorker:
|
||||
# Avoid logging warmup perf records that share the same request_id.
|
||||
if not req.is_warmup:
|
||||
PerformanceLogger.log_request_summary(metrics=output_batch.metrics)
|
||||
|
||||
# dump per-request perf report to specified file (server mode)
|
||||
if (
|
||||
req.perf_dump_path is not None
|
||||
and not req.is_warmup
|
||||
and output_batch.metrics is not None
|
||||
):
|
||||
PerformanceLogger.dump_benchmark_report(
|
||||
file_path=req.perf_dump_path,
|
||||
metrics=output_batch.metrics,
|
||||
meta={"model": self.server_args.model_path},
|
||||
tag="server_perf_dump",
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(
|
||||
f"Error executing request {req.request_id}: {e}", exc_info=True
|
||||
|
||||
Reference in New Issue
Block a user