From 9a4eb94ca9f5bfad868164facae069d28cf7028a Mon Sep 17 00:00:00 2001 From: ApsarasX Date: Fri, 6 Jun 2025 20:25:59 +0800 Subject: [PATCH] [Misc] Adjust the default profiler configuration (#1097) ### What this PR does / why we need it? When profiling, it is often necessary to disable the call stack to reduce profiling overhead, and adjust the profiler_level to level1 to obtain more detailed operator and communication information. Therefore, it is recommended to modify the default profiling configuration. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? No Signed-off-by: ApsarasX --- vllm_ascend/worker/worker.py | 8 ++++---- vllm_ascend/worker/worker_v1.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/vllm_ascend/worker/worker.py b/vllm_ascend/worker/worker.py index 7070ea1..e78cc3f 100644 --- a/vllm_ascend/worker/worker.py +++ b/vllm_ascend/worker/worker.py @@ -140,7 +140,7 @@ class NPUWorker(LocalOrDistributedWorkerBase): experimental_config = torch_npu.profiler._ExperimentalConfig( export_type=torch_npu.profiler.ExportType.Text, - profiler_level=torch_npu.profiler.ProfilerLevel.Level0, + profiler_level=torch_npu.profiler.ProfilerLevel.Level1, msprof_tx=False, aic_metrics=torch_npu.profiler.AiCMetrics.AiCoreNone, l2_cache=False, @@ -155,9 +155,9 @@ class NPUWorker(LocalOrDistributedWorkerBase): torch_npu.profiler.ProfilerActivity.CPU, torch_npu.profiler.ProfilerActivity.NPU, ], - with_stack=True, - profile_memory=True, - with_modules=True, + with_stack=False, + profile_memory=False, + with_modules=False, experimental_config=experimental_config, on_trace_ready=torch_npu.profiler.tensorboard_trace_handler( torch_profiler_trace_dir)) diff --git a/vllm_ascend/worker/worker_v1.py b/vllm_ascend/worker/worker_v1.py index 4d01f84..85093bf 100644 --- a/vllm_ascend/worker/worker_v1.py +++ b/vllm_ascend/worker/worker_v1.py @@ -275,7 +275,7 @@ class NPUWorker(WorkerBase): experimental_config = torch_npu.profiler._ExperimentalConfig( export_type=torch_npu.profiler.ExportType.Text, - profiler_level=torch_npu.profiler.ProfilerLevel.Level0, + profiler_level=torch_npu.profiler.ProfilerLevel.Level1, msprof_tx=False, aic_metrics=torch_npu.profiler.AiCMetrics.AiCoreNone, l2_cache=False, @@ -290,9 +290,9 @@ class NPUWorker(WorkerBase): torch_npu.profiler.ProfilerActivity.CPU, torch_npu.profiler.ProfilerActivity.NPU, ], - with_stack=True, - profile_memory=True, - with_modules=True, + with_stack=False, + profile_memory=False, + with_modules=False, experimental_config=experimental_config, on_trace_ready=torch_npu.profiler.tensorboard_trace_handler( torch_profiler_trace_dir))