mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-10 06:45:01 +08:00
[Misc] cache result of disable_inplace (#26666)
Signed-off-by: Bill Nell <bnell@redhat.com>
This commit is contained in:
parent
7ef6052804
commit
60e419c1ee
@ -1,5 +1,6 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||||
|
import functools
|
||||||
from math import prod
|
from math import prod
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
@ -325,5 +326,6 @@ def activation_without_mul(activation: str) -> str:
|
|||||||
# Torch custom ops can't deal with outputs aliasing inputs so we need to
|
# Torch custom ops can't deal with outputs aliasing inputs so we need to
|
||||||
# disable inplace for torch >= 2.9.
|
# disable inplace for torch >= 2.9.
|
||||||
# See https://github.com/vllm-project/vllm/issues/26378
|
# See https://github.com/vllm-project/vllm/issues/26378
|
||||||
|
@functools.cache
|
||||||
def disable_inplace() -> bool:
|
def disable_inplace() -> bool:
|
||||||
return is_torch_equal_or_newer("2.9")
|
return is_torch_equal_or_newer("2.9")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user