mirror of
https://github.com/handsomezhuzhu/vllm-npu-plugin.git
synced 2026-02-20 19:50:15 +00:00
feat: add CUDA-to-NPU monkey patches for GPUModelRunner compatibility
This commit is contained in:
@@ -9,4 +9,10 @@ class name of the platform implementation.
|
||||
|
||||
def register():
|
||||
"""Return the fully-qualified name of the NPU platform class."""
|
||||
# Apply CUDA→NPU compatibility patches early so that any code
|
||||
# referencing torch.cuda.Stream / Event / etc. will transparently
|
||||
# be redirected to the torch.npu equivalents.
|
||||
from vllm_npu.cuda_compat import _patch_cuda_to_npu
|
||||
_patch_cuda_to_npu()
|
||||
|
||||
return "vllm_npu.platform.NPUPlatform"
|
||||
|
||||
Reference in New Issue
Block a user