-
-
Notifications
You must be signed in to change notification settings - Fork 11.9k
[misc] Add Torch profiler support #7451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| Profiling vLLM | ||
| ================================= | ||
|
|
||
| We support tracing vLLM workers using the ``torch.profiler`` module. You can enable tracing by setting the ``VLLM_TORCH_PROFILER_DIR`` environment variable to the directory where you want to save the traces: ``VLLM_TORCH_PROFILER_DIR=/mnt/traces/`` | ||
|
||
|
|
||
| The OpenAI server also needs to be started with the ``VLLM_TORCH_PROFILER_DIR`` environment variable set. | ||
|
||
|
|
||
| When using ``benchmarks/benchmark_serving.py``, you can enable profiling by passing the ``--profile`` flag. | ||
SolitaryThinker marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| .. warning:: | ||
|
|
||
| Only enable profiling in a development environment. | ||
SolitaryThinker marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| Traces can be visualized using https://ui.perfetto.dev/. | ||
|
|
||
| .. tip:: | ||
|
|
||
| Only send a few requests through vLLM when profiling, as the traces can get quite large. Also, no need to untar the traces, they can be viewed directly. | ||
SolitaryThinker marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Example commands: | ||
|
|
||
| OpenAI Server: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| VLLM_TORCH_PROFILER_DIR=/mnt/traces/ python -m vllm.entrypoints.openai.api_server --model meta-llama/Meta-Llama-3-70B | ||
|
|
||
| benchmark_serving.py: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| python benchmarks/benchmark_serving.py --backend vllm --model meta-llama/Meta-Llama-3-70B --dataset-name sharegpt --dataset-path sharegpt.json --profile --num-prompts 2 | ||
SolitaryThinker marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe instead of deleting it we add another condition for start_profile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel the naming of this function should be changed instead.