Skip to content

Commit ac0bb2c

Browse files
authored
[Core] Cache vllm_is_batch_invariant (#28304)
Signed-off-by: Lukas Geiger <lukas.geiger94@gmail.com>
1 parent f31419e commit ac0bb2c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

vllm/model_executor/layers/batch_invariant.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import os
55
from collections import namedtuple
66
from collections.abc import Callable
7+
from functools import cache
78
from typing import Any
89

910
import torch
@@ -857,6 +858,7 @@ def get_batch_invariant_attention_block_size() -> AttentionBlockSize:
857858
return AttentionBlockSize(block_m=16, block_n=16)
858859

859860

861+
@cache
860862
def vllm_is_batch_invariant():
861863
env_key = "VLLM_BATCH_INVARIANT"
862864
is_overridden = False

0 commit comments

Comments
 (0)