Skip to content

Conversation

@LucasWilkinson
Copy link
Collaborator

@LucasWilkinson LucasWilkinson commented Oct 10, 2024

FIX #9226

In this dockerfile the archs being detected by torch is 5.0;8.0;8.6;8.9;9.0;9.0a we should ensure we prune off 5.0 for the kernels where we build for all target archs. This PR does that by pre-filtering the CUDA_ARCHS (target archs) by the CUDA_SUPPORTED_ARCHS:

  cuda_archs_loose_intersection(CUDA_ARCHS 
    "${CUDA_SUPPORTED_ARCHS}" "${CUDA_ARCHS}")

(PR also includes some logging improvements / comments)

Verified using:

FROM pytorch/pytorch:2.4.0-cuda12.1-cudnn9-devel AS build

ARG GITHASH="e232f585359d50e880bcc4aa8c4161ab17919567"

RUN apt update && apt install gcc g++ git -y && apt clean && rm -rf /var/lib/apt/lists/*

ENV PATH=/workspace-lib:/workspace-lib/bin:$PATH
ENV PYTHONUSERBASE=/workspace-lib

RUN pip install git+https://github.com/neuralmagic/vllm.git@$GITHASH --no-cache-dir --user -v

FROM pytorch/pytorch:2.4.0-cuda12.1-cudnn9-runtime AS vllm-openai

WORKDIR /vllm-workspace

COPY --from=build /workspace-lib /workspace-lib

ENV PATH=/workspace-lib:/workspace-lib/bin:$PATH
ENV PYTHONUSERBASE=/workspace-lib
ENV PYTHONPATH=/workspace-lib:/vllm-workspace

ENTRYPOINT ["python3", "-m", "vllm.entrypoints.openai.api_server"]

@github-actions
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 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 do one of these:

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

🚀

@LucasWilkinson LucasWilkinson changed the title [Bugfix] Fix docker build where CUDA archs < 7.0 are being detected [CI/Build] Fix docker build where CUDA archs < 7.0 are being detected Oct 10, 2024
@LucasWilkinson LucasWilkinson changed the title [CI/Build] Fix docker build where CUDA archs < 7.0 are being detected [CI/Build][Bugfix] Fix docker build where CUDA archs < 7.0 are being detected Oct 10, 2024
@LucasWilkinson LucasWilkinson changed the title [CI/Build][Bugfix] Fix docker build where CUDA archs < 7.0 are being detected [Bugfix][CI/Build] Fix docker build where CUDA archs < 7.0 are being detected Oct 10, 2024
@mgoin mgoin added the ready ONLY add when PR is ready to merge/full CI is needed label Oct 10, 2024
@simon-mo simon-mo requested a review from tlrmchlsmth October 11, 2024 19:27
Copy link
Member

@mgoin mgoin left a comment

Choose a reason for hiding this comment

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

This is good by me

Copy link
Member

@tlrmchlsmth tlrmchlsmth left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix!

I saw one typo in a comment but I think we just land this to get the fix in.

Comment on lines +148 to +153
#
# For cuda we want to be able to control which architectures we compile for on
# a per-file basis in order to cut down on compile time. So here we extract
# the set of architectures we want to compile for and remove the from the
# CMAKE_CUDA_FLAGS so that they are not applied globally.
#
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#
# For cuda we want to be able to control which architectures we compile for on
# a per-file basis in order to cut down on compile time. So here we extract
# the set of architectures we want to compile for and remove the from the
# CMAKE_CUDA_FLAGS so that they are not applied globally.
#
#
# For cuda we want to be able to control which architectures we compile for on
# a per-file basis in order to cut down on compile time. So here we extract
# the set of architectures we want to compile for and remove them from the
# CMAKE_CUDA_FLAGS so that they are not applied globally.
#

@tlrmchlsmth tlrmchlsmth merged commit de9fb4b into vllm-project:main Oct 11, 2024
90 checks passed
Alvant pushed a commit to compressa-ai/vllm that referenced this pull request Oct 26, 2024
garg-amit pushed a commit to garg-amit/vllm that referenced this pull request Oct 28, 2024
…detected (vllm-project#9254)

Signed-off-by: Amit Garg <mitgarg17495@gmail.com>
sumitd2 pushed a commit to sumitd2/vllm that referenced this pull request Nov 14, 2024
…detected (vllm-project#9254)

Signed-off-by: Sumit Dubey <sumit.dubey2@ibm.com>
LeiWang1999 pushed a commit to LeiWang1999/vllm-bitblas that referenced this pull request Mar 26, 2025
…detected (vllm-project#9254)

Signed-off-by: LeiWang1999 <leiwang1999@outlook.com>
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.

[Bug]: Could not pip install vllm inside dockerfile after certain commit in main branch

3 participants