fix(build): 回退到comp168(2d5232c)——唯一确认docker build成功的版本
Dockerfile: comp168结构 (2 COPY + 1 RUN, 无ex_engine, 无CUDA编译) qwen3_6_scripts/: comp168内容 (31文件, 141行patch_ops.sh) computility-run.yaml: max_model_len=100000 (comp168=100000, 避免replay 400拒绝) comp168得分: functional=0.923, replay=60194, total=60194 改动: 只有yaml的max_model_len从comp168的100000保持不变
This commit is contained in:
@@ -1,244 +1,141 @@
|
||||
#!/bin/bash
|
||||
# ==========================================================================
|
||||
# PATCH_OPS.SH — Deploy our engine fixes + serving layer
|
||||
set -eo pipefail
|
||||
# BI-V100 engine patches for Qwen3.6-35B-A3B (Qwen3_5 architecture)
|
||||
#
|
||||
# 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
|
||||
# All modifications are FULL FILE REPLACEMENTS — no AST patch scripts.
|
||||
# Each file was read in full from the base image vllm source, modified
|
||||
# with the necessary fixes, and placed here as a complete copy.
|
||||
#
|
||||
# COMP 168 DEPLOYED CUSTOM CODE on top of base image to fix these → 48/52 pass
|
||||
# We must do the same.
|
||||
# ==========================================================================
|
||||
# Base image: git.modelhub.org.cn:9443/enginex-iluvatar/bi100-3.2.3-x86-ubuntu20.04-py3.10-poc-llm-infer:v1.2.3
|
||||
# vllm install path: /usr/local/corex/lib/python3/dist-packages/vllm/
|
||||
|
||||
# CRITICAL: cd into this script's directory so all ./relative paths work
|
||||
# regardless of WORKDIR in Dockerfile or caller's cwd.
|
||||
cd "$(dirname "$0")"
|
||||
echo "[patch_ops] START"
|
||||
echo "[patch_ops] working directory: $(pwd)"
|
||||
|
||||
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
|
||||
[ -z "$VLLM" ] && echo "[patch_ops] ERROR: vllm not found" && exit 1
|
||||
VLLM=/usr/local/corex/lib/python3/dist-packages/vllm
|
||||
VLLM64=/usr/local/corex/lib64/python3/dist-packages/vllm
|
||||
|
||||
# ---- 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] ==========================="
|
||||
|
||||
# ---- 1. Transformers config ----
|
||||
TMODELS=""
|
||||
for P in /usr/local/lib/python3.10/site-packages/transformers/models \
|
||||
/usr/local/corex/lib/python3/dist-packages/transformers/models; do
|
||||
[ -d "$P" ] && TMODELS="$P" && break
|
||||
done
|
||||
if [ -n "$TMODELS" ]; then
|
||||
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"
|
||||
# Deploy to ALL existing vllm paths — Python may load from either one
|
||||
# depending on PYTHONPATH ordering and namespace package resolution.
|
||||
TARGETS=()
|
||||
if [ -d "$VLLM" ]; then
|
||||
TARGETS+=("$VLLM")
|
||||
fi
|
||||
if [ -d "$VLLM64" ]; then
|
||||
TARGETS+=("$VLLM64")
|
||||
fi
|
||||
|
||||
# ---- 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)"
|
||||
|
||||
# 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)"
|
||||
|
||||
# 2c. Registry
|
||||
if grep -q "Qwen3_5ForCausalLM" "$VLLM/model_executor/models/registry.py" 2>/dev/null; then
|
||||
echo "[patch_ops] registry already has Qwen3_5"
|
||||
else
|
||||
cp ./registry.py "$VLLM/model_executor/models/registry.py" 2>/dev/null && \
|
||||
echo "[patch_ops] registry.py deployed"
|
||||
if [ ${#TARGETS[@]} -eq 0 ]; then
|
||||
echo "[patch_ops] ERROR: vllm not found at lib or lib64 path"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 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"
|
||||
echo "[patch_ops] vllm paths found: ${TARGETS[*]}"
|
||||
|
||||
# 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
|
||||
|
||||
# 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"
|
||||
|
||||
# 2i. sequence.py (token count fix)
|
||||
cp ./sequence.py "$VLLM/sequence.py" 2>/dev/null && \
|
||||
echo "[patch_ops] sequence.py deployed"
|
||||
|
||||
# 2j. scheduler.py (cache metrics)
|
||||
cp ./scheduler.py "$VLLM/core/scheduler.py" 2>/dev/null && \
|
||||
echo "[patch_ops] scheduler.py deployed"
|
||||
|
||||
# ---- 3. Serving layer ----
|
||||
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
|
||||
python3 ./patch_vllm_tool_parser.py 2>&1 || true
|
||||
echo "[patch_ops] tool parser deployed"
|
||||
|
||||
cp -r ./reasoning "$VLLM/" 2>/dev/null || true
|
||||
echo "[patch_ops] reasoning parser deployed"
|
||||
|
||||
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"
|
||||
|
||||
# ---- 4. Mirror to VLLM2 ----
|
||||
VLLM2=""
|
||||
for P in /usr/local/corex/lib/python3/dist-packages/vllm \
|
||||
/usr/local/corex/lib64/python3/dist-packages/vllm; do
|
||||
[ -d "$P" ] && [ "$P" != "$VLLM" ] && VLLM2="$P" && break
|
||||
done
|
||||
if [ -n "$VLLM2" ]; then
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
|
||||
# ---- 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
|
||||
|
||||
# ---- 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"
|
||||
# Helper: copy file to all target vllm roots
|
||||
deploy() {
|
||||
local src="$1"
|
||||
local rel_dst="$2" # relative path within vllm, e.g. "attention/ops/paged_attn.py"
|
||||
for V in "${TARGETS[@]}"; do
|
||||
local dst="$V/$rel_dst"
|
||||
mkdir -p "$(dirname "$dst")"
|
||||
cp "$src" "$dst"
|
||||
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
|
||||
# --- _custom_ops.py: SMEM 48KB fix + hardware ops bindings -------------------
|
||||
# Base image returns 32KB (32768) for get_max_shared_memory_per_block, but
|
||||
# BI-V100 actually has 48KB (49152) confirmed via ixsmi. This limits Triton
|
||||
# tile sizes and ixformer internal allocations if not corrected.
|
||||
# CCCL GridEvenShare test (catch2_test_grid_even_share.cu) validates that
|
||||
# work distribution depends on correct hardware parameters — wrong SMEM
|
||||
# means wrong tile_size means wrong grid_size.
|
||||
# FULL FILE REPLACEMENT.
|
||||
deploy ./_custom_ops.py "_custom_ops.py"
|
||||
echo "[patch_ops] _custom_ops.py → / (SMEM 32KB→48KB fix)"
|
||||
|
||||
echo "[patch_ops] DONE"
|
||||
# --- paged_attn.py: pure-PyTorch attention fallback --------------------------
|
||||
deploy ./paged_attn.py "attention/ops/paged_attn.py"
|
||||
echo "[patch_ops] paged_attn.py → attention/ops/"
|
||||
|
||||
# ---- 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
|
||||
# --- prefix_prefill.py: Triton-free prefix attention -------------------------
|
||||
deploy ./prefix_prefill.py "attention/ops/prefix_prefill.py"
|
||||
echo "[patch_ops] prefix_prefill.py → attention/ops/"
|
||||
|
||||
# ---- 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
|
||||
# --- model_runner.py: prefix_cache_hit fix -----------------------------------
|
||||
deploy ./model_runner.py "worker/model_runner.py"
|
||||
echo "[patch_ops] model_runner.py → worker/"
|
||||
|
||||
# --- xformers.py: head_dim>128 fallback + Q-tiling --------------------------
|
||||
deploy ./xformers.py "attention/backends/xformers.py"
|
||||
echo "[patch_ops] xformers.py → attention/backends/"
|
||||
|
||||
# --- arg_utils.py: disable auto chunked-prefill for 32K+ --------------------
|
||||
deploy ./arg_utils.py "engine/arg_utils.py"
|
||||
echo "[patch_ops] arg_utils.py → engine/"
|
||||
|
||||
# --- logits_processor.py: seq_groups=None guard ------------------------------
|
||||
deploy ./logits_processor.py "model_executor/layers/logits_processor.py"
|
||||
echo "[patch_ops] logits_processor.py → model_executor/layers/"
|
||||
|
||||
# --- sampler.py: CCCL-ported top-k fast path for sampling --------------------
|
||||
deploy ./sampler.py "model_executor/layers/sampler.py"
|
||||
echo "[patch_ops] sampler.py → model_executor/layers/"
|
||||
|
||||
# --- transformers: Qwen3_5 tokenizer / model files --------------------------
|
||||
# NOTE: patch_transformers_qwen3_5.py is the ONLY remaining patch script.
|
||||
# It modifies pip-installed transformers' configuration_auto.py and __init__.py
|
||||
# to register qwen3_5/qwen3_5_moe. These files come from pip (version-specific)
|
||||
# so we can't pre-copy them — the patch script inserts lines after known anchors.
|
||||
pip install transformers==4.55.3 -i https://pypi.tuna.tsinghua.edu.cn/simple 2>/dev/null || \
|
||||
pip install transformers==4.55.3 2>/dev/null || \
|
||||
echo "[patch_ops] WARNING: pip install transformers failed, using pre-installed version"
|
||||
cp -r ./qwen3_5 /usr/local/lib/python3.10/site-packages/transformers/models/
|
||||
cp -r ./qwen3_5_moe /usr/local/lib/python3.10/site-packages/transformers/models/
|
||||
python3 ./patch_transformers_qwen3_5.py
|
||||
echo "[patch_ops] transformers Qwen3_5 models installed"
|
||||
|
||||
# --- vllm model: Qwen3.6 (Qwen3_5 arch) ------------------------------------
|
||||
for V in "${TARGETS[@]}"; do
|
||||
cp ./mamba_cache.py "$V/model_executor/models/"
|
||||
done
|
||||
deploy ./qwen3_5.py "model_executor/models/qwen3_5.py"
|
||||
deploy ./registry.py "model_executor/models/registry.py"
|
||||
echo "[patch_ops] qwen3_5.py + registry.py deployed"
|
||||
|
||||
# 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
|
||||
# --- paged_attention_v2_pytorch.py: PyTorch V2 attention fallback ------------
|
||||
for V in "${TARGETS[@]}"; do
|
||||
cp ./paged_attention_v2_pytorch.py "$V/paged_attention_v2_pytorch.py"
|
||||
done
|
||||
cp ./paged_attention_v2_pytorch.py /workspace/paged_attention_v2_pytorch.py
|
||||
echo "[patch_ops] paged_attention_v2_pytorch.py → all paths + /workspace/"
|
||||
|
||||
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/"
|
||||
# --- sequence.py: fix completion_tokens inflation ----------------------------
|
||||
deploy ./sequence.py "sequence.py"
|
||||
echo "[patch_ops] sequence.py → /"
|
||||
|
||||
# --- scheduler.py: record num_cached_tokens ---------------------------------
|
||||
deploy ./scheduler.py "core/scheduler.py"
|
||||
echo "[patch_ops] scheduler.py → core/"
|
||||
|
||||
# --- tool parser: Qwen3 XML tool call format --------------------------------
|
||||
for V in "${TARGETS[@]}"; do
|
||||
cp ./qwen3coder_tool_parser.py "$V/entrypoints/openai/tool_parsers/"
|
||||
cp ./tool_parsers_init.py "$V/entrypoints/openai/tool_parsers/__init__.py"
|
||||
done
|
||||
echo "[patch_ops] qwen3_coder tool parser deployed"
|
||||
|
||||
# --- reasoning parser: Qwen3 <think>...</think> split -----------------------
|
||||
for V in "${TARGETS[@]}"; do
|
||||
cp -r ./reasoning "$V/"
|
||||
cp ./protocol.py "$V/entrypoints/openai/protocol.py"
|
||||
cp ./cli_args.py "$V/entrypoints/openai/cli_args.py"
|
||||
cp ./serving_chat.py "$V/entrypoints/openai/serving_chat.py"
|
||||
cp ./api_server.py "$V/entrypoints/openai/api_server.py"
|
||||
cp ./chat_utils.py "$V/entrypoints/chat_utils.py"
|
||||
done
|
||||
echo "[patch_ops] reasoning parser + serving files installed"
|
||||
|
||||
echo "[patch_ops] DONE — all patches applied via full file replacement"
|
||||
|
||||
Reference in New Issue
Block a user