prepare for sglang+verl (#10555)

Signed-off-by: lbk-sys <hello_lbk@163.com>
Signed-off-by: libaokui <libaokui@hauwei.com>
Co-authored-by: libaokui <libaokui@hauwei.com>
Co-authored-by: Even Zhou <even.y.zhou@outlook.com>
This commit is contained in:
lbk-sys
2025-09-28 16:39:17 +08:00
committed by GitHub
parent a9050b5c39
commit 2a9d995c09

View File

@@ -17,10 +17,18 @@ import torch
from packaging import version
from torch.multiprocessing import reductions
from sglang.srt.utils import is_npu
_is_npu = is_npu()
def monkey_patch_torch_reductions():
"""Monkey patching before Torch https://github.com/pytorch/pytorch/pull/149248 is fixed"""
# Currently, NPU does not support UUID. This has been temporarily commented out, with support expected in the fourth quarter.
if _is_npu:
return
if hasattr(reductions, "_reduce_tensor_original"):
return