[NPU] fix model llava-onevision-qwen2-7b-ov torch compiles error in npu case (#26573)

This commit is contained in:
ZeyuanChen2000
2026-05-30 17:10:58 +08:00
committed by GitHub
parent 714bcd84e2
commit 90eb894564
@@ -1,10 +1,12 @@
import torch
from sglang.srt.sampling.penaltylib.orchestrator import _BatchedPenalizer
from sglang.srt.utils import get_compiler_backend
from sglang.srt.utils import get_compiler_backend, is_npu
_is_npu = is_npu()
@torch.compile(dynamic=True, backend=get_compiler_backend())
@torch.compile(dynamic=True, backend=get_compiler_backend(), disable=_is_npu)
def apply_scaling_penalties(logits, scaling_penalties):
logits[:] = torch.where(
logits < 0,