A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 14, 05:30 UTC
[Misc] cache result of disable_inplace (#26666)
Signed-off-by: Bill Nell <bnell@redhat.com>
bnellnm committed
Oct 12, 2025 at 20:17 UTC
60e419c1eeef90425acbd6d34bfadf4202707507
1 file changed
+2
vllm/model_executor/layers/fused_moe/utils.py
+2
@@ -1,5 +1,6 @@
1
# SPDX-License-Identifier: Apache-2.0
2
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
+import functools
4
from math import prod
5
6
import torch
@@ -325,5 +326,6 @@ def activation_without_mul(activation: str) -> str:
326
# Torch custom ops can't deal with outputs aliasing inputs so we need to
327
# disable inplace for torch >= 2.9.
328
# See https://github.com/vllm-project/vllm/issues/26378
329
+@functools.cache
330
def disable_inplace() -> bool:
331
return is_torch_equal_or_newer("2.9")