[Feature][Frontend] Expose effective attention block size for DCP (#56538)
Co-authored-by: Bugen Zhao <i@bugenzhao.com> Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: Julien Darve <jdarve@NVIDIA.com> Signed-off-by: Bugen Zhao <i@bugenzhao.com>
This commit is contained in:
co-authored by
Bugen Zhao
OpenAI Codex
parent
0d8173d153
commit
f37c550bf6
+20
-1
@@ -85,7 +85,7 @@ from vllm.v1.fault_tolerance.engine_core_sentinel import (
|
||||
EngineCoreSentinel,
|
||||
fault_tolerant_wrapper,
|
||||
)
|
||||
from vllm.v1.kv_cache_interface import KVCacheConfig
|
||||
from vllm.v1.kv_cache_interface import KVCacheConfig, is_full_attention_spec
|
||||
from vllm.v1.metrics.stats import SchedulerIterationDetails, SchedulerStats
|
||||
from vllm.v1.outputs import ModelRunnerOutput
|
||||
from vllm.v1.request import Request, RequestStatus
|
||||
@@ -168,6 +168,7 @@ class EngineCore:
|
||||
block_size=scheduler_block_size,
|
||||
hash_block_size=hash_block_size,
|
||||
)
|
||||
self._initialize_effective_attention_block_size()
|
||||
self.use_spec_decode = vllm_config.speculative_config is not None
|
||||
self.check_for_draft_tokens = (
|
||||
self.use_spec_decode or vllm_config.model_config.is_diffusion
|
||||
@@ -382,6 +383,21 @@ class EngineCore:
|
||||
)
|
||||
return scheduler_kv_cache_config
|
||||
|
||||
def _initialize_effective_attention_block_size(self) -> None:
|
||||
cache_config = self.vllm_config.cache_config
|
||||
cache_config.effective_attention_block_size = None
|
||||
cache_manager = getattr(self.scheduler, "kv_cache_manager", None)
|
||||
if cache_manager is None:
|
||||
return
|
||||
block_sizes = {
|
||||
manager.block_size
|
||||
for manager in cache_manager.coordinator.single_type_managers
|
||||
if is_full_attention_spec(manager.kv_cache_spec)
|
||||
}
|
||||
cache_config.effective_attention_block_size = (
|
||||
block_sizes.pop() if len(block_sizes) == 1 else None
|
||||
)
|
||||
|
||||
def get_supported_tasks(self) -> tuple[SupportedTask, ...]:
|
||||
supported_tasks = self.model_executor.supported_tasks
|
||||
self._log_pooler_config(supported_tasks)
|
||||
@@ -1649,6 +1665,9 @@ class EngineCoreProc(EngineCore):
|
||||
num_gpu_blocks=self.vllm_config.cache_config.num_gpu_blocks or 0,
|
||||
block_size=self.vllm_config.cache_config.block_size,
|
||||
mamba_block_size=self.vllm_config.cache_config.mamba_block_size,
|
||||
effective_attention_block_size=(
|
||||
self.vllm_config.cache_config.effective_attention_block_size
|
||||
),
|
||||
dp_stats_address=self.frontend_stats_publish_address,
|
||||
dtype=str(self.vllm_config.model_config.dtype).removeprefix("torch."),
|
||||
vllm_version=VLLM_VERSION,
|
||||
|
||||
Reference in New Issue
Block a user