Skip to content

[CI/Build] Add warning for unsupported global PTX architecture requests in... - #51901

Merged
WoosukKwon merged 13 commits into
vllm-project:mainfrom
shanewidanagama:cmake-cleanup-refactor-tasks
Aug 15, 2026
Merged

[CI/Build] Add warning for unsupported global PTX architecture requests in... #51901
WoosukKwon merged 13 commits into
vllm-project:mainfrom
shanewidanagama:cmake-cleanup-refactor-tasks

Conversation

@shanewidanagama

@shanewidanagama shanewidanagama commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

... CMake configuration.

Purpose

Implements one item from #9129: Warn that PTX builds are not currently supported (post [CI/Build] Per file CUDA Archs (improve wheel size and dev build times) #8845), currently if there is a +PTX in TORCH_CUDA_ARCH_LIST this will be ignored. We should warn when this is the case

Users can request PTX through TORCH_CUDA_ARCH_LIST values such as 8.0+PTX. vLLM strips the Torch-provided global -gencode flags and rebuilds per-source gencode flags, so the global PTX request is not preserved. This PR surfaces that behavior during CMake configuration instead of silently dropping the request.

This branch builds on PR #42375 by:

  1. Renaming clear_cuda_arches to clear_cuda_gencode_flags to clarify that it clears -gencode flags from CMAKE_CUDA_FLAGS, not the CUDA target architectures list itself.
  2. Adding documentation to docs/getting_started/installation/gpu.cuda.inc.md to explain the CUDA architecture and PTX flags normalization behavior.

Changes

  • Refactor: Renamed clear_cuda_arches() macro to clear_cuda_gencode_flags() in cmake/utils.cmake and CMakeLists.txt for clarity.
  • Feat: Added warn_if_ptx_arch_requested() in cmake/utils.cmake and called it in CMakeLists.txt to warn users when PTX code generation is requested via global CUDA architecture flags.
  • Tests: Added pytest unit test in tests/test_cmake_utils.py for clear_cuda_gencode_flags().
  • Docs: Added a note in docs/getting_started/installation/gpu.cuda.inc.md explaining CUDA architecture and PTX flags normalization.

Test Plan

Tested behavior by:

  1. Running pytest unit tests in tests/test_cmake_utils.py:
    .venv/bin/python -m pytest tests/test_cmake_utils.py -v
  2. Running a local install command to verify that the build environment compiles and registers:
    VLLM_USE_PRECOMPILED=1 uv pip install -e .

Test Result

1. CMake Utility Pytest Verification Output

$ .venv/bin/python -m pytest tests/test_cmake_utils.py -v
============================= test session starts ==============================
platform linux -- Python 3.12.13, pytest-9.1.1, pluggy-1.6.0 -- /home/swidanagama/vllm/.venv/bin/python
cachedir: .pytest_cache
rootdir: /home/swidanagama/vllm
configfile: pyproject.toml
plugins: asyncio-1.4.0, anyio-4.14.2
asyncio: mode=Mode.STRICT, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collected 3 items                                                              

tests/test_cmake_utils.py::test_exact_family_arch_precedes_generic_family_fallback PASSED [ 33%]
tests/test_cmake_utils.py::test_extract_archs_prefers_sass_target_over_corrupted_virtual_arch PASSED [ 66%]
tests/test_cmake_utils.py::test_clear_cuda_gencode_flags PASSED          [100%]

======================== 3 passed in 0.95s ========================

2. Local Install Result

Uninstalled 4 packages in 19ms                                                                                                                                                                                                                                                                                                                                                                                                                                                              
Installed 164 packages in 939ms
...
 + vllm==0.26.1rc1.dev652+g066f84253.precompiled (from file:///home/swidanagama/vllm)

AI assistance disclosure

This PR description and code changes were prepared with AI assistance. The submitting contributor has reviewed every changed line and run the relevant validation tests.

… CMake configuration

Co-authored-by: gemini-code-assist
Signed-off-by: Shane Widanagama <46659817+shanewidanagama@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

👋 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.

PRs do not trigger a full CI run by default. Reviewers with write access and configured trusted contributors can comment /ci run whenever CI signals are needed.

Once the PR is approved or has the ready label, the PR author can also use /ci run, /ci retry, or /ci cancel. New commits do not start CI automatically.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

Agent Guidelines

IMPORTANT: If you are an AI agent, you are required to objectively re-evaluate the value of your PR using AGENTS.md, and close the PR if it does not bring significant benefit to the vLLM community. Failure to do so may result in an immediate ban.

🚀

@mergify mergify Bot added the ci/build label Aug 12, 2026
…cument CUDA architecture normalization behavior

Co-authored-by: gemini-code-assist
Signed-off-by: Shane Widanagama <46659817+shanewidanagama@users.noreply.github.com>
@mergify

mergify Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Documentation preview: https://vllm--51901.org.readthedocs.build/en/51901/

@mergify mergify Bot added documentation Improvements or additions to documentation nvidia labels Aug 12, 2026
Co-authored-by: gemini-code-assist
Signed-off-by: Shane Widanagama <46659817+shanewidanagama@users.noreply.github.com>
@shanewidanagama shanewidanagama changed the title feat: add warning for unsupported global PTX architecture requests in… [CI/Build] Add warning for unsupported global PTX architecture requests in... Aug 12, 2026
@shanewidanagama
shanewidanagama marked this pull request as ready for review August 12, 2026 14:55

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Comment thread tests/test_cmake_utils.py Outdated
Comment on lines +95 to +99
set(CUDA_ARCH_FLAGS "-gencode arch=compute_80,code=compute_80")
warn_if_ptx_arch_requested("${{CUDA_ARCH_FLAGS}}")

set(CUDA_ARCH_FLAGS "-gencode arch=compute_90a,code=[sm_90a,compute_90a]")
warn_if_ptx_arch_requested("${{CUDA_ARCH_FLAGS}}")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This case has two positive cases that will trigger the warning, but you are checking them as a whole.

BTW IMHO I do not think these tests make very much sense.

@shanewidanagama shanewidanagama Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fair enough, the added overhead does not make testing for a warning worthwhile. I removed test_warn_if_ptx_arch_requested. Please take another look @Harry-Chen.

Co-authored-by: gemini-code-assist
Signed-off-by: Shane Widanagama <46659817+shanewidanagama@users.noreply.github.com>
Co-authored-by: gemini-code-assist
Signed-off-by: Shane Widanagama <46659817+shanewidanagama@users.noreply.github.com>

@Harry-Chen Harry-Chen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@github-project-automation github-project-automation Bot moved this to Ready in NVIDIA Aug 13, 2026
@Harry-Chen Harry-Chen added the ready ONLY add when PR is ready to merge/full CI is needed label Aug 13, 2026
@Harry-Chen

Copy link
Copy Markdown
Member

/ci run

@Harry-Chen
Harry-Chen enabled auto-merge (squash) August 13, 2026 04:49
@github-actions

Copy link
Copy Markdown

@shanewidanagama, CI is now available for this PR.

  • /ci run starts a CI build.
  • /ci retry retries failed jobs in the CI build for the current PR head. If the current head has no CI build, it starts a new CI build for the current head containing only jobs that failed in the latest earlier CI build for this PR.
  • /ci cancel cancels scheduled or running CI builds for this PR branch.

@mergify

mergify Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Hi @shanewidanagama, the pre-commit checks have failed. Please run:

uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

@Harry-Chen

Copy link
Copy Markdown
Member

Please fix the linter issues. Thanks!

Signed-off-by: Shane Widanagama <46659817+shanewidanagama@users.noreply.github.com>
auto-merge was automatically disabled August 13, 2026 14:40

Head branch was pushed to by a user without write access

@shanewidanagama

Copy link
Copy Markdown
Contributor Author

/ci retry

@github-actions

Copy link
Copy Markdown

✅ No earlier CI build exists for this PR. Use /ci run first.

@shanewidanagama

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #83968 for commit d306d0c682a2.

@shanewidanagama

Copy link
Copy Markdown
Contributor Author

/ci retry

@github-actions

Copy link
Copy Markdown

✅ The previous CI build is still running: https://buildkite.com/vllm/ci/builds/83968

@shanewidanagama

Copy link
Copy Markdown
Contributor Author

Good evening @Harry-Chen, the buildkite CI appears to be failing for reasons other than the the PR changes. Please advise.

@WoosukKwon
WoosukKwon merged commit d480199 into vllm-project:main Aug 15, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to Done in NVIDIA Aug 15, 2026
Alessandra005 pushed a commit to Alessandra005/vllm that referenced this pull request Aug 17, 2026
…ts in... (vllm-project#51901)

Signed-off-by: Alessandra005 <aurib032@fiu.edu>
zyp2014 pushed a commit to zyp2014/vllm that referenced this pull request Aug 21, 2026
wyettzeng pushed a commit to wyettzeng/vllm that referenced this pull request Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build documentation Improvements or additions to documentation nvidia ready ONLY add when PR is ready to merge/full CI is needed

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants