Skip to content

[revert] [Build] Fix QuTLASS compilation with PyTorch 2.13 - #61844

Open
cleonard530 wants to merge 8 commits into
vllm-project:mainfrom
cleonard530:add_torch_target_version_tag_back_to_qutlass
Open

cleonard530 wants to merge 8 commits into
vllm-project:mainfrom
cleonard530:add_torch_target_version_tag_back_to_qutlass

Conversation

@cleonard530

@cleonard530 cleonard530 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Overview

This PR is to revert the changes in #58173, and to add a check to make sure this doesn't happen again. I believe what happened was that a local old version of QuTLASS, before it was migrated to the stable ABI, was being built against the new flags that help ensure QuTLASS stays stable. So I also added a check in here to make sure that a version of QuTLASS after this update is being used. This checks for the file qutlass/csrc/include/registration.h which was only added after the migration.

cc @Harry-Chen @janeyx99

Validation

main branch:
torch-abi-audit vllm:
image

this branch
build succeeds and
[STABLE ] [abi3-ok ] _qutlass_C.abi3.so (stable_shim=60, unstable=0) min-torch=2.11.0

Note: the drop in the number of stable_shim comes from internal implementation differences in torch/stable. Particularly the inclusions of torch_exception_get_what, torch_exception_get_what_without_backtrace, and torch_new_stable_ivalue in 2.13.


Pull Request Checklist
  • I used vLLM's /pr-checklist skill. (Mandatory for agents, optional for humans).

  • AI assistance was used during the creation of this PR.

  • Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.

  • Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.

  • Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.

  • Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.

Signed-off-by: Chris Leonard <chleonar@redhat.com>
Signed-off-by: Chris Leonard <chleonar@redhat.com>
@mergify mergify Bot added the ci/build label Oct 15, 2026
@Harry-Chen Harry-Chen changed the title [revert] [Compilation] Fix QuTLASS compilation with PyTorch 2.13 [revert] [Build] Fix QuTLASS compilation with PyTorch 2.13 Oct 15, 2026
@Harry-Chen
Harry-Chen marked this pull request as ready for review October 15, 2026 15:33
Copilot AI balanced review requested due to automatic review settings October 15, 2026 15:33

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

@Harry-Chen Harry-Chen added the ready ONLY add when PR is ready to merge/full CI is needed label Oct 15, 2026
@Harry-Chen

Copy link
Copy Markdown
Member

@yewentao256 PTAL.

@github-actions

Copy link
Copy Markdown

✅ @cleonard530, CI is now available for this PR.

  • /ci run starts upstream CI; /amd-ci run starts AMD CI only.
  • Run commands test your branch with every commit currently on its upstream target branch. If it is behind, the bot merges the target branch into it first (pull before pushing again). Append --allow-stale to a run command to test an outdated branch as is, at your own risk.
  • /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.
  • /amd-ci retry retries failed jobs in AMD CI for the current PR head. Use /amd-ci run when the current head has no AMD CI build.
  • /ci cancel cancels scheduled or running CI builds for this PR branch; /amd-ci cancel does the same for AMD CI only.

@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 for the catch!

@Harry-Chen

Copy link
Copy Markdown
Member

Although they are orthogonal, it may be better to land this after #61700 is merged

Copilot AI 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.

🟢 Approval recommended

No blocking issues remain, and the reported successful build and ABI audit support the restored configuration.

0 open findings

What changed in this PR

Reverts #58173’s QuTLASS build workaround to restore PyTorch stable ABI targeting and reject incompatible source trees.

Changes:

  • Checks for the header introduced by QuTLASS’s stable ABI migration.
  • Restores the PyTorch 2.11 target definition and removes QUTLASS_DISABLE_PYBIND.
File Description
cmake/​external_projects/​qutlass.cmake Restores stable ABI build settings and adds a source compatibility guard.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@yewentao256 yewentao256 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 for the work!

Since vLLM main already pins PyTorch 2.13 API by default for 3 weeks (and pin 2.14 as the pip requirement), and seems no severe bugs found in community, I am not sure if we do want to convert it back?

@ZJY0516

ZJY0516 commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Thanks for the work!

Since vLLM main already pins PyTorch 2.13 API by default for 3 weeks (and pin 2.14 as the pip requirement), and seems no severe bugs found in community, I am not sure if we do want to convert it back?

Many vLLM users will use their own pytorch version, so we also need to consider backward compatibility

@Harry-Chen

Copy link
Copy Markdown
Member

Thanks for the work!

Since vLLM main already pins PyTorch 2.13 API by default for 3 weeks (and pin 2.14 as the pip requirement), and seems no severe bugs found in community, I am not sure if we do want to convert it back?

I think the main purpose is not compatibility, but to correctly mark TORCH_TARGET_VERSION (to enforce ABI stability) and detect outdated source trees.

@Harry-Chen

Copy link
Copy Markdown
Member

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #95323 for commit 3189a2ca108b.

@Harry-Chen

Copy link
Copy Markdown
Member

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #95380 for commit 4e19ec8050f3.

@cleonard530

Copy link
Copy Markdown
Contributor Author

@yewentao256, as @ZJY0516 and @Harry-Chen mentioned, this can allow users to use their own pytorch version and help enforce ABI stability.

For some additional context, with the current setup, QuTLASS could use symbols that are allowed under whatever version it's built with (in this case 2.13). So vLLM now has a minimum torch version of 2.13, when it could have as low as 2.11 (see new image of torch-abi-audit in description). Migrating vLLM to the stable ABI allows us to build against one PyTorch version and run against any version at or above TORCH_TARGET_VERSION, without rebuilding. However, because of this single dependency, we're unnecessarily excluding two PyTorch versions that vLLM could otherwise support. This could be inconvenient for developers who want to use older PyTorch versions without rebuilding, as well as distributors who want to package wheels for multiple PyTorch versions without maintaining a separate build for each one.

And as @Harry-Chen mentioned, this flag help us enforce that QuTLASS does not bring in any unstable symbols (the bug that caused the original PR was really a feature!). There is a CI check as well to make sure this doesn't happen, but this is an extra safeguard in case that CI check fails.

I am not surprised that this has not caused bugs, as it's a very particular use case, and a developer probably would've just updated python if they ran into this, but I still think it's worth adding it back for the reasons described above.

Let me know what you think or if you have any questions!

@yewentao256

Copy link
Copy Markdown
Member
  1. backward compatibility
    Yeah agree with @Harry-Chen, as we already list torch==2.14.0 in requirements.txt so it is not the main concern

  2. I am not actually against pinning a version, I am concerned as we already running torch 2.13 abi well for over 3+weeks, changing back to 2.11 is actually a breaking change.

So I am thinking we should pin 2.13 version instead?

@Harry-Chen

Copy link
Copy Markdown
Member
  1. I am not actually against pinning a version, I am concerned as we already running torch 2.13 abi well for over 3+weeks, changing back to 2.11 is actually a breaking change.

This should not be an issue IMHO. Anyhow we have not announced any ABI stability for vLLM yet. And setting the lowest possible torch version does not bring obvious harm.

@cleonard530

Copy link
Copy Markdown
Contributor Author

I agree with @Harry-Chen that I doubt lowering it would bring harm. But, @yewentao256, if your concern is that Qutlass has been using 2.13 for weeks, and dropping it lower might break what we know works, then we could raise it to 2.13. I think it's better to have some torch_version instead of nothing.

@yewentao256

Copy link
Copy Markdown
Member

It theoretically shouldn't make trouble if pinning 2.11, but still not well tested in current main branch. So agree with @cleonard530 pinning 2.13 would be better in current situation

@janeyx99

Copy link
Copy Markdown
Contributor

For all libraries that depend on QuTLASS it would be ideal for the torch version pin to be as low as possible, but I understand the concern of not wanting to promise something that’s not well tested. Another thing to keep in mind is that this pin is mostly used as binary metadata and the README/documentation/runtime requirements can still recommend 2.13 as the tested version. This way we don’t block others from going off the beaten path and using the binary with 2.11 or 2.12.

Otherwise, is there a process for how we can test to ensure that 2.11 works well too?

@Harry-Chen

Copy link
Copy Markdown
Member

/ci retry

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #95676 for commit bef0d6426f21, running 21 failed step(s) from Buildkite CI #95380.

@Harry-Chen

Copy link
Copy Markdown
Member

For all libraries that depend on QuTLASS it would be ideal for the torch version pin to be as low as possible, but I understand the concern of not wanting to promise something that’s not well tested. Another thing to keep in mind is that this pin is mostly used as binary metadata and the README/documentation/runtime requirements can still recommend 2.13 as the tested version. This way we don’t block others from going off the beaten path and using the binary with 2.11 or 2.12.

Otherwise, is there a process for how we can test to ensure that 2.11 works well too?

@yewentao256 Maybe let's land this as a quick fix? And I think @cleonard530 is planning on some formal stable ABI checks in the near term to prevent future breaks.

QUTLASS_DISABLE_PYBIND=1
TARGET_CUDA_ARCH=${QUTLASS_TARGET_CC}
CUTLASS_ENABLE_DIRECT_CUDA_DRIVER_CALL=1
TORCH_TARGET_VERSION=0x020B000000000000ULL

@yewentao256 yewentao256 Oct 19, 2026 •

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.

Suggested change
TORCH_TARGET_VERSION=0x020B000000000000ULL
TORCH_TARGET_VERSION=0x020D000000000000ULL

@Harry-Chen I think we should pin 2.13 now to avoid a breaking change based on current situation
Fully agree that should have some more checks here to avoid changes of the code by accident

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.

I still don't think setting to 2.11 will be a breaking change, because as long as the code compiles with 2.11, they are compatible with libtorch 2.11+, given the nature of how libtorch stable ABI works. Nothing changes for the user IMHO, until they decide that they will try to reuse a .so file from different commits / release with build system changes, which is not desired to work by design.

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.

It might still break some user specific env, eg. that's why we have #58173 to fix for our customer.

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.

We don't know if the changes will bring more bugs here as current main built based on 2.13 close to one month

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.

I and @cleonard530 think #58173 was because a stale version of cutlass was checked out in the source tree. And this PR exactly adds a check against this situation, not to work around it by disabling stable ABI checks: https://github.com/vllm-project/vllm/pull/61844/changes#diff-cc0576febbd89620d5e7a9b3dc8ff346e44df0b4e2c8a6ecaba019668c05fe8cR55-R60

I did not know about the specific environment, but the release pipeline never failed before or after #58173:

image

We don't know if the changes will bring more bugs here as current main built based on 2.13 close to one month

That flag does not change the version qutlass is built against, but just works as a feature gate. The APIs you can use with 2.11 is a strict subset of what you can use with 2.13. But it is always built against the latest pytorch headers, 2.14 today.

@yewentao256 yewentao256 Oct 19, 2026 •

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.

Feature gate doesn't mean the code is exactly same https://github.com/pytorch/pytorch/blob/2b3ec34829036a65cd9d1398ea72a0167dc37470/torch/csrc/stable/macros.h#L114, for instance

My concern is about the change in compiled behavior, while targeting 2.11 should theoretically be compatible, it doesn't necessarily produce the same binary behavior as targeting 2.13.

Since the lower target hasn't been well tested in the current setup, I'd prefer either keeping 2.13 for this fix.
(I don't think just standard CI runs are enough, as users and customers have many specific envs, you never know what will happen in their situation)

@mergify

mergify Bot commented Oct 21, 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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build 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.

6 participants