[Feature] Avoid flashinfer autotune each time when vllm source change (#54794)
Signed-off-by: yewentao256 <zhyanwentao@126.com>
Wentao Ye committed
Sep 1, 2026 at 15:03 UTC
6c58595c2d0d37c338cd757d55d48f446a68a7da
2 files changed
+9
-6
vllm/config/vllm.py
+7
-3
@@ -438,7 +438,7 @@ class VllmConfig:
438
remaining requests are aborted once the timeout is reached.
439
"""
440
441
- def compute_hash(self) -> str:
441
+ def compute_hash(self, include_version: bool = True) -> str:
442
"""
443
WARNING: Whenever a new field is added to this config,
444
ensure that it is included in the factors list if
@@ -449,14 +449,18 @@ class VllmConfig:
449
graph from input ids/embeddings to the final hidden states,
450
excluding anything before input ids/embeddings and after
451
the final hidden states.
452
+
453
+ Args:
454
+ include_version: Include the vLLM version in the hash.
455
"""
456
factors: list[Any] = []
457
458
# summarize vllm config
459
vllm_factors: list[Any] = []
457
- from vllm import __version__
460
+ if include_version:
461
+ from vllm import __version__
462
459
- vllm_factors.append(__version__)
463
+ vllm_factors.append(__version__)
464
if self.model_config:
465
vllm_factors.append(self.model_config.compute_hash())
466
if (
vllm/model_executor/warmup/flashinfer_autotune_cache.py
+2
-3
@@ -10,15 +10,14 @@ from pathlib import Path
10
from typing import TYPE_CHECKING
11
12
import vllm.envs as envs
13
-from vllm.compilation.caching import aot_compile_hash_factors
13
14
if TYPE_CHECKING:
15
from vllm.v1.worker.gpu_model_runner import GPUModelRunner
16
17
18
def flashinfer_autotune_cache_hash(runner: "GPUModelRunner") -> str:
20
- factors = aot_compile_hash_factors(runner.vllm_config)
21
- return hashlib.sha256(str(factors).encode()).hexdigest()
19
+ config_hash = runner.vllm_config.compute_hash(include_version=False)
20
+ return hashlib.sha256(config_hash.encode()).hexdigest()
21
22
23
def resolve_flashinfer_autotune_file(runner: "GPUModelRunner") -> Path: