Dockerfile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # syntax=docker/dockerfile:1.7
  2. # dsv41-flash + B12X MoE backend (Aiden's overlay #1, aidenle.com
  3. # 2026-09-11): thin FROM wrapper over the sm121-built dsv41-flash:local
  4. # image that adds the b12x kernel package (pip wheel, pure python + a
  5. # small JIT-compiled native) and the persistent JIT cache env.
  6. #
  7. # What changes at runtime (recipe dsv41-flash-4x-b12x):
  8. # --moe-backend b12x (vLLM selects B12X_MXFP4_MXFP8 experts)
  9. # B12X_CACHE_DIR (below) (kernel JIT persists per node via the
  10. # recipe's extra_mount, like the other JITs)
  11. #
  12. # Their measured effect (Aiden, boots B/C, same stack otherwise):
  13. # decode +9% (counting 81->89-93), prefill at 9K +22% (1,932 -> 2,362).
  14. ARG BASE_IMAGE
  15. FROM ${BASE_IMAGE}
  16. ARG B12X_VERSION
  17. # Persistent kernel-JIT location (the recipe bind-mounts a per-node dir).
  18. ENV B12X_CACHE_DIR=/root/.cache/b12x
  19. RUN set -eux; \
  20. pip install --no-cache-dir "b12x==${B12X_VERSION}"; \
  21. python3 -c "import b12x; print('b12x import OK')"; \
  22. # Pre-build the JIT-compiled native so first serves never hit the
  23. # compiler (mirror of the sparkring-shared bridge, but our image ships
  24. # a real /usr/local/cuda-13.0/lib64 with libcudart.so — no symlink hack).
  25. python3 - <<'PY'
  26. import importlib
  27. try:
  28. mod = importlib.import_module("b12x.loader._native")
  29. mod.load()
  30. print("b12x native pre-built")
  31. except ModuleNotFoundError:
  32. print("b12x.loader._native not present in this b12x version — nothing to pre-build")
  33. PY