[Bugfix] Fix PyTorch stable ABI compatibility for permute_cols#1
Closed
[Bugfix] Fix PyTorch stable ABI compatibility for permute_cols#1
Conversation
The PyTorch Stable ABI requires all types to be trivially copyable. Reference types (const Tensor&) are not trivially copyable and cannot be used in STABLE_TORCH_LIBRARY registrations. This fixes build failure when combining PR vllm-project#37491 (CUTLASS upgrade to v4.4.2) with the libtorch stable ABI migration. Also adds missing CUTLASS include directories to _C_stable_libtorch target in CMakeLists.txt.
0e25ff9 to
dbda8eb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Fix build failure when combining PR vllm-project#37491 (CUTLASS upgrade to v4.4.2) with commit 8b10e4f (Migrate permute_cols to libtorch stable ABI). The build fails with:
Root Cause
The PyTorch Stable ABI (introduced in PyTorch 2.10) requires all types to be trivially copyable for serialization between the C-shim and custom ops. Reference types (
const Tensor&) are not trivially copyable and cannot be used as function parameters inSTABLE_TORCH_LIBRARYregistrations.The code in
csrc/libtorch_stable/ops.handcsrc/libtorch_stable/permute_cols.cuuses:This is incompatible with the Stable ABI requirement documented at https://pytorch.org/docs/stable/library.html (see "Stable C++ ABI" /
torch::stablenamespace).Fix
Change function signatures from pass-by-reference to pass-by-value:
csrc/libtorch_stable/ops.h:7-8
csrc/libtorch_stable/permute_cols.cu:70-71
Additional Fix
Also added missing CUTLASS include directories to
_C_stable_libtorchtarget inCMakeLists.txt:1015-1016(matching what_Calready has).Test Plan
Build vllm with both PR vllm-project#37491 applied and commit 8b10e4f present:
VLLM_USE_PRECOMPILED=1 uv pip install -e .Test Result
Build completes successfully on CUDA.
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.Co-authored-by: Claude noreply@anthropic.com