2026-07-30 15:33:44 +00:00
|
|
|
FROM git.modelhub.org.cn:9443/enginex-iluvatar/bi100-3.2.3-x86-ubuntu20.04-py3.10-poc-llm-infer:v1.2.3
|
|
|
|
|
|
2026-08-11 07:58:05 +00:00
|
|
|
RUN mkdir -p /workspace
|
feat(CRITICAL): import wudixzy/competition complete corex stack — 12 prebuilt .so + 13 CUDA kernels + 2615-line qwen3_5.py
Source: github.com/wudixzy/competition (1527 files, BI-V100 competition reference)
Imported assets:
- 12 prebuilt CoreX .so extensions (corex-3.2.3-ivcore10):
corex_gdn_{beta_decay,causal_conv,gated_norm,packed_decode,qk_map}.so
corex_moe_{direct_routed,exact_reduce,weight_gather}.so
corex_attn_head_rms_norm.so, corex_paged_kv_gather.so
corex_block_major_kv_transfer.so, corex_fused_paged_prefill.so
- 13 CUDA kernel sources (.cu) for above extensions
- 11 build scripts (build_corex_*.sh)
- install_prebuilt_corex.sh (SHA256-verified .so deployment)
- qwen3_5.py (2615 lines) with FULL corex kernel integration
- 9 vllm vendor override files (block manager, sampler, etc)
- 19 patch scripts (model_runner, xformers, block_major, etc)
- Complete serving layer (serving_chat, protocol, api_server, etc)
- bi100_env.py, bi100_profile.py, gdn_prefix.py, block_major_kv_cache.py
- Dockerfile aligned with reference build chain
- computility-run.yaml with BI100_MOE_COREX_DIRECT_ROUTED=1
Call chain verified:
Dockerfile COPY → patch_ops.sh → install_prebuilt_corex.sh → 12 .so to $VLLM_ROOT
qwen3_5.py imports: from vllm import corex_gdn_* / corex_moe_* / corex_attn_*
2026-08-11 03:55:38 +00:00
|
|
|
WORKDIR /workspace/
|
2026-08-11 07:58:05 +00:00
|
|
|
|
2026-08-11 09:35:41 +00:00
|
|
|
# Copy all sources (vendor_overrides pre-staged inside qwen3_6_scripts/)
|
2026-07-30 15:33:44 +00:00
|
|
|
COPY ./qwen3_6_scripts /workspace/qwen3_6_scripts
|
2026-08-11 07:58:05 +00:00
|
|
|
COPY ./computility-run.yaml /workspace/computility-run.yaml
|
|
|
|
|
COPY ./ex_engine /workspace/ex_engine
|
|
|
|
|
|
2026-08-11 09:35:41 +00:00
|
|
|
# Step 1: Build EX Engine .so libraries
|
2026-08-11 07:58:05 +00:00
|
|
|
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: $?"
|
|
|
|
|
|
2026-08-11 09:35:41 +00:00
|
|
|
# Step 2: Precompile MoE CUDA kernels
|
2026-08-11 07:58:05 +00:00
|
|
|
RUN python3 /workspace/ex_engine/precompile_moe_topk.py 2>&1 | tee -a /workspace/ex_build.log ; \
|
|
|
|
|
echo "[Dockerfile] moe_topk precompile exit code: $?"
|
|
|
|
|
|
2026-08-11 09:35:41 +00:00
|
|
|
# Step 3: Precompile vllm v0.5.5 MoE kernels
|
2026-08-11 07:58:05 +00:00
|
|
|
RUN python3 /workspace/ex_engine/precompile_moe_kernels.py 2>&1 | tee -a /workspace/ex_build.log ; \
|
|
|
|
|
echo "[Dockerfile] moe_v055 precompile exit code: $?"
|
|
|
|
|
|
2026-08-11 09:35:41 +00:00
|
|
|
# Step 4: Deploy patches (serving + engine fixes + prebuilt .so)
|
2026-08-11 07:58:05 +00:00
|
|
|
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 ; \
|
2026-08-11 07:01:51 +00:00
|
|
|
echo "[Dockerfile] patch_ops exit code: $?"
|
2026-08-11 07:58:05 +00:00
|
|
|
|
2026-08-11 09:35:41 +00:00
|
|
|
# Step 5: Build ix_unified_bridge.so (ixformer symbols resolved at runtime)
|
2026-08-11 07:58:05 +00:00
|
|
|
RUN chmod +x /workspace/ex_engine/build_unified_bridge.sh && \
|
2026-08-11 09:33:21 +00:00
|
|
|
(bash /workspace/ex_engine/build_unified_bridge.sh 2>&1 || echo "[Dockerfile] bridge build FAILED (non-fatal)") | tee -a /workspace/ex_build.log ; \
|
2026-08-11 07:58:05 +00:00
|
|
|
echo "[Dockerfile] ix_unified_bridge build exit code: $?"
|
|
|
|
|
|
2026-08-11 09:35:41 +00:00
|
|
|
# Step 6: Deploy ex_engine Python modules to vllm path
|
2026-08-11 09:28:21 +00:00
|
|
|
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") && \
|
2026-08-11 07:58:05 +00:00
|
|
|
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 && \
|
2026-08-11 09:28:21 +00:00
|
|
|
if ls /workspace/ex_engine/build/ix_unified_bridge*.so 1>/dev/null 2>&1; then \
|
2026-08-11 07:58:05 +00:00
|
|
|
cp /workspace/ex_engine/build/ix_unified_bridge*.so "${VLLM_ROOT}/" 2>/dev/null || true ; \
|
|
|
|
|
fi ; \
|
|
|
|
|
echo "[Dockerfile] ex_engine Python modules deployed"
|
|
|
|
|
|
2026-08-11 09:35:41 +00:00
|
|
|
# Step 7: Precompile GDN kernel (needs vllm in path, so after patch_ops)
|
2026-08-11 07:58:05 +00:00
|
|
|
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: $?"
|