From b5ea0c71078bdbb0f1f9afd934d55156273fe5f8 Mon Sep 17 00:00:00 2001 From: Simon Danielsson <70206058+simondanielsson@users.noreply.github.com> Date: Wed, 23 Sep 2026 18:44:12 +0200 Subject: [PATCH] [Bugfix][ROCm] Fix startup OOM in AITER MLA FP8 prefill workspace sizing (#57923) Signed-off-by: simondanielsson --- vllm/v1/attention/backends/mla/rocm_aiter_mla.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/vllm/v1/attention/backends/mla/rocm_aiter_mla.py b/vllm/v1/attention/backends/mla/rocm_aiter_mla.py index bad6ed201b..3728a451a7 100644 --- a/vllm/v1/attention/backends/mla/rocm_aiter_mla.py +++ b/vllm/v1/attention/backends/mla/rocm_aiter_mla.py @@ -772,9 +772,18 @@ class AiterMLAMetadataBuilder(MLACommonMetadataBuilder[AiterMLAMetadata]): device=device, ) + from vllm.platforms import current_platform from vllm.v1.worker.workspace import current_workspace_manager - max_num_partial_tiles = reduce_partial_map_size + # AITER metadata sizing assumes all requests can carry max_prefill_qlen tokens, + # which is a loose worst case in the number of QO tiles. Rather, the sum of + # qlens is bounded by max_num_batched_tokens. Manually compute the number of + # qo tiles to avoid OOM at startup. + # TODO: AITER should give us this budget constrained value + qo_tile_cnt = ( + cdiv(max_num_batched_tokens, _FP8_PREFILL_TILE_Q) + max_num_reqs - 1 + ) + max_num_partial_tiles = qo_tile_cnt + current_platform.num_compute_units() reservations: list[tuple[tuple[int, ...], torch.dtype]] = [ ( (max_num_partial_tiles * _FP8_PREFILL_TILE_Q, num_head_k, v_head_dim),