From 539d0fc6ff3767ca8e3912bad2edf27a6729a693 Mon Sep 17 00:00:00 2001 From: project6-dev Date: Mon, 10 Aug 2026 13:10:02 +0000 Subject: [PATCH] =?UTF-8?q?fix(CRITICAL):=20deploy=20paged=5Fattn.py=20?= =?UTF-8?q?=E2=80=94=20NameError=20context=5Fattention=5Ffwd=20kills=20eng?= =?UTF-8?q?ine=20on=20first=20request?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause: base image paged_attn.py imports Triton context_attention_fwd which does not exist on BI-V100 (no Triton). Our paged_attn.py replaces it with PyTorch fallback but was NEVER deployed — missing from patch_ops.sh. SYSTEM_DESIGN.md step 9 lists it, patch_ops.sh didn't have it. Also deploys prefix_prefill.py as safety net. Error was: paged_attn.py:203 NameError: name 'context_attention_fwd' is not defined → AsyncEngineDeadError → all requests 503 --- qwen3_6_scripts/patch_ops.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/qwen3_6_scripts/patch_ops.sh b/qwen3_6_scripts/patch_ops.sh index 291b0b90..47cf1e89 100755 --- a/qwen3_6_scripts/patch_ops.sh +++ b/qwen3_6_scripts/patch_ops.sh @@ -77,18 +77,30 @@ python3 ./patch_xformers_sdpa_seq.py 2>&1 || true python3 ./patch_xformers_sdpa_batch.py 2>&1 || true echo "[patch_ops] xformers patches applied" -# 2e. model_runner prefix_cache_hit fix +# 2e. paged_attn.py — CRITICAL: base image uses Triton context_attention_fwd which hangs BI-V100 +cp ./paged_attn.py "$VLLM/attention/ops/paged_attn.py" && \ + echo "[patch_ops] paged_attn.py deployed (replaces Triton context_attention_fwd with PyTorch)" +[ -n "$VLLM2" ] && cp ./paged_attn.py "$VLLM2/attention/ops/paged_attn.py" 2>/dev/null || true + +# 2f. prefix_prefill.py — provides context_attention_fwd if anything still imports it +if [ -f "./prefix_prefill.py" ]; then + cp ./prefix_prefill.py "$VLLM/attention/ops/prefix_prefill.py" && \ + echo "[patch_ops] prefix_prefill.py deployed" + [ -n "$VLLM2" ] && cp ./prefix_prefill.py "$VLLM2/attention/ops/prefix_prefill.py" 2>/dev/null || true +fi + +# 2g. model_runner prefix_cache_hit fix python3 ./patch_model_runner.py 2>&1 || true -# 2f. mamba_cache (GDN state management) +# 2h. mamba_cache (GDN state management) cp ./mamba_cache.py "$VLLM/model_executor/models/mamba_cache.py" 2>/dev/null && \ echo "[patch_ops] mamba_cache.py deployed" -# 2g. sequence.py (token count fix) +# 2i. sequence.py (token count fix) cp ./sequence.py "$VLLM/sequence.py" 2>/dev/null && \ echo "[patch_ops] sequence.py deployed" -# 2h. scheduler.py (cache metrics) +# 2j. scheduler.py (cache metrics) cp ./scheduler.py "$VLLM/core/scheduler.py" 2>/dev/null && \ echo "[patch_ops] scheduler.py deployed"