[Bugfix][NPU] Register vllm-ascend custom ops in NPUOmniPlatform.set_device (#4712)

Signed-off-by: Weiming Liao <liaowm5@gmail.com>
This commit is contained in:
Weiming Liao authored and GitHub committed 2026-06-25 18:50:08 +08:00
1 parent 8ddcb3621f
commit e500c00545
1 file changed
+6
+6
View File
@@ -44,6 +44,12 @@ class NPUOmniPlatform(OmniPlatform, NPUPlatform):
@classmethod
def set_device(cls, device: torch.device) -> None:
super().set_device(device)
# Register vllm_ascend custom ops (torch.ops._C_ascend.*).
from vllm_ascend.utils import enable_custom_op
enable_custom_op()
# Ascend quantized weights are converted from ND to FRACTAL_NZ
# after loading. Enable internal format so the NZ storage layout
# is preserved for fused NPU kernels.