Skip to content

New stable abi cleanup - #46656

Merged
youkaichao merged 6 commits into
vllm-project:mainfrom
cleonard530:new-stable-abi-cleanup
Jul 3, 2026
Merged

New stable abi cleanup#46656
youkaichao merged 6 commits into
vllm-project:mainfrom
cleonard530:new-stable-abi-cleanup

Conversation

@cleonard530

@cleonard530 cleonard530 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Purpose

This is to cleanup a bit after migrating vLLM to the libtorch stable ABI. This includes:

  • moving all headers that are only used by files in the libtorch_stable directory to that directory.
  • Adding device guards that we didn't add during migration because they weren't there before, but probably should be there.
  • removing an import warning for _qutlass_C in cuda.py

Other things that could be improved that are not cleaned up here:

  • A lot of variables that could be const are not. This PR scope is already large (50 files changed) and this update would make it a lot larger without a huge benefit, so I did not update them here.
  • Some header file names in csrc/ are duplicated in csrc/libtorch_stable/ (e.g. dispatch_utils.h and torch_utils.h) which can cause confusion when importing. For instance, a file in csrc/libtorch_stable/ with #include "torch_utils.h" will include csrc/libtorch_stable/torch_utils.h, but if it was in any other directory it would include csrc/torch_utils.h. This should be resolved when we move the CPU and ROCm builds to the stable ABI as well.

cc @Harry-Chen @janeyx99

Test Plan

The changes are small but it covers a lot of files so the test plan is broad.

pytest tests/kernels/core
pytest tests/kernels/moe
pytest tests/kernels/quantization
pytest tests/kernels/test_top_k_per_row.py
pytest tests/kernels/test_fp32_router_gemm.py
pytest tests/kernels/test_fused_minimax_m3_qknorm_rope_kv_insert.py

Test Result

16,824 Test Executed

  • 16,588 passed
  • 236 failures

The same failures also failed on the main branch.


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.

@mergify mergify Bot added the nvidia label Jun 24, 2026
@cleonard530
cleonard530 marked this pull request as ready for review June 30, 2026 15:04

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

@cleonard530
cleonard530 force-pushed the new-stable-abi-cleanup branch from f6bfd4f to b812075 Compare June 30, 2026 15:09

@janeyx99 janeyx99 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM though we can do more and move headers that are used at all in libtorch_stable AND are stable themselves to libtorch_stable too right?

In other words, a file doesn't need to only be used in libtorch_stable to be migrated; it can also be used outside of libtorch_stable.

@cleonard530

Copy link
Copy Markdown
Contributor Author

LGTM though we can do more and move headers that are used at all in libtorch_stable AND are stable themselves to libtorch_stable too right?

In other words, a file doesn't need to only be used in libtorch_stable to be migrated; it can also be used outside of libtorch_stable.

Oh, I misunderstood what you were saying in the comments on #44013, but you're right. Any header that is used to by a libtorch_stable file could be moved with little risk of regressing. I'll add a quick update to move over a few more headers.

@janeyx99

Copy link
Copy Markdown
Contributor

@cleonard530 If this PR is already locally validated, it's ok to land this and then move more files in a new PR too. The important thing is for the files that are migrated to truly be ABI stable. Technically they can include unstable things but if those functions/structs never get used from within the libtorch_stable extension, then the TORCH_TARGET_VERSION flag won't catch that. But your lint might!

@cleonard530

Copy link
Copy Markdown
Contributor Author

@cleonard530 If this PR is already locally validated, it's ok to land this and then move more files in a new PR too. The important thing is for the files that are migrated to truly be ABI stable. Technically they can include unstable things but if those functions/structs never get used from within the libtorch_stable extension, then the TORCH_TARGET_VERSION flag won't catch that. But your lint might!

Sounds good, I will leave this as is then and move the other headers over in future PRs

@Harry-Chen Harry-Chen added the rocm Related to AMD ROCm label Jun 30, 2026
@github-project-automation github-project-automation Bot moved this to Todo in AMD Jun 30, 2026
@Harry-Chen Harry-Chen added the ready ONLY add when PR is ready to merge/full CI is needed label Jun 30, 2026
@mergify

mergify Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Hi @cleonard530, 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.

@cleonard530

Copy link
Copy Markdown
Contributor Author

@Harry-Chen, I checked the failure logs and they don't seem to be related to this PR. Can you rerun the failed test?

@mergify

mergify Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @cleonard530.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Jul 2, 2026
Signed-off-by: Chris Leonard <chleonar@redhat.com>
Signed-off-by: Chris Leonard <chleonar@redhat.com>
Signed-off-by: Chris Leonard <chleonar@redhat.com>
Signed-off-by: Chris Leonard <chleonar@redhat.com>
@cleonard530
cleonard530 force-pushed the new-stable-abi-cleanup branch from d0b24e7 to acc7878 Compare July 2, 2026 11:04
@mergify mergify Bot removed the needs-rebase label Jul 2, 2026
@mergify

mergify Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Hi @cleonard530, 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.

…t to fail

Signed-off-by: Chris Leonard <chleonar@redhat.com>
…_C_stable_libtorch (matches Platform.import_kernels) and importing vllm._qutlass_C (optional library).

Signed-off-by: Chris Leonard <chleonar@redhat.com>

@youkaichao youkaichao 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.

stamp on behalf of @Harry-Chen

@github-project-automation github-project-automation Bot moved this to Ready in NVIDIA Jul 3, 2026
@youkaichao
youkaichao merged commit fbc9ba6 into vllm-project:main Jul 3, 2026
221 of 229 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to Done in NVIDIA Jul 3, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in AMD Jul 3, 2026
@Harry-Chen

Copy link
Copy Markdown
Member
  • A lot of variables that could be const are not. This PR scope is already large (50 files changed) and this update would make it a lot larger without a huge benefit, so I did not update them here.

Does this imply any potential performance improvement, or only semantics and safety guarantee?

@cleonard530

Copy link
Copy Markdown
Contributor Author
  • A lot of variables that could be const are not. This PR scope is already large (50 files changed) and this update would make it a lot larger without a huge benefit, so I did not update them here.

Does this imply any potential performance improvement, or only semantics and safety guarantee?

It would mostly be for semantics/safety. If there were any performance improvements, I think they would be negligible.

jakki-amd pushed a commit to jakki-amd/vllm that referenced this pull request Jul 6, 2026
Signed-off-by: Chris Leonard <chleonar@redhat.com>
lkk12014402 pushed a commit to lkk12014402/vllm that referenced this pull request Jul 8, 2026
Signed-off-by: Chris Leonard <chleonar@redhat.com>
mayuyuace pushed a commit to mayuyuace/vllm that referenced this pull request Jul 9, 2026
Signed-off-by: Chris Leonard <chleonar@redhat.com>
Signed-off-by: mayuyuace <qiming1.zhang@intel.com>
NickLucche pushed a commit to NickLucche/vllm that referenced this pull request Jul 15, 2026
Signed-off-by: Chris Leonard <chleonar@redhat.com>
ayaangazali added a commit to ayaangazali/vllm that referenced this pull request Jul 17, 2026
The docs referenced several paths that no longer exist:

- csrc/layernorm_quant_kernels.cu and
  csrc/quantization/fused_kernels/fused_silu_mul_block_quant.cu moved
  under csrc/libtorch_stable/ in vllm-project#46656
- vllm/worker/model_runner.py was removed with the V0 core in vllm-project#25321;
  CUDA graph replay now happens in vllm/compilation/cuda_graph.py
- vllm/entrypoints/openai/protocol.py no longer holds the transcription
  protocol, which lives in
  vllm/entrypoints/speech_to_text/transcription/protocol.py

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: ayaangazali <ayaangazali.work@gmail.com>
philippesic pushed a commit to philippesic/vllm-semantic-cache that referenced this pull request Jul 19, 2026
Signed-off-by: Chris Leonard <chleonar@redhat.com>
plasticchris pushed a commit to plasticchris/vllm that referenced this pull request Jul 20, 2026
Signed-off-by: Chris Leonard <chleonar@redhat.com>
ayaangazali added a commit to ayaangazali/vllm that referenced this pull request Jul 20, 2026
The docs referenced several paths that no longer exist:

- csrc/layernorm_quant_kernels.cu and
  csrc/quantization/fused_kernels/fused_silu_mul_block_quant.cu moved
  under csrc/libtorch_stable/ in vllm-project#46656
- vllm/worker/model_runner.py was removed with the V0 core in vllm-project#25321;
  CUDA graph replay now happens in vllm/compilation/cuda_graph.py
- vllm/entrypoints/openai/protocol.py no longer holds the transcription
  protocol, which lives in
  vllm/entrypoints/speech_to_text/transcription/protocol.py

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: ayaangazali <ayaangazali.work@gmail.com>
aditi-amd pushed a commit to aditi-amd/vllm that referenced this pull request Aug 4, 2026
Signed-off-by: Chris Leonard <chleonar@redhat.com>
Signed-off-by: root <root@smci355-ccs-aus-m02-09.cs-aus.dcgpu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nvidia ready ONLY add when PR is ready to merge/full CI is needed rocm Related to AMD ROCm

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants