Dockerfile 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # MiMo-V2.6-Pro-RL on 8 x DGX Spark (GB10, sm_121a) with SGLang.
  2. #
  3. # Base: lmsysorg/sglang dev-cu13 nightly 2026-09-23 (sglang 06008c17), which
  4. # carries sgl-project/sglang#40448 (MiMo-V2.6 day-0: packed MXFP4 experts,
  5. # DFlash). Older images expand the experts to FP8 and exhaust a Spark.
  6. ARG BASE_IMAGE=lmsysorg/sglang@sha256:5921361fcf358cdde4df1968c941c14157f418613b099ad7f3e5aeed6427ae15
  7. FROM ${BASE_IMAGE}
  8. ARG BASE_IMAGE
  9. LABEL mimo26.base="${BASE_IMAGE}" mimo26.sglang_base_commit="06008c170dae333e22caceb51f36224071f9b5b3"
  10. # Vision/video preprocessing (MiMo processor shells out to ffprobe; audio uses torchcodec).
  11. RUN apt-get update \
  12. && apt-get install -y --no-install-recommends ffmpeg \
  13. && rm -rf /var/lib/apt/lists/* \
  14. && pip install --no-cache-dir torchcodec
  15. # Frozen b12x snapshot qualified on this fabric for DeepSeek SG17 (Apache-2.0).
  16. COPY third_party/b12x/ /opt/b12x/
  17. # Unmerged upstream PRs, applied in order on top of the base commit.
  18. COPY patches/sglang/ /opt/mimo26/patches/sglang/
  19. # rocenante: SGLang hook for the b12x RoCE one-shot all-reduce (ported from the
  20. # DeepSeek V4.1 SG17 build; enabled at runtime with SGLANG8_ROCE_ALLREDUCE=1).
  21. # mimo26-fast-expert-load: skip experts owned by other EP ranks before reading them.
  22. # mimo26-marlin-skip-zero-fill: no zero-fill of Marlin MoE scratch when every expert is local.
  23. # mimo26-fp8-oproj: optional (MIMO26_FP8_OPROJ=1) block-FP8 serving of the BF16 attention o_proj.
  24. # mimo26-dflash-adaptive: optional (MIMO26_DFLASH_ADAPTIVE=1) per-step DFLASH verify width (4 or 8)
  25. # from each request's recent acceptance; FA3/FA4 verify metadata made width-aware.
  26. # mimo26-chunked-admission: a continuing chunked-prefill request no longer counts against free
  27. # request slots (it left the next request queued until one finished).
  28. ARG SGLANG_PRS="40722 40888 38142 40633 40665 29858 rocenante mimo26-fast-expert-load mimo26-marlin-skip-zero-fill mimo26-fp8-oproj mimo26-dflash-adaptive mimo26-chunked-admission"
  29. RUN cd /sgl-workspace/sglang \
  30. && test "$(git rev-parse HEAD)" = 06008c170dae333e22caceb51f36224071f9b5b3 \
  31. && for pr in ${SGLANG_PRS}; do echo "applying $pr"; git apply /opt/mimo26/patches/sglang/$pr.diff || exit 1; done \
  32. && printf '%s\n' ${SGLANG_PRS} > /opt/mimo26/applied-prs.txt \
  33. && PYTHONPATH=/opt/b12x python3 -c "import sglang.srt.models.mimo_v2, sglang.srt.speculative.dflash_worker_v2, sglang.srt.distributed.device_communicators.pynccl; print('import ok')"
  34. # Triton block-FP8 tile tables tuned on GB10 for MiMo's per-rank shapes (decode M<=64;
  35. # M>=256 entries repeat SGLang's default tile so prefill keeps its behaviour).
  36. COPY patches/fp8-configs/ /sgl-workspace/sglang/python/sglang/kernels/ops/quantization/configs/
  37. COPY runtime/ /opt/mimo26/runtime/
  38. ENV TORCH_CUDA_ARCH_LIST=12.1a \
  39. FLASHINFER_CUDA_ARCH_LIST=12.1a \
  40. PYTORCH_CUDA_ALLOC_CONF=expandable_segments:False \
  41. PYTHONUNBUFFERED=1 \
  42. PYTHONPATH=/opt/b12x \
  43. B12X_ROCE_CACHE_DIR=/root/.cache/b12x-roce \
  44. SGLANG_RUST_BUILD_MODE=never
  45. ENTRYPOINT []