소스 검색

docker-images: dsv41-flash-b12x

Alexander Korolev 1 주 전
부모
커밋
fee7b48cf9
3개의 변경된 파일과 72개의 추가작업 그리고 0개의 파일을 삭제
  1. 37 0
      docker-images/dsv41-flash-b12x/Dockerfile
  2. 29 0
      docker-images/dsv41-flash-b12x/build.sh
  3. 6 0
      docker-images/dsv41-flash-b12x/versions.env

+ 37 - 0
docker-images/dsv41-flash-b12x/Dockerfile

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

+ 29 - 0
docker-images/dsv41-flash-b12x/build.sh

@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+# Build the dsv41-flash B12X wrapper (thin FROM over the sm121-built base).
+#
+# Uses the classic docker builder (not buildx docker-container): the base
+# image dsv41-flash:local is local-only (never pushed to a registry), and
+# the container-driver builder cannot resolve local FROM references.
+#
+# Generic driver: forwards every KEY=VAL pin in versions.env as a
+# --build-arg to the Dockerfile (no hardcoded variable list). The sm121
+# launcher writes a merged versions.env here when a recipe carries
+# [build.versions] overrides (recipe wins over the image defaults).
+set -euo pipefail
+cd "$(dirname "$0")"
+TAG="${TAG:-dsv41-flash-b12x:local}"
+
+ARGS=()
+while IFS= read -r line; do
+    # Skip blank lines and comments (# ...).
+    case "$line" in
+        ''|\#*) continue ;;
+    esac
+    key="${line%%=*}"
+    val="${line#*=}"
+    [ -n "$key" ] && ARGS+=(--build-arg "${key}=${val}")
+done < versions.env
+
+echo "=== Building ${TAG} ==="
+docker build "${ARGS[@]}" --progress=plain -t "${TAG}" -f Dockerfile . 2>&1
+echo "=== Done: ${TAG} ==="

+ 6 - 0
docker-images/dsv41-flash-b12x/versions.env

@@ -0,0 +1,6 @@
+# versions.env - build input for the dsv41-flash B12X wrapper.
+# Thin FROM wrapper: the only inputs are the base image (built by
+# docker-images/dsv41-flash/, must already exist on the build node) and the
+# b12x wheel version. Convention: KEY=VAL, no spaces around =.
+BASE_IMAGE=dsv41-flash:local
+B12X_VERSION=1.3.0