From 716034bdd0cc38f18637a6cb882af53d4c77d9d0 Mon Sep 17 00:00:00 2001 From: project6-dev Date: Fri, 14 Aug 2026 01:33:06 +0000 Subject: [PATCH] =?UTF-8?q?fix(OOM):=20lower=20blocks=20cap=205000?= =?UTF-8?q?=E2=86=923000=20=E2=80=94=20flash=5Fattn=20needs=20~4GB=20temp?= =?UTF-8?q?=20buffer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5000 blocks KV cache fills GPU memory, flash_attn_varlen_func OOMs allocating temp attention buffer on first real request. 3000 blocks × 16 = 48K tokens capacity, leaves room for attention. --- qwen3_6_scripts/patch_block_major_worker_capacity.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/qwen3_6_scripts/patch_block_major_worker_capacity.py b/qwen3_6_scripts/patch_block_major_worker_capacity.py index 7cf68e44..e2ba592f 100644 --- a/qwen3_6_scripts/patch_block_major_worker_capacity.py +++ b/qwen3_6_scripts/patch_block_major_worker_capacity.py @@ -21,11 +21,12 @@ CAPACITY_REPLACEMENT = """\ num_gpu_blocks = reserve_block_major_gpu_blocks( num_gpu_blocks, cache_block_size) # BI100: profiling with zero-tensor attention underestimates memory. - # Hardcap at 5000 blocks (80K tokens) to prevent runtime OOM. - if num_gpu_blocks > 5000: + # Hardcap at 3000 blocks (48K tokens) to prevent runtime OOM. + # Must leave ~4GB free for flash_attn_varlen_func temp buffers. + if num_gpu_blocks > 3000: logger.warning( - "[BI100] capping num_gpu_blocks: %d -> 5000", num_gpu_blocks) - num_gpu_blocks = 5000 + "[BI100] capping num_gpu_blocks: %d -> 3000", num_gpu_blocks) + num_gpu_blocks = 3000 num_gpu_blocks = max(num_gpu_blocks, 0) num_cpu_blocks = max(num_cpu_blocks, 0) """