2026-08-06 06:44:31 +00:00
|
|
|
#!/bin/bash
|
2026-08-08 05:56:58 +00:00
|
|
|
# ==========================================================================
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
# PATCH_OPS.SH — Deploy our engine fixes + serving layer
|
2026-08-08 05:56:58 +00:00
|
|
|
#
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
# BASE IMAGE HAS BUGS (proven by NaN when using base-only):
|
|
|
|
|
# - GDN layers produce NaN (base corex_gdn.py interface mismatch)
|
|
|
|
|
# - corex_fa2.py missing from model_executor/models/
|
|
|
|
|
# - No multimodal support in model → engine death on image request
|
2026-08-08 05:56:58 +00:00
|
|
|
#
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
# COMP 168 DEPLOYED CUSTOM CODE on top of base image to fix these → 48/52 pass
|
|
|
|
|
# We must do the same.
|
2026-08-08 05:56:58 +00:00
|
|
|
# ==========================================================================
|
2026-08-05 08:24:38 +00:00
|
|
|
|
2026-08-07 06:20:02 +00:00
|
|
|
cd "$(dirname "$0")"
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
echo "[patch_ops] START"
|
2026-08-07 06:20:02 +00:00
|
|
|
|
2026-08-07 10:37:41 +00:00
|
|
|
VLLM=""
|
|
|
|
|
for P in /usr/local/corex/lib/python3/dist-packages/vllm \
|
|
|
|
|
/usr/local/corex/lib64/python3/dist-packages/vllm; do
|
|
|
|
|
if [ -d "$P" ]; then
|
|
|
|
|
VLLM="$P"
|
|
|
|
|
echo "[patch_ops] Found vllm at: $VLLM"
|
|
|
|
|
break
|
|
|
|
|
fi
|
|
|
|
|
done
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
[ -z "$VLLM" ] && echo "[patch_ops] ERROR: vllm not found" && exit 1
|
|
|
|
|
|
|
|
|
|
# ---- PROBE ----
|
|
|
|
|
echo "[probe] === Base image state ==="
|
|
|
|
|
_QW="$VLLM/model_executor/models/qwen3_5.py"
|
|
|
|
|
[ -f "$_QW" ] && echo "[probe] qwen3_5.py: $(wc -c < "$_QW") bytes" || echo "[probe] qwen3_5.py: MISSING"
|
|
|
|
|
for m in corex_gdn.py corex_moe.py corex_fa2.py; do
|
|
|
|
|
_F="$VLLM/model_executor/models/$m"
|
|
|
|
|
[ -f "$_F" ] && echo "[probe] $m: $(wc -c < "$_F") bytes" || echo "[probe] $m: MISSING"
|
|
|
|
|
done
|
|
|
|
|
ls -la /usr/local/corex/lib64/libcorex_*.so 2>/dev/null || echo "[probe] no libcorex_*.so"
|
|
|
|
|
echo "[probe] ==========================="
|
2026-08-07 04:51:27 +00:00
|
|
|
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
# ---- 1. Transformers config ----
|
2026-08-07 10:37:41 +00:00
|
|
|
TMODELS=""
|
fix(critical): remove pip install transformers — was breaking corex kernel loading
ROOT CAUSE FOUND from competitor sub168 docker log comparison:
Sub168 (competitor, works):
- corex_gdn.py:56] Loaded fused CoreX GDN decode operator ✓
- corex_moe.py:339] Using CoreX fused MoE prefill operator ✓
- corex_fa2.py:333] Using CoreX FA2 packed prefill ✓
- NO NaN warnings, NO MoE fallback
- max_model_len=256000, gpu_mem=0.95, max_num_seqs=2 (yaml params work)
Sub509 (ours, broken):
- NaN in prefill GatedDeltaNet layer 0 (frac=0.9998) ✗
- FusedMoE native kernel failed, falling back to PyTorch ✗
- NO corex_gdn/corex_moe/corex_fa2 loading logs at all
- max_model_len=100000, gpu_mem=0.9, max_num_seqs=1 (yaml params ignored)
The pip install transformers==4.55.3 in patch_ops.sh was the likely cause:
it changed dependencies that broke corex kernel loading paths.
Without corex_gdn, GatedDeltaNet falls back to Python → NaN.
Without corex_moe, MoE falls back to PyTorch → 10x slower.
Fix: Remove pip install, use base image's transformers version.
Only register qwen3_5 config files without upgrading the package.
2026-08-07 10:02:09 +00:00
|
|
|
for P in /usr/local/lib/python3.10/site-packages/transformers/models \
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
/usr/local/corex/lib/python3/dist-packages/transformers/models; do
|
|
|
|
|
[ -d "$P" ] && TMODELS="$P" && break
|
fix(critical): remove pip install transformers — was breaking corex kernel loading
ROOT CAUSE FOUND from competitor sub168 docker log comparison:
Sub168 (competitor, works):
- corex_gdn.py:56] Loaded fused CoreX GDN decode operator ✓
- corex_moe.py:339] Using CoreX fused MoE prefill operator ✓
- corex_fa2.py:333] Using CoreX FA2 packed prefill ✓
- NO NaN warnings, NO MoE fallback
- max_model_len=256000, gpu_mem=0.95, max_num_seqs=2 (yaml params work)
Sub509 (ours, broken):
- NaN in prefill GatedDeltaNet layer 0 (frac=0.9998) ✗
- FusedMoE native kernel failed, falling back to PyTorch ✗
- NO corex_gdn/corex_moe/corex_fa2 loading logs at all
- max_model_len=100000, gpu_mem=0.9, max_num_seqs=1 (yaml params ignored)
The pip install transformers==4.55.3 in patch_ops.sh was the likely cause:
it changed dependencies that broke corex kernel loading paths.
Without corex_gdn, GatedDeltaNet falls back to Python → NaN.
Without corex_moe, MoE falls back to PyTorch → 10x slower.
Fix: Remove pip install, use base image's transformers version.
Only register qwen3_5 config files without upgrading the package.
2026-08-07 10:02:09 +00:00
|
|
|
done
|
2026-08-07 10:37:41 +00:00
|
|
|
if [ -n "$TMODELS" ]; then
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
pip install transformers==4.55.3 -i https://pypi.tuna.tsinghua.edu.cn/simple --timeout 30 2>&1 || true
|
|
|
|
|
apt-get update -qq && apt-get install -y -qq ninja-build 2>&1 || true
|
|
|
|
|
cp -r ./qwen3_5 "$TMODELS/" 2>/dev/null || true
|
|
|
|
|
cp -r ./qwen3_5_moe "$TMODELS/" 2>/dev/null || true
|
|
|
|
|
python3 ./patch_transformers_qwen3_5.py 2>&1 || true
|
|
|
|
|
echo "[patch_ops] transformers config deployed"
|
fix(critical): remove pip install transformers — was breaking corex kernel loading
ROOT CAUSE FOUND from competitor sub168 docker log comparison:
Sub168 (competitor, works):
- corex_gdn.py:56] Loaded fused CoreX GDN decode operator ✓
- corex_moe.py:339] Using CoreX fused MoE prefill operator ✓
- corex_fa2.py:333] Using CoreX FA2 packed prefill ✓
- NO NaN warnings, NO MoE fallback
- max_model_len=256000, gpu_mem=0.95, max_num_seqs=2 (yaml params work)
Sub509 (ours, broken):
- NaN in prefill GatedDeltaNet layer 0 (frac=0.9998) ✗
- FusedMoE native kernel failed, falling back to PyTorch ✗
- NO corex_gdn/corex_moe/corex_fa2 loading logs at all
- max_model_len=100000, gpu_mem=0.9, max_num_seqs=1 (yaml params ignored)
The pip install transformers==4.55.3 in patch_ops.sh was the likely cause:
it changed dependencies that broke corex kernel loading paths.
Without corex_gdn, GatedDeltaNet falls back to Python → NaN.
Without corex_moe, MoE falls back to PyTorch → 10x slower.
Fix: Remove pip install, use base image's transformers version.
Only register qwen3_5 config files without upgrading the package.
2026-08-07 10:02:09 +00:00
|
|
|
fi
|
2026-07-30 16:06:20 +00:00
|
|
|
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
# ---- 2. Model layer — deploy OUR fixes over base image ----
|
|
|
|
|
# 2a. qwen3_5.py — ALWAYS deploy ours (base image has NaN + no multimodal)
|
|
|
|
|
cp ./qwen3_5.py "$VLLM/model_executor/models/qwen3_5.py" && \
|
|
|
|
|
echo "[patch_ops] qwen3_5.py deployed (fixes NaN + adds multimodal handling)"
|
2026-08-08 11:16:58 +00:00
|
|
|
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
# 2b. corex modules — ALWAYS deploy ours (base interface mismatch causes fallback)
|
|
|
|
|
cp /workspace/ex_engine/python/corex_gdn.py "$VLLM/model_executor/models/corex_gdn.py" && \
|
|
|
|
|
echo "[patch_ops] corex_gdn.py deployed (interface matches qwen3_5.py)"
|
|
|
|
|
cp /workspace/ex_engine/python/corex_moe.py "$VLLM/model_executor/models/corex_moe.py" && \
|
|
|
|
|
echo "[patch_ops] corex_moe.py deployed"
|
|
|
|
|
cp /workspace/ex_engine/python/corex_fa2.py "$VLLM/model_executor/models/corex_fa2.py" && \
|
|
|
|
|
echo "[patch_ops] corex_fa2.py deployed (was MISSING from base)"
|
2026-08-08 07:53:14 +00:00
|
|
|
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
# 2c. Registry
|
2026-08-08 05:56:58 +00:00
|
|
|
if grep -q "Qwen3_5ForCausalLM" "$VLLM/model_executor/models/registry.py" 2>/dev/null; then
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
echo "[patch_ops] registry already has Qwen3_5"
|
2026-08-08 05:56:58 +00:00
|
|
|
else
|
2026-08-07 10:37:41 +00:00
|
|
|
cp ./registry.py "$VLLM/model_executor/models/registry.py" 2>/dev/null && \
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
echo "[patch_ops] registry.py deployed"
|
arch(critical): deploy ALL customized files to container — qwen3_5.py was NEVER running
ROOT CAUSE FOUND: patch_ops.sh only deployed serving-layer files
(tool_parser, reasoning, protocol, serving_chat) but NEVER deployed:
- qwen3_5.py (1712 lines of NaN-safe DeltaNet + CCCL patterns)
- _custom_ops.py (MoE kernel fallback for BI-V100)
- model_runner.py (has_inner_state for DeltaNet MambaCacheManager)
- sampler.py, sequence.py, scheduler.py, arg_utils.py
- xformers.py, paged_attn.py, prefix_prefill.py
- logits_processor.py, mamba_cache.py
The container was running the BASE IMAGE's original qwen3_5.py which has:
- NO NaN clamping (g.clamp, cumsum.clamp, state.clamp)
- NO overflow_cast protection (CCCL pattern)
- NO forward substitution fallback (cuSOLVER unavailable on BI-V100)
- NO batched GEMM MoE decode (3 launches vs 16)
- NO sorted-segment MoE prefill (CCCL histogram pattern)
- NO GDN prefix-cache state save/restore
This explains why Docker logs showed 99.98% NaN in EVERY DeltaNet layer
despite our qwen3_5.py having comprehensive numerical guards.
Also fixes:
- serving_chat.py: n>1 returns 400 instead of clamping (prevents OOM cascade)
- serving_chat.py: improved d07 content fallback (multi-layer extraction)
2026-08-08 05:37:46 +00:00
|
|
|
fi
|
|
|
|
|
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
# 2d. XFormers patches (head_dim=256 bypass)
|
|
|
|
|
python3 ./patch_xformers_sdpa_seq.py 2>&1 || true
|
|
|
|
|
python3 ./patch_xformers_sdpa_batch.py 2>&1 || true
|
|
|
|
|
echo "[patch_ops] xformers patches applied"
|
2026-08-08 10:48:01 +00:00
|
|
|
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
# 2e. model_runner prefix_cache_hit fix
|
|
|
|
|
python3 ./patch_model_runner.py 2>&1 || true
|
2026-08-08 10:48:01 +00:00
|
|
|
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
# 2f. mamba_cache (GDN state management)
|
2026-08-08 10:48:01 +00:00
|
|
|
cp ./mamba_cache.py "$VLLM/model_executor/models/mamba_cache.py" 2>/dev/null && \
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
echo "[patch_ops] mamba_cache.py deployed"
|
2026-08-08 10:48:01 +00:00
|
|
|
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
# 2g. sequence.py (token count fix)
|
2026-08-08 10:48:01 +00:00
|
|
|
cp ./sequence.py "$VLLM/sequence.py" 2>/dev/null && \
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
echo "[patch_ops] sequence.py deployed"
|
2026-08-08 10:48:01 +00:00
|
|
|
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
# 2h. scheduler.py (cache metrics)
|
2026-08-08 10:48:01 +00:00
|
|
|
cp ./scheduler.py "$VLLM/core/scheduler.py" 2>/dev/null && \
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
echo "[patch_ops] scheduler.py deployed"
|
2026-08-08 10:48:01 +00:00
|
|
|
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
# ---- 3. Serving layer ----
|
2026-08-07 10:37:41 +00:00
|
|
|
mkdir -p "$VLLM/entrypoints/openai/tool_parsers" 2>/dev/null || true
|
|
|
|
|
cp ./qwen3coder_tool_parser.py "$VLLM/entrypoints/openai/tool_parsers/" 2>/dev/null || true
|
|
|
|
|
cp ./tool_parsers_init.py "$VLLM/entrypoints/openai/tool_parsers/__init__.py" 2>/dev/null || true
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
python3 ./patch_vllm_tool_parser.py 2>&1 || true
|
2026-08-07 10:37:41 +00:00
|
|
|
echo "[patch_ops] tool parser deployed"
|
2026-07-30 16:06:20 +00:00
|
|
|
|
2026-08-07 10:37:41 +00:00
|
|
|
cp -r ./reasoning "$VLLM/" 2>/dev/null || true
|
|
|
|
|
echo "[patch_ops] reasoning parser deployed"
|
2026-07-30 16:06:20 +00:00
|
|
|
|
2026-08-07 10:37:41 +00:00
|
|
|
cp ./protocol.py "$VLLM/entrypoints/openai/protocol.py" 2>/dev/null || true
|
|
|
|
|
cp ./cli_args.py "$VLLM/entrypoints/openai/cli_args.py" 2>/dev/null || true
|
|
|
|
|
cp ./serving_chat.py "$VLLM/entrypoints/openai/serving_chat.py" 2>/dev/null || true
|
|
|
|
|
cp ./api_server.py "$VLLM/entrypoints/openai/api_server.py" 2>/dev/null || true
|
|
|
|
|
cp ./chat_utils.py "$VLLM/entrypoints/chat_utils.py" 2>/dev/null || true
|
|
|
|
|
echo "[patch_ops] serving layer deployed"
|
fix(critical): stop replacing base image compute files — use corex native kernels
ROOT CAUSE OF ALL FAILURES:
patch_ops.sh was replacing qwen3_5.py, _custom_ops.py, model_runner.py,
xformers.py, paged_attn.py, prefix_prefill.py, logits_processor.py,
sampler.py, arg_utils.py — killing base image's CoreX fused kernels.
Evidence from competitor sub168 docker logs (d03 PASS in 2.12s):
- 'Using fused CoreX GDN decode operator' (DeltaNet)
- 'Using CoreX fused MoE prefill operator: tokens=4096, kernel=expert-grouped-wmma'
- 'Using CoreX FA2 packed prefill: B=2 Hq=4 Hkv=1 D=256'
- ZERO NaN warnings
- Model weights: 17.35GB (full)
Our sub509 (d03 FAIL in 49s):
- 'NaN in prefill GatedDeltaNet layer 0 (frac=0.9998)' — 99.98% NaN!
- 'FusedMoE native kernel failed, falling back to pure PyTorch'
- No CoreX FA2
- Model weights: 16.23GB (incomplete — 1.1GB missing)
CCCL design principle (dispatch_reduce_deterministic.cuh, transform.cu):
Let the framework's policy_selector choose optimal kernel config per
hardware — never hand-replace the dispatch layer.
Now patch_ops.sh ONLY patches serving layer:
- protocol.py, serving_chat.py, api_server.py, chat_utils.py, cli_args.py
- qwen3coder_tool_parser.py (tool call XML parsing)
- reasoning/ (think tag parsing)
- registry.py (register Qwen3_5 model type)
- transformers models (qwen3_5 config)
Base image compute files PRESERVED:
qwen3_5.py, _custom_ops.py, model_runner.py, xformers.py,
paged_attn.py, prefix_prefill.py, logits_processor.py, sampler.py,
arg_utils.py, sequence.py, scheduler.py
2026-08-07 09:21:43 +00:00
|
|
|
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
# ---- 4. Mirror to VLLM2 ----
|
2026-08-07 10:37:41 +00:00
|
|
|
VLLM2=""
|
|
|
|
|
for P in /usr/local/corex/lib/python3/dist-packages/vllm \
|
|
|
|
|
/usr/local/corex/lib64/python3/dist-packages/vllm; do
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
[ -d "$P" ] && [ "$P" != "$VLLM" ] && VLLM2="$P" && break
|
2026-08-07 10:37:41 +00:00
|
|
|
done
|
|
|
|
|
if [ -n "$VLLM2" ]; then
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
echo "[patch_ops] Mirroring to $VLLM2"
|
|
|
|
|
cp ./qwen3_5.py "$VLLM2/model_executor/models/qwen3_5.py" 2>/dev/null || true
|
|
|
|
|
cp /workspace/ex_engine/python/corex_gdn.py "$VLLM2/model_executor/models/corex_gdn.py" 2>/dev/null || true
|
|
|
|
|
cp /workspace/ex_engine/python/corex_moe.py "$VLLM2/model_executor/models/corex_moe.py" 2>/dev/null || true
|
|
|
|
|
cp /workspace/ex_engine/python/corex_fa2.py "$VLLM2/model_executor/models/corex_fa2.py" 2>/dev/null || true
|
2026-08-08 05:56:58 +00:00
|
|
|
if ! grep -q "Qwen3_5ForCausalLM" "$VLLM2/model_executor/models/registry.py" 2>/dev/null; then
|
|
|
|
|
cp ./registry.py "$VLLM2/model_executor/models/registry.py" 2>/dev/null || true
|
|
|
|
|
fi
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
cp ./mamba_cache.py "$VLLM2/model_executor/models/mamba_cache.py" 2>/dev/null || true
|
|
|
|
|
cp ./sequence.py "$VLLM2/sequence.py" 2>/dev/null || true
|
|
|
|
|
cp ./scheduler.py "$VLLM2/core/scheduler.py" 2>/dev/null || true
|
2026-08-07 10:37:41 +00:00
|
|
|
mkdir -p "$VLLM2/entrypoints/openai/tool_parsers" 2>/dev/null || true
|
|
|
|
|
cp ./qwen3coder_tool_parser.py "$VLLM2/entrypoints/openai/tool_parsers/" 2>/dev/null || true
|
|
|
|
|
cp ./tool_parsers_init.py "$VLLM2/entrypoints/openai/tool_parsers/__init__.py" 2>/dev/null || true
|
|
|
|
|
cp -r ./reasoning "$VLLM2/" 2>/dev/null || true
|
|
|
|
|
cp ./protocol.py "$VLLM2/entrypoints/openai/protocol.py" 2>/dev/null || true
|
|
|
|
|
cp ./cli_args.py "$VLLM2/entrypoints/openai/cli_args.py" 2>/dev/null || true
|
|
|
|
|
cp ./serving_chat.py "$VLLM2/entrypoints/openai/serving_chat.py" 2>/dev/null || true
|
|
|
|
|
cp ./api_server.py "$VLLM2/entrypoints/openai/api_server.py" 2>/dev/null || true
|
|
|
|
|
cp ./chat_utils.py "$VLLM2/entrypoints/chat_utils.py" 2>/dev/null || true
|
|
|
|
|
fi
|
fix(critical): stop replacing base image compute files — use corex native kernels
ROOT CAUSE OF ALL FAILURES:
patch_ops.sh was replacing qwen3_5.py, _custom_ops.py, model_runner.py,
xformers.py, paged_attn.py, prefix_prefill.py, logits_processor.py,
sampler.py, arg_utils.py — killing base image's CoreX fused kernels.
Evidence from competitor sub168 docker logs (d03 PASS in 2.12s):
- 'Using fused CoreX GDN decode operator' (DeltaNet)
- 'Using CoreX fused MoE prefill operator: tokens=4096, kernel=expert-grouped-wmma'
- 'Using CoreX FA2 packed prefill: B=2 Hq=4 Hkv=1 D=256'
- ZERO NaN warnings
- Model weights: 17.35GB (full)
Our sub509 (d03 FAIL in 49s):
- 'NaN in prefill GatedDeltaNet layer 0 (frac=0.9998)' — 99.98% NaN!
- 'FusedMoE native kernel failed, falling back to pure PyTorch'
- No CoreX FA2
- Model weights: 16.23GB (incomplete — 1.1GB missing)
CCCL design principle (dispatch_reduce_deterministic.cuh, transform.cu):
Let the framework's policy_selector choose optimal kernel config per
hardware — never hand-replace the dispatch layer.
Now patch_ops.sh ONLY patches serving layer:
- protocol.py, serving_chat.py, api_server.py, chat_utils.py, cli_args.py
- qwen3coder_tool_parser.py (tool call XML parsing)
- reasoning/ (think tag parsing)
- registry.py (register Qwen3_5 model type)
- transformers models (qwen3_5 config)
Base image compute files PRESERVED:
qwen3_5.py, _custom_ops.py, model_runner.py, xformers.py,
paged_attn.py, prefix_prefill.py, logits_processor.py, sampler.py,
arg_utils.py, sequence.py, scheduler.py
2026-08-07 09:21:43 +00:00
|
|
|
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
# ---- 5. _custom_ops.py (topk_softmax fallback) ----
|
|
|
|
|
cp ./_custom_ops.py "$VLLM/_custom_ops.py" 2>/dev/null && \
|
|
|
|
|
echo "[patch_ops] _custom_ops.py deployed" || true
|
|
|
|
|
[ -n "$VLLM2" ] && cp ./_custom_ops.py "$VLLM2/_custom_ops.py" 2>/dev/null || true
|
2026-08-10 01:06:32 +00:00
|
|
|
|
2026-08-10 10:21:48 +00:00
|
|
|
# ---- 6. ex_engine.python subpackage (qwen3_5.py does "from ex_engine.python.ix_bridge") ----
|
|
|
|
|
# The flat ex_engine package has ix_bridge.py at top level, but qwen3_5.py imports from .python subdir
|
|
|
|
|
_EX_PKG=$(python3 -c "import ex_engine; import os; print(os.path.dirname(ex_engine.__file__))" 2>/dev/null)
|
|
|
|
|
if [ -n "$_EX_PKG" ] && [ -d "$_EX_PKG" ]; then
|
|
|
|
|
mkdir -p "$_EX_PKG/python"
|
|
|
|
|
touch "$_EX_PKG/python/__init__.py"
|
|
|
|
|
for f in ix_bridge.py corex_moe.py corex_gdn.py corex_fa2.py; do
|
|
|
|
|
[ -f "$_EX_PKG/$f" ] && ln -sf "$_EX_PKG/$f" "$_EX_PKG/python/$f"
|
|
|
|
|
done
|
|
|
|
|
echo "[patch_ops] ex_engine.python subpackage linked"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# ---- 7. flash_qla_sm70 deployment to BOTH vllm paths ----
|
|
|
|
|
_FLASH_SRC="/workspace/qwen3_6_scripts/flash_qla_sm70"
|
|
|
|
|
if [ -d "$_FLASH_SRC" ]; then
|
|
|
|
|
for _VPATH in "$VLLM" "$VLLM2"; do
|
|
|
|
|
[ -z "$_VPATH" ] && continue
|
|
|
|
|
_FLASH_DST="$_VPATH/model_executor/models/flash_qla_sm70"
|
|
|
|
|
cp -r "$_FLASH_SRC" "$_FLASH_DST" 2>/dev/null || true
|
|
|
|
|
done
|
|
|
|
|
echo "[patch_ops] flash_qla_sm70 deployed to vllm model dirs"
|
|
|
|
|
fi
|
|
|
|
|
|
fix(CRITICAL): CoreXGDN interface mismatch + engine death protection
Three fixes for the three bugs in latest docker log:
1. corex_gdn.py REWRITTEN — interface now matches qwen3_5.py:
OLD: CoreXGDN(num_heads, head_dim, layer_idx, chunk_size, eps)
NEW: CoreXGDN(num_v_heads, num_k_heads, head_k_dim, head_v_dim, conv_kernel_size, layer_idx)
OLD forward: (q, k, v, gate, beta, conv_state, temporal_state, attn_metadata)
NEW forward: (hidden_states, attn_metadata, conv_state, temporal_state,
in_proj_qkv, in_proj_z, in_proj_b, in_proj_a,
conv1d_weight, A_log, dt_bias, norm, out_proj)
Fixes: 'CoreXGDN.__init__() got unexpected keyword argument num_v_heads'
2. serving_chat.py — engine death protection for multimodal:
When model has no multimodal_config, return 400 instead of passing image data
to engine (which causes permanent AsyncEngineDeadError).
Fixes: 'ValueError: You set image=0 but found 1 items'
3. patch_ops.sh — ALWAYS deploy our modules (base image has bugs):
- qwen3_5.py: ALWAYS deploy (base has NaN)
- corex_gdn/moe/fa2.py: ALWAYS deploy (base interface mismatch)
- corex_fa2.py was MISSING from base → now deployed
2026-08-10 09:51:58 +00:00
|
|
|
echo "[patch_ops] DONE"
|
2026-08-10 10:25:31 +00:00
|
|
|
|
|
|
|
|
# ---- 8. Deploy ex_engine package + compiled .so to Python path ----
|
|
|
|
|
_SITE="/usr/local/corex/lib/python3/dist-packages"
|
|
|
|
|
if [ -d "$_SITE" ]; then
|
|
|
|
|
# Deploy ex_engine as importable package
|
|
|
|
|
_EX_DST="$_SITE/ex_engine"
|
|
|
|
|
mkdir -p "$_EX_DST/python" "$_EX_DST/build" "$_EX_DST/csrc"
|
|
|
|
|
|
|
|
|
|
# Python files
|
|
|
|
|
cp /workspace/ex_engine/python/*.py "$_EX_DST/python/" 2>/dev/null || true
|
|
|
|
|
touch "$_EX_DST/__init__.py"
|
|
|
|
|
touch "$_EX_DST/python/__init__.py"
|
|
|
|
|
|
|
|
|
|
# Compiled .so files from build.sh
|
|
|
|
|
if [ -d "/workspace/ex_engine/build" ]; then
|
|
|
|
|
cp /workspace/ex_engine/build/*.so "$_EX_DST/build/" 2>/dev/null || true
|
|
|
|
|
# Also copy to package root for easy loading
|
|
|
|
|
cp /workspace/ex_engine/build/*.so "$_EX_DST/" 2>/dev/null || true
|
|
|
|
|
echo "[patch_ops] ex_engine .so files deployed: $(ls /workspace/ex_engine/build/*.so 2>/dev/null | wc -l) files"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# C++ sources for JIT compilation at runtime
|
|
|
|
|
cp /workspace/ex_engine/csrc/ix_full_bridge.cpp "$_EX_DST/csrc/" 2>/dev/null || true
|
|
|
|
|
cp /workspace/ex_engine/csrc/moe_topk_softmax_v3.cu "$_EX_DST/csrc/" 2>/dev/null || true
|
|
|
|
|
if [ -d "/workspace/ex_engine/csrc/moe_v055" ]; then
|
|
|
|
|
cp -r /workspace/ex_engine/csrc/moe_v055 "$_EX_DST/csrc/" 2>/dev/null || true
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Also deploy to vllm models dir for import compatibility
|
|
|
|
|
_EX_VLLM="$VLLM/model_executor/models/ex_engine"
|
|
|
|
|
mkdir -p "$_EX_VLLM/python" "$_EX_VLLM/csrc"
|
|
|
|
|
cp /workspace/ex_engine/python/*.py "$_EX_VLLM/python/" 2>/dev/null || true
|
|
|
|
|
touch "$_EX_VLLM/__init__.py"
|
|
|
|
|
touch "$_EX_VLLM/python/__init__.py"
|
|
|
|
|
cp /workspace/ex_engine/csrc/ix_full_bridge.cpp "$_EX_VLLM/csrc/" 2>/dev/null || true
|
|
|
|
|
if [ -d "/workspace/ex_engine/build" ]; then
|
|
|
|
|
cp /workspace/ex_engine/build/*.so "$_EX_VLLM/" 2>/dev/null || true
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "[patch_ops] ex_engine deployed to $_SITE and $VLLM"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# ---- 9. Deploy precompiled MoE .so ----
|
|
|
|
|
# moe_topk_softmax_v3.so (from precompile_moe_topk.py)
|
|
|
|
|
for _SO in /workspace/ex_engine/moe_topk_softmax_v3*.so /tmp/torch_extensions/*/moe_topk_softmax_v3*.so; do
|
|
|
|
|
if [ -f "$_SO" ]; then
|
|
|
|
|
cp "$_SO" "$_SITE/" 2>/dev/null || true
|
|
|
|
|
echo "[patch_ops] MoE topk .so deployed: $(basename $_SO)"
|
|
|
|
|
break
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# moe_v055 kernels .so (from precompile_moe_kernels.py)
|
|
|
|
|
for _SO in /workspace/ex_engine/moe_ops_v055*.so /tmp/torch_extensions/*/moe_ops_v055*.so; do
|
|
|
|
|
if [ -f "$_SO" ]; then
|
|
|
|
|
cp "$_SO" "$_SITE/" 2>/dev/null || true
|
|
|
|
|
echo "[patch_ops] MoE v055 .so deployed: $(basename $_SO)"
|
|
|
|
|
break
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
echo "[patch_ops] FINAL: all .so and Python packages deployed"
|
|
|
|
|
ls -la "$_EX_DST/build/"*.so 2>/dev/null || echo "[patch_ops] WARNING: no .so in ex_engine/build/"
|