[Attention] Fix MLA prefill workspace allocation size (#51733)
Signed-off-by: wzhao18 <wzhao18.sz@gmail.com>
This commit is contained in:
@@ -1705,11 +1705,7 @@ def align_mla_chunked_context_workspace_size(
|
||||
parallel_config.decode_context_parallel_size
|
||||
* parallel_config.cp_kv_cache_interleave_size,
|
||||
)
|
||||
workspace_size = max(
|
||||
workspace_size,
|
||||
vllm_config.scheduler_config.max_num_seqs * alignment,
|
||||
)
|
||||
return round_up(workspace_size, alignment)
|
||||
return round_up(max(workspace_size, alignment), alignment)
|
||||
|
||||
|
||||
def build_mla_chunked_context_metadata(
|
||||
|
||||
@@ -196,10 +196,7 @@ class SparseMLACommonMetadataBuilder(AttentionMetadataBuilder[T]):
|
||||
64 * 1024,
|
||||
scheduler_config.max_num_seqs * topk_tokens,
|
||||
)
|
||||
workspace_size = max(
|
||||
workspace_size,
|
||||
scheduler_config.max_num_seqs * cache_config.block_size,
|
||||
)
|
||||
workspace_size = max(workspace_size, cache_config.block_size)
|
||||
if vllm_config.parallel_config.decode_context_parallel_size > 1:
|
||||
return align_mla_chunked_context_workspace_size(vllm_config, workspace_size)
|
||||
return workspace_size
|
||||
|
||||
Reference in New Issue
Block a user