Dockerfile 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # syntax=docker/dockerfile:1.7
  2. # mimo26-spark-vllm: thin FROM wrapper over the r39 b12x vLLM image that
  3. # (1) teaches vLLM's eagle3 aux-hidden-state hook to resolve the interface
  4. # on the inner language model when the outer model is a multimodal wrapper
  5. # (MiMoV2OmniForCausalLM), and (2) makes the DFlash MXFP8 guards tolerate a
  6. # vLLM build without ModelOptMxFp8LinearMethod (r39 predates that class).
  7. # No kernel changes.
  8. #
  9. # Why (2026-09-28): MiMo-V2.6-Flash-MOPD resolves to the Omni architecture
  10. # because the checkpoint ships visual/audio encoders. For method=dflash the
  11. # GPU model runner flips use_aux_hidden_state_outputs=True and then
  12. # set_eagle3_aux_hidden_state_layers() isinstance-checks SupportsEagle3 on
  13. # the OUTER wrapper — which never implements it — and dies with "Model does
  14. # not support EAGLE3 interface" right after weight loading. Everything that
  15. # actually carries aux state (MiMoV2Model + EagleModelMixin) is one level in,
  16. # and _inner_decoder() already knows how to find it.
  17. #
  18. # The patcher is anchor-based and refuses to run against unexpected sources
  19. # (see patches/eagle3-omni-inner.py), so the build FAILS LOUDLY if the base
  20. # vLLM ever restructures that function instead of silently no-oping.
  21. ARG BASE_IMAGE
  22. FROM ${BASE_IMAGE}
  23. COPY patches/eagle3-omni-inner.py /opt/sm121/patches/eagle3-omni-inner.py
  24. COPY patches/dflash-mxfp8-import-optional.py /opt/sm121/patches/dflash-mxfp8-import-optional.py
  25. RUN set -eux; \
  26. python3 /opt/sm121/patches/eagle3-omni-inner.py --apply; \
  27. # Fail the build if the patched module no longer imports or the hook
  28. # regressed to raising on a wrapper-like model.
  29. python3 /opt/sm121/patches/eagle3-omni-inner.py --check; \
  30. python3 -c "import vllm.v1.worker.gpu.spec_decode.eagle.eagle3_utils as m; \
  31. assert 'get_language_model' in open(m.__file__).read(), 'patch vanished'"; \
  32. # DFlash MXFP8 guards must tolerate a vLLM without ModelOptMxFp8LinearMethod.
  33. python3 /opt/sm121/patches/dflash-mxfp8-import-optional.py --apply; \
  34. python3 /opt/sm121/patches/dflash-mxfp8-import-optional.py --check; \
  35. # vLLM's import-time INFO logs land on stdout — grep the actual path line.
  36. SRC="$(python3 -c 'import vllm, os; print(vllm.__path__[0])' 2>/dev/null | grep '^/' | tail -1)"; \
  37. python3 -m py_compile \
  38. "$SRC/v1/worker/gpu/spec_decode/eagle/eagle3_utils.py" \
  39. "$SRC/model_executor/models/qwen3_dflash.py"; \
  40. find /usr/local/lib/python3.12/dist-packages/vllm -name '__pycache__' -type d -prune -exec rm -rf {} + 2>/dev/null || true