Repository navigation
vllm v0.26.0 compat - #97
Merged
Merged
Conversation
…kernels compile against upstream names
yeahdongcn
approved these changes
Jul 30, 2026
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.
Summary
vLLM v0.26.0 (via vllm-musa) touches two torch surfaces that torch_musa 2.9
does not provide as-is:
torch.accelerator.get_memory_info()— a torch 2.10+ API, absent ontorch_musa 2.9 (engine-core startup hits
AttributeError).csrc/libtorch_stable/use upstream CUDAspellings (
cudaDeviceProp,cudaStream_t,cublasHandle_t,aoti_torch_get_current_cuda_stream, …), but torch_musa's stable ABI onlyexposes the
musa*names.These shims let both build/run unchanged on MUSA, keeping the CUDA→MUSA mapping
in torchada instead of downstream forks.
Changes
_patch.py: maptorch.accelerator.get_memory_info→torch.musa.mem_get_info(same(free, total)contract).csrc/stable_compat/: add#ifndef-guarded CUDA→MUSA aliases solibtorch-stable kernels compile against upstream names —
cuda_runtime.h:cudaDeviceProp,cudaError_t,cudaSuccess,cudaStream_t,cudaGet{DeviceCount,DeviceProperties,Device,ErrorString}cublas_v2.h:cublasHandle_t→mublasHandle_ttorchada_stable_box.h: forwardaoti_torch_get_current_cuda_stream→aoti_torch_get_current_musa_stream; defineTORCH_UTILS_CHECKGuards make each alias a no-op where an mcc porting layer already provides
the name.
Testing
Rebuilt vllm-musa's stable extension (
_C_stable_libtorch) against thistorchada on MTT S5000 (torch_musa 2.9.1). All 4 extensions import; smokes pass:
FP8 quant (Qwen3-8B/32B-FP8), MLA (DeepSeek-V2-Lite-FP8, FLASHMLA), and
multi-GPU stable
custom_all_reduce(Qwen3-32B-FP8, tp2).