Skip to content

[Feat] Allow custom naming of vLLM processes #21445

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

Merged
merged 12 commits into from
Jul 24, 2025

Conversation

chaunceyjiang
Copy link
Contributor

@chaunceyjiang chaunceyjiang commented Jul 23, 2025

Essential Elements of an Effective PR Description Checklist

  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

Supports #21423

Purpose

Test Result

CUDA:
TP=4

# export VLLM_PROCESS_NAME_PREFIX=VLLM
# vllm serve /home/jovyan/qwen3-8b  -tp 2
# ps -ef
root       15593    9259 17 15:08 pts/4    00:00:13 VLLM::APIServer_0
root       15954   15593  0 15:09 pts/4    00:00:00 /opt/conda/envs/vllm/bin/python3.12 -c from multiprocessing.resource_trac
root       15955   15593 19 15:09 pts/4    00:00:11 VLLM::EngineCoreProc_0
root       16120   15955 33 15:09 pts/4    00:00:16 VLLM::Worker_TP0_DP0
root       16124   15955 37 15:09 pts/4    00:00:18 VLLM::Worker_TP1_DP0
root       16125   15955 35 15:09 pts/4    00:00:17 VLLM::Worker_TP2_DP0
root       16126   15955 33 15:09 pts/4    00:00:16 VLLM::Worker_TP3_DP0

DP=2

# export VLLM_PROCESS_NAME_PREFIX=VLLM
# vllm serve /home/jovyan/qwen3-8b  --data-parallel-size 2 --data-parallel-rpc-port 25555 --data-parallel-address 127.0.0.1 --api-server-count 2
# ps -ef
root      116630     734 13 10:55 pts/4    00:00:10 VLLM::APIServerProcessManager
root      117014  116630  0 10:55 pts/4    00:00:00 /opt/conda/envs/vllm/bin/python3.12 -c from multiprocessing.resource_tracker import main;main(36)
root      117015  116630 17 10:55 pts/4    00:00:10 VLLM::DPCoordinatorProc
root      117018  116630 94 10:55 pts/4    00:00:57 VLLM::DPEngineCoreProc_0
root      117019  116630 92 10:55 pts/4    00:00:56 VLLM::DPEngineCoreProc_1
root      117020  116630 18 10:55 pts/4    00:00:11 VLLM::APIServer_0
root      117021  116630 20 10:55 pts/4    00:00:12 VLLM::APIServer_1

TP=2. DP=2

# export VLLM_PROCESS_NAME_PREFIX=VLLM
# vllm serve /home/jovyan/qwen3-8b --enable-auto-tool-choice --tool-call-parser hermes --reasoning-parser qwen3 --disable-log-requests --data-parallel-size 2 --data-parallel-rpc-port 25555 --data-parallel-address 127.0.0.1 --api-server-count 2 --gpu-memory-utilization 0.4 --data-parallel-size-local 0
# vllm serve /home/jovyan/qwen3-8b --enable-auto-tool-choice --tool-call-parser hermes --reasoning-parser qwen3 --disable-log-requests --data-parallel-size 2 --data-parallel-rpc-port 25555 --data-parallel-address 127.0.0.1 --headless --gpu-memory-utilization 0.4 --data-parallel-size-local 2  -tp 2

root        6441    4359 10 15:01 pts/3    00:00:10 VLLM::APIServer_Headless
root        7046    6441  0 15:01 pts/3    00:00:00 /opt/conda/envs/vllm/bin/python3.12 -c from multiprocessing.resource_trac
root        7047    6441 13 15:01 pts/3    00:00:10 VLLM::DPEngineCoreProc_0
root        7048    6441 14 15:01 pts/3    00:00:11 VLLM::DPEngineCoreProc_1
root        7720    2688 21 15:02 pts/2    00:00:09 VLLM::APIServerProcessManager
root        8040    7720  0 15:02 pts/2    00:00:00 /opt/conda/envs/vllm/bin/python3.12 -c from multiprocessing.resource_trac
root        8041    7720 28 15:02 pts/2    00:00:09 VLLM::DPCoordinatorProc
root        8044    7720 31 15:02 pts/2    00:00:10 VLLM::APIServer_0
root        8045    7720 30 15:02 pts/2    00:00:10 VLLM::APIServer_1
root        8058    7048 37 15:02 pts/3    00:00:12 VLLM::Worker_TP0_DP1
root        8061    7047 38 15:02 pts/3    00:00:12 VLLM::Worker_TP0_DP0
root        8062    7048 38 15:02 pts/3    00:00:12 VLLM::Worker_TP1_DP1
root        8063    7047 37 15:02 pts/3    00:00:12 VLLM::Worker_TP1_DP0


nvidia-smi

+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A   1357293      C   VLLM::Worker_TP0_DP0                      36282MiB |
|    1   N/A  N/A   1357295      C   VLLM::Worker_TP1_DP0                      36282MiB |
|    2   N/A  N/A   1357290      C   VLLM::Worker_TP0_DP1                      36282MiB |
|    4   N/A  N/A   1357294      C   VLLM::Worker_TP1_DP1                      36282MiB |

Note: The process python3.12 -c from multiprocessing.resource_tracker import main;main(36) is automatically generated when using from multiprocessing import shared_memory, so there is currently no way to modify its process name.


Keep the process name consistent with the naming style of SGlang processes.

image

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a feature to allow custom naming of vLLM processes via the VLLM_PROCESS_NAME_PREFIX environment variable, which is useful for monitoring. The implementation uses the setproctitle library across different vLLM components. My main concern is that setproctitle is a new dependency that needs to be added to the project's dependency files to avoid runtime errors.

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
@mergify mergify bot added the ci/build label Jul 23, 2025
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
@chaunceyjiang
Copy link
Contributor Author

/cc @DarkLight1337 @njhill @ciaoyizhen PTAL.

Copy link
Member

@njhill njhill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @chaunceyjiang I wasn't aware it was so easy to do this!

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
@chaunceyjiang chaunceyjiang requested a review from njhill July 23, 2025 15:14
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
Copy link

@ciaoyizhen ciaoyizhen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't believe it, it turned out even better than I expected.

@DarkLight1337
Copy link
Member

Please fix doc build

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
@chaunceyjiang
Copy link
Contributor Author

Please fix doc build

@DarkLight1337 Done. PTAL.

Copy link
Member

@DarkLight1337 DarkLight1337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM given tests pass

@DarkLight1337 DarkLight1337 enabled auto-merge (squash) July 24, 2025 07:12
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Jul 24, 2025
@vllm-bot vllm-bot merged commit 6da0078 into vllm-project:main Jul 24, 2025
105 of 106 checks passed
@chaunceyjiang chaunceyjiang deleted the process_name branch July 24, 2025 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/build frontend ready ONLY add when PR is ready to merge/full CI is needed v1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants