-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[CI/Build] Use python 3.12 in cuda image #8133
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
Conversation
Signed-off-by: Joe Runde <[email protected]>
Signed-off-by: Joe Runde <[email protected]>
👋 Hi! Thank you for contributing to the vLLM project. 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 do one of these:
🚀 |
Signed-off-by: Joe Runde <[email protected]>
# A newer setuptools is required for installing some test dependencies from source that do not publish python 3.12 wheels | ||
# This installation must complete before the test dependencies are collected and installed. | ||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
python3 -m pip install "setuptools>=74.1.1" |
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.
The build without this failed with
[2024-09-03T22:25:50Z] #37 2.608 Collecting transformers_stream_generator (from -r requirements-test.txt (line 24))
[2024-09-03T22:25:50Z] #37 2.618 Downloading transformers-stream-generator-0.0.5.tar.gz (13 kB)
[2024-09-03T22:25:50Z] #37 2.627 Preparing metadata (setup.py): started
[2024-09-03T22:25:50Z] #37 2.646 Preparing metadata (setup.py): finished with status 'error'
[2024-09-03T22:25:50Z] #37 2.648 error: subprocess-exited-with-error
[2024-09-03T22:25:50Z] #37 2.648
[2024-09-03T22:25:50Z] #37 2.648 × python setup.py egg_info did not run successfully.
[2024-09-03T22:25:50Z] #37 2.648 │ exit code: 1
[2024-09-03T22:25:50Z] #37 2.648 ╰─> [1 lines of output]
[2024-09-03T22:25:50Z] #37 2.648 ERROR: Can not execute `setup.py` since setuptools is not available in the build environment.
[2024-09-03T22:25:50Z] #37 2.648 [end of output]
[2024-09-03T22:25:50Z] #37 2.648
[2024-09-03T22:25:50Z] #37 2.648 note: This error originates from a subprocess, and is likely not a problem with pip.
[2024-09-03T22:25:50Z] #37 2.657 error: metadata-generation-failed
I verified this was because the vllm-base
target never updates setuptools, so it still has version 45.2.0
installed, which causes this error with a very misleading message.
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 wonder why setuptools
is at 45.2.0
specifically and why being on an older version leads to this error message? The message doesn't mention anything about version being outdated/incompatible, only that setuptools
is nto in the build env.
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.
Yeah, it took some googling around to find that others ran into the same error when setuptools is just out of date- I don't know why that's the case but I'd guess it's just some api incompatibility that's not quite correctly handled.
You can reproduce by installing setuptools==45.2.0 and then trying to install transformers-stream-generator in a fresh python 3.12 venv
I wonder why setuptools is at 45.2.0 specifically
Yeah idk, from the build logs it looks like that's just what's installed when we do apt-get install -y python3.12 python3.12-dev python3.12-venv
, I see this in the log:
[2024-09-05T21:34:56Z] #10 11.07 Get:191 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 python3-setuptools all 45.2.0-1ubuntu0.1 [330 kB]
is 3.12 too agressive? some packages might not publish 3.12 wheels. I think 3.11 should be safe to upgrade. |
Signed-off-by: Joe Runde <[email protected]>
Signed-off-by: Joe Runde <[email protected]>
@youkaichao solid maybe I'm looking through all the failures right now to see if anything is really bad, but in general I'd expect that since 3.12 has been stable for a year and we're less than a month away from the 3.13 release, packages should be out for 3.12 by now for anything that's worth depending on. If we have dependencies that are not 3.12 compatible, it'd be better to question why we're including them if they're not regularly maintained. edit: so far it looks like it's just the |
Signed-off-by: Joe Runde <[email protected]>
Signed-off-by: Joe Runde <[email protected]>
Alright, fastcheck tests are passing and a quick check with a llama 7b model on an A100 at least shows that it's not slower:
At 4 qps the results are the same but it looks a little better at 16 qps. I think this tracks, higher loads should run into contention with the cpu more. I could beg for some more gpus to run some tp tests with larger models if anybody wants more data before merging. @simon-mo @khluu think we can at least run the full CI suite here? |
Marked ready so we can run full suite |
"logging.config.dictConfig") as dict_config_mock: | ||
_configure_vllm_root_logger() | ||
assert dict_config_mock.called_with(valid_logging_config) | ||
dict_config_mock.assert_called_with(valid_logging_config) |
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.
This is failing and I'm not sure what the expected behavior of this test was before, looking into it a bit to try to understand
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.
So I think that the mock on logging.config.dictConfig
was incorrect, because vllm.logger
imports that eagerly, so we instead have to mock the local vllm.logger.dictConfig
.
The test was passing before because dict_config_mock.called_with
was returning a mock, which was then passing the assert
since it's not falsey.
I got my hands on 2 A100s and ran a quick comparison with llama2-70b, tp=2
Looks faster 🚀🚀🚀 |
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.
Looks good to me - maybe we should update the minimum version of setuptools in the common requirements
@mgoin we could, I just wasn't sure if we wanted to include setuptools as a dependency. It's in What I want to say here is that, presumably the 3.12 wheels are already working and I don't want to change them. But, since I did have to explicitly add I don't really feel strongly either way- mostly I'd rather not have to wait for another build lol. Let me know if you want that change in and I'll add it. |
When building the docker file from the main branch and starting the finished build i get this error: Is this because the package is removed in python 3.12? See here: https://docs.python.org/3.10/library/distutils.html |
cc @joerunde |
I have some more infos for this problem. When i launched the docker image with bash and execute pip list i can see that setuptools has version 45.2.0. When i execute "pip install setuptools==74.1.2" and then start vllm server, it works. When i only do pip install setuptools it doesnt work. I dont understand how it didnt install the newer version of setuptools when building the docker file. I also double checked my Dockerfile i have git pulled and it contains this line: |
Signed-off-by: Joe Runde <[email protected]>
Apparently I have exactly the same issue. |
Ah shoot, sorry all. @mgoin was right, I should've just added that to the common requirements :(
That's only in the test stage, so it doesn't make it to the final image. I added it there because not having it caused an error installing test dependencies. Is this a regression for the latest released images? Or only for images manually built directly off main? |
Signed-off-by: Joe Runde <[email protected]> Signed-off-by: Alvant <[email protected]>
Signed-off-by: Joe Runde <[email protected]> Signed-off-by: Amit Garg <[email protected]>
Signed-off-by: Joe Runde <[email protected]> Signed-off-by: LeiWang1999 <[email protected]>
This PR updates the
PYTHON_VERSION
default arg in the cuda dockerfile to3.12
We suspect this may improve performance, as IBM-built vlm images using python 3.11 instead of 3.10 are faster, and the Python 3.11 release was performance focused, see: https://docs.python.org/3/whatsnew/3.11.html
Python 3.12 is the latest stable release, and also included more performance fixes for asyncio:
It looks like all of the images in this repo set their python versions independently, maybe we should update all of them to 3.12 as well, but I wanted to keep the blast radius small here.
I'm trying to build this image locally to test it out, but it may be faster to just enable CI and see what happens 😉
Might provide a very small mitigation for #8147, looks like a ~1% throughput improvement from quick tests
PR Checklist (Click to Expand)
Thank you for your contribution to vLLM! Before submitting the pull request, please ensure the PR meets the following criteria. This helps vLLM maintain the code quality and improve the efficiency of the review process.
PR Title and Classification
Only specific types of PRs will be reviewed. The PR title is prefixed appropriately to indicate the type of change. Please use one of the following:
[Bugfix]
for bug fixes.[CI/Build]
for build or continuous integration improvements.[Doc]
for documentation fixes and improvements.[Model]
for adding a new model or improving an existing model. Model name should appear in the title.[Frontend]
For changes on the vLLM frontend (e.g., OpenAI API server,LLM
class, etc.)[Kernel]
for changes affecting CUDA kernels or other compute kernels.[Core]
for changes in the core vLLM logic (e.g.,LLMEngine
,AsyncLLMEngine
,Scheduler
, etc.)[Hardware][Vendor]
for hardware-specific changes. Vendor name should appear in the prefix (e.g.,[Hardware][AMD]
).[Misc]
for PRs that do not fit the above categories. Please use this sparingly.Note: If the PR spans more than one category, please include all relevant prefixes.
Code Quality
The PR need to meet the following code quality standards:
format.sh
to format your code.docs/source/
if the PR modifies the user-facing behaviors of vLLM. It helps vLLM user understand and utilize the new features or changes.Notes for Large Changes
Please keep the changes as concise as possible. For major architectural changes (>500 LOC excluding kernel/data/config/test), we would expect a GitHub issue (RFC) discussing the technical design and justification. Otherwise, we will tag it with
rfc-required
and might not go through the PR.What to Expect for the Reviews
The goal of the vLLM team is to be a transparent reviewing machine. We would like to make the review process transparent and efficient and make sure no contributor feel confused or frustrated. However, the vLLM team is small, so we need to prioritize some PRs over others. Here is what you can expect from the review process:
action-required
label on the PR if there are changes required. The contributor should address the comments and ping the reviewer to re-review the PR.Thank You
Finally, thank you for taking the time to read these guidelines and for your interest in contributing to vLLM. Your contributions make vLLM a great tool for everyone!