fix(build): 消除COPY ./vllm_overrides — vendor_overrides预置到qwen3_6_scripts/
竞赛平台docker build失败,无日志。最大嫌疑: COPY ./vllm_overrides /workspace/vllm_overrides 26e6cb4(成功)只有3个COPY,HEAD多了这第4个COPY。 修复:把9个vllm_overrides文件直接放进qwen3_6_scripts/vendor_overrides/ Dockerfile回到3个COPY(和26e6cb4结构一致),去掉Step 4 staging。 patch_ops.sh不需要改——它已经从./vendor_overrides/读取。 COPY数量: 4→3 (匹配26e6cb4) Dockerfile行数: 74→48 (更简洁) Step数: 8→7 (去掉staging step)
This commit is contained in:
43
Dockerfile
43
Dockerfile
@@ -3,64 +3,37 @@ FROM git.modelhub.org.cn:9443/enginex-iluvatar/bi100-3.2.3-x86-ubuntu20.04-py3.1
|
||||
RUN mkdir -p /workspace
|
||||
WORKDIR /workspace/
|
||||
|
||||
# Copy all sources — ex_engine for build-time .so compilation,
|
||||
# qwen3_6_scripts for patches+prebuilt, vllm_overrides for core fixes
|
||||
# Copy all sources (vendor_overrides pre-staged inside qwen3_6_scripts/)
|
||||
COPY ./qwen3_6_scripts /workspace/qwen3_6_scripts
|
||||
COPY ./computility-run.yaml /workspace/computility-run.yaml
|
||||
COPY ./ex_engine /workspace/ex_engine
|
||||
COPY ./vllm_overrides /workspace/vllm_overrides
|
||||
|
||||
# Step 1: Build EX Engine .so libraries (tolerant of compile failures)
|
||||
# Step 1: Build EX Engine .so libraries
|
||||
RUN chmod +x /workspace/ex_engine/build.sh && \
|
||||
bash /workspace/ex_engine/build.sh --corex 2>&1 | tee /workspace/ex_build.log ; \
|
||||
echo "[Dockerfile] ex_engine build exit code: $?"
|
||||
|
||||
# Step 2: Precompile MoE CUDA kernels (tolerant)
|
||||
# Step 2: Precompile MoE CUDA kernels
|
||||
RUN python3 /workspace/ex_engine/precompile_moe_topk.py 2>&1 | tee -a /workspace/ex_build.log ; \
|
||||
echo "[Dockerfile] moe_topk precompile exit code: $?"
|
||||
|
||||
# Step 3: Precompile vllm v0.5.5 MoE kernels (tolerant)
|
||||
# Step 3: Precompile vllm v0.5.5 MoE kernels
|
||||
RUN python3 /workspace/ex_engine/precompile_moe_kernels.py 2>&1 | tee -a /workspace/ex_build.log ; \
|
||||
echo "[Dockerfile] moe_v055 precompile exit code: $?"
|
||||
|
||||
# Step 4: Stage vendor_overrides into qwen3_6_scripts/ so patch_ops.sh finds them
|
||||
RUN mkdir -p /workspace/qwen3_6_scripts/vendor_overrides/vllm/core/block \
|
||||
/workspace/qwen3_6_scripts/vendor_overrides/vllm/model_executor/layers && \
|
||||
cp /workspace/vllm_overrides/core/evictor_v2.py \
|
||||
/workspace/qwen3_6_scripts/vendor_overrides/vllm/core/evictor_v2.py 2>/dev/null || true && \
|
||||
cp /workspace/vllm_overrides/core/block/cpu_kv_content_cache.py \
|
||||
/workspace/qwen3_6_scripts/vendor_overrides/vllm/core/block/cpu_kv_content_cache.py 2>/dev/null || true && \
|
||||
cp /workspace/vllm_overrides/core/block/cpu_gpu_block_allocator.py \
|
||||
/workspace/qwen3_6_scripts/vendor_overrides/vllm/core/block/cpu_gpu_block_allocator.py 2>/dev/null || true && \
|
||||
cp /workspace/vllm_overrides/core/block/prefix_caching_block.py \
|
||||
/workspace/qwen3_6_scripts/vendor_overrides/vllm/core/block/prefix_caching_block.py 2>/dev/null || true && \
|
||||
cp /workspace/vllm_overrides/core/block/block_table.py \
|
||||
/workspace/qwen3_6_scripts/vendor_overrides/vllm/core/block/block_table.py 2>/dev/null || true && \
|
||||
cp /workspace/vllm_overrides/core/block_manager_v2.py \
|
||||
/workspace/qwen3_6_scripts/vendor_overrides/vllm/core/block_manager_v2.py 2>/dev/null || true && \
|
||||
cp /workspace/vllm_overrides/sampling_params.py \
|
||||
/workspace/qwen3_6_scripts/vendor_overrides/vllm/sampling_params.py 2>/dev/null || true && \
|
||||
cp /workspace/vllm_overrides/model_executor/sampling_metadata.py \
|
||||
/workspace/qwen3_6_scripts/vendor_overrides/vllm/model_executor/sampling_metadata.py 2>/dev/null || true && \
|
||||
cp /workspace/vllm_overrides/model_executor/layers/sampler.py \
|
||||
/workspace/qwen3_6_scripts/vendor_overrides/vllm/model_executor/layers/sampler.py 2>/dev/null || true ; \
|
||||
echo "[Dockerfile] vendor_overrides staged"
|
||||
|
||||
# Step 5: Deploy patches (serving + engine fixes + prebuilt .so)
|
||||
# Step 4: Deploy patches (serving + engine fixes + prebuilt .so)
|
||||
RUN chmod +x /workspace/qwen3_6_scripts/patch_ops.sh && \
|
||||
cd /workspace/qwen3_6_scripts && \
|
||||
bash ./patch_ops.sh 2>&1 | tee /workspace/patch_ops.log ; \
|
||||
echo "[Dockerfile] patch_ops exit code: $?"
|
||||
|
||||
# Step 6: Build ix_unified_bridge.so (ixformer::infer symbols resolved at runtime via RTLD_GLOBAL preload)
|
||||
# Tolerant: bridge is optional — corex_moe.py has ixformer.functions fallback
|
||||
# Step 5: Build ix_unified_bridge.so (ixformer symbols resolved at runtime)
|
||||
RUN chmod +x /workspace/ex_engine/build_unified_bridge.sh && \
|
||||
(bash /workspace/ex_engine/build_unified_bridge.sh 2>&1 || echo "[Dockerfile] bridge build FAILED (non-fatal)") | tee -a /workspace/ex_build.log ; \
|
||||
echo "[Dockerfile] ix_unified_bridge build exit code: $?"
|
||||
|
||||
# Step 7: Deploy ix_unified and ex_engine Python modules to vllm path
|
||||
# Step 6: Deploy ex_engine Python modules to vllm path
|
||||
RUN VLLM_ROOT=$(python3 -c "import vllm; print(vllm.__path__[0])" 2>/dev/null | tail -1 || echo "/usr/local/corex/lib64/python3/dist-packages/vllm") && \
|
||||
echo "VLLM_ROOT=${VLLM_ROOT}" && \
|
||||
cp /workspace/ex_engine/python/ix_unified.py "${VLLM_ROOT}/ix_unified.py" 2>/dev/null || true && \
|
||||
cp /workspace/ex_engine/python/corex_so_loader.py "${VLLM_ROOT}/corex_so_loader.py" 2>/dev/null || true && \
|
||||
cp /workspace/ex_engine/python/moe_fused_dispatch.py "${VLLM_ROOT}/moe_fused_dispatch.py" 2>/dev/null || true && \
|
||||
@@ -69,7 +42,7 @@ RUN VLLM_ROOT=$(python3 -c "import vllm; print(vllm.__path__[0])" 2>/dev/null |
|
||||
fi ; \
|
||||
echo "[Dockerfile] ex_engine Python modules deployed"
|
||||
|
||||
# Step 8: Precompile GDN kernel (needs vllm in path, so after patch_ops)
|
||||
# Step 7: Precompile GDN kernel (needs vllm in path, so after patch_ops)
|
||||
RUN python3 /workspace/qwen3_6_scripts/precompile_gdn.py \
|
||||
/workspace/qwen3_6_scripts/flash_qla_sm70 2>&1 | tee -a /workspace/ex_build.log ; \
|
||||
echo "[Dockerfile] gdn precompile exit code: $?"
|
||||
|
||||
Reference in New Issue
Block a user