Skip to content
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

[misc] Add Torch profiler support for CPU-only devices #7806

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

DamonFool
Copy link
Contributor

Hi all,

This is a follow up of #7451, which adds torch profiler support for CPU-only devices.

Before this patch, I got the following error on CPU-only devices.

INFO 08-23 01:59:55 api_server.py:315] Starting profiler...
INFO 08-23 01:59:55 server.py:128] Starting profiler...
(VllmWorkerProcess pid=19390) ERROR 08-23 01:59:55 multiproc_worker_utils.py:226] Exception in worker VllmWorkerProcess while processing method start_profile: 'CPUWorker' object has no attribute 'start_profile', Traceback (most recent call last):
(VllmWorkerProcess pid=19390) ERROR 08-23 01:59:55 multiproc_worker_utils.py:226]   File "/usr/local/lib/python3.10/dist-packages/vllm-0.5.4+cpu-py3.10-linux-x86_64.egg/vllm/executor/multiproc_worker_utils.py", line 222, in _run_worker_process
(VllmWorkerProcess pid=19390) ERROR 08-23 01:59:55 multiproc_worker_utils.py:226]     executor = getattr(worker, method)
(VllmWorkerProcess pid=19390) ERROR 08-23 01:59:55 multiproc_worker_utils.py:226] AttributeError: 'CPUWorker' object has no attribute 'start_profile'
(VllmWorkerProcess pid=19390) ERROR 08-23 01:59:55 multiproc_worker_utils.py:226]
INFO:     127.0.0.1:48766 - "POST /start_profile HTTP/1.1" 500 Internal Server Error

After this patch, the profiler runs OK.

Please review it.
Thanks.

Copy link

👋 Hi! Thank you for contributing to the vLLM project.
Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which consists a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of default ones by unblocking the steps in your fast-check build on Buildkite UI.

Once the PR is approved and ready to go, please make sure to run full CI as it is required to merge (or just use auto-merge).

To run full CI, you can do one of these:

  • Comment /ready on the PR
  • Add ready label to the PR
  • Enable auto-merge.

🚀

@DamonFool
Copy link
Contributor Author

The implication has just copied what @SolitaryThinker had done for cpu+gpu targets (removing cuda profiling of course).

@DamonFool
Copy link
Contributor Author

/ready

@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Aug 23, 2024
@comaniac comaniac enabled auto-merge (squash) August 23, 2024 03:56
@DamonFool
Copy link
Contributor Author

Thanks @comaniac for the review.

@comaniac comaniac merged commit faeddb5 into vllm-project:main Aug 23, 2024
52 of 53 checks passed
@DamonFool DamonFool deleted the cpu-profile branch August 23, 2024 05:52
omrishiv pushed a commit to omrishiv/vllm that referenced this pull request Aug 26, 2024
Alvant pushed a commit to compressa-ai/vllm that referenced this pull request Oct 26, 2024
KuntaiDu pushed a commit to KuntaiDu/vllm that referenced this pull request Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready ONLY add when PR is ready to merge/full CI is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants