REAX-1.4 / engine /reax14 /Dockerfile
decisionmodels's picture
Engine tree (REAX Engine reax14-release-20261126, 2cccfee) and run instructions
a7e82fd verified
Raw History Blame Contribute Delete
3.84 kB
# reax14 engine image (one RTX PRO 6000 96 GB). Build from the REPOSITORY ROOT (needs engine/ = the registry backends, reax14/,
# and reax13's FP8 GEMM + autotuner guard): docker build -f reax14/Dockerfile -t reax14 .
# Stack = the validated reference stack of docker/ref-qwen35 (torch 2.14.0+cu130, transformers 5.17.0, flash-linear-attention 0.5.2)
# plus the Decision Index kit at its pinned revision and karpo-decision (Apache-2.0, pinned c52d3507) for the packed karpo
# kernels (engine/backends/karpo_packed.py, hfdi-speed-20261125). No weights inside: mount the model root read-only at /model
# (part directories as named in reax14.json). Nothing is fetched at serving time.
ARG BASE=nvidia/cuda:13.0.2-runtime-ubuntu24.04@sha256:6a0e31b59e70890446f2c17356d6efc0d54260090a8c63d6ca7c2ad049db95d2
FROM ${BASE}
ENV DEBIAN_FRONTEND=noninteractive PIP_NO_CACHE_DIR=1 PIP_DISABLE_PIP_VERSION_CHECK=1 PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
# gcc + Python headers: Triton / torch.compile build their launcher stubs at run time (into /tmp); git for the kit pin.
RUN apt-get update -qq \
&& apt-get install -y -qq --no-install-recommends python3 python3-venv python3-dev gcc g++ git curl ca-certificates >/dev/null \
&& rm -rf /var/lib/apt/lists/*
RUN python3 -m venv /opt/venv \
&& /opt/venv/bin/pip install -q "pip==26.2.1" \
&& PIP_CONFIG_FILE=/dev/null /opt/venv/bin/pip install -q torch==2.14.0 torchvision==0.29.0 --index-url https://download.pytorch.org/whl/cu130 \
&& /opt/venv/bin/pip install -q --uploaded-prior-to=2026-11-22T00:00:00Z \
"transformers==5.17.0" "accelerate==1.15.0" "safetensors==0.8.0" "flash-linear-attention==0.5.2" "kernels==0.16.1" \
"huggingface-hub==1.31.0" "einops==0.8.2" "pillow" "numpy" "uvicorn==0.29.0" \
&& git clone -q https://github.com/apolinario/decision-index /kit \
&& git -C /kit checkout -q 25c6ec7b6b5f44a216c63c3a700de3a9c6d6699d \
&& /opt/venv/bin/pip install -q --no-deps -e /kit \
&& /opt/venv/bin/pip install -q --uploaded-prior-to=2026-11-22T00:00:00Z "pybase64>=1.4" "backports.zstd>=1.0" \
&& git clone -q https://github.com/machinepulse-ai/karpo-decision /opt/karpo-decision \
&& git -C /opt/karpo-decision checkout -q c52d3507a254d3ad8423726c6bc6568c99113e7d \
&& /opt/venv/bin/pip install -q --no-deps /opt/karpo-decision \
&& /opt/venv/bin/pip freeze > /opt/pip-freeze.txt
RUN mkdir -p /opt/reax /licenses /engine/third_party_reax13
COPY engine /opt/reax/engine
COPY reax14 /engine
COPY reax13/fast_fp8_gemm.py reax13/autotune_guard.py /engine/third_party_reax13/
COPY reax13/third_party/finegrained-fp8 /engine/third_party_reax13/finegrained-fp8
COPY LICENSE NOTICE /licenses/
COPY LICENSES /licenses/LICENSES/
COPY upstream/d3/LICENSE upstream/d3/NOTICE /licenses/d3/
RUN mkdir -p /licenses/karpo-decision && cp /opt/karpo-decision/LICENSE /licenses/karpo-decision/ && (cp /opt/karpo-decision/NOTICE /licenses/karpo-decision/ 2>/dev/null || true)
RUN /opt/venv/bin/python -m compileall -q /opt/reax/engine /engine
RUN useradd --uid 10002 --create-home --home-dir /home/s1m s1m
USER s1m
WORKDIR /engine
ENV PATH=/opt/venv/bin:$PATH PYTHONPATH=/engine:/opt/reax REAX_PROFILE=reference \
HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 HF_HUB_DISABLE_TELEMETRY=1 OPENAI_API_KEY= \
HOME=/tmp TRITON_CACHE_DIR=/tmp/triton TORCHINDUCTOR_CACHE_DIR=/tmp/inductor XDG_CACHE_HOME=/tmp/.cache \
PYTORCH_ALLOC_CONF=expandable_segments:True CIE_LAZY_LOAD=1 NVIDIA_DRIVER_CAPABILITIES=compute,utility
EXPOSE 8080
# default: the HTTP server (POST /v1/systemone, GET /healthz on :8080); for the kit run override the entrypoint:
# python -m decision_index run --engine reax14_engine:Reax14Engine --option config=/engine/reax14.json --option model=/model ...
ENTRYPOINT ["python", "/engine/serve.py", "--config", "/engine/reax14.json", "--model", "/model"]