[Fast Start] Preload the FlashInfer autotune table on the weight cache daemon (#60085)
Signed-off-by: liusy58 <mg21330037@smail.nju.edu.cn> Signed-off-by: Isotr0py <Isotr0py@outlook.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Isotr0py <Isotr0py@outlook.com>
This commit is contained in:
co-authored by
Claude Opus 5
Isotr0py
parent
3709632ff2
commit
f2376cdc4d
@@ -386,3 +386,34 @@ def test_rejected_cache_retunes_every_rank_in_its_tuning_group(autotune_run, pp,
|
||||
rerun.assert_collectives_match()
|
||||
assert set(rerun.profile_groups) == set(range(tp))
|
||||
assert {rank for rank, _, _ in rerun.saves} == set(range(tp))
|
||||
|
||||
|
||||
def test_autotune_cache_key_normalizes_kv_init_fields():
|
||||
"""mamba_block_size/kv_cache_layout only resolve at engine KV-init time;
|
||||
they must not feed the autotune cache key, or nothing can compute the key
|
||||
before startup (the daemon tunes before any KV init). block_size must
|
||||
stay in the key: the daemon replays the engine's block-size resolution
|
||||
before tuning, and different block sizes may select different ops."""
|
||||
from vllm.config.cache import CacheConfig
|
||||
from vllm.model_executor.warmup.flashinfer_autotune_cache import (
|
||||
_normalize_cache_config_for_hash,
|
||||
)
|
||||
|
||||
fresh = CacheConfig()
|
||||
# Simulate the engine's KV-init write-backs (hybrid model values).
|
||||
mutated = CacheConfig()
|
||||
mutated.mamba_block_size = 512
|
||||
mutated.kv_cache_layout = "LBHNC"
|
||||
|
||||
# Negative control: the write-backs are hashed factors.
|
||||
assert mutated.compute_hash() != fresh.compute_hash()
|
||||
normalized = _normalize_cache_config_for_hash(mutated)
|
||||
assert normalized.compute_hash() == fresh.compute_hash()
|
||||
# Factory state is returned untouched.
|
||||
assert _normalize_cache_config_for_hash(fresh) is fresh
|
||||
# block_size stays significant (the daemon keys on the resolved value).
|
||||
resolved = CacheConfig(block_size=64)
|
||||
assert (
|
||||
_normalize_cache_config_for_hash(resolved).compute_hash()
|
||||
!= fresh.compute_hash()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user