Skip to content

Commit 35362c1

Browse files
committed
enable nsys
Signed-off-by: Leo Tian <lctian@nvidia.com>
1 parent f6bff83 commit 35362c1

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/srtctl/backends/vllm.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,9 @@ def build_worker_command(
331331
]
332332
)
333333

334+
if nsys_prefix is not None:
335+
cmd.extend(["--profiler-config.profiler", "cuda"])
336+
334337
# Disaggregation mode (dynamo 1.0.0+: --is-prefill-worker/--is-decode-worker are deprecated)
335338
if mode in ("prefill", "decode"):
336339
cmd.extend(["--disaggregation-mode", mode])

src/srtctl/core/schema.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,10 @@ def get_env_vars(self, mode: str, profile_dir: str) -> dict[str, str]:
644644
phase_key = mode.upper() if mode != "agg" else "AGG"
645645
if phase_config.start_step is not None:
646646
env[f"PROFILE_{phase_key}_START_STEP"] = str(phase_config.start_step)
647+
env["VLLM_PROFILER_DELAY_ITERS"] = str(phase_config.start_step)
647648
if phase_config.stop_step is not None:
648649
env[f"PROFILE_{phase_key}_STOP_STEP"] = str(phase_config.stop_step)
650+
env["VLLM_PROFILER_MAX_ITERS"] = str(phase_config.stop_step - phase_config.start_step)
649651

650652
if self.is_torch:
651653
env["SGLANG_TORCH_PROFILER_DIR"] = f"{profile_dir}/{mode}"

0 commit comments

Comments
 (0)