Logits-Sigma-1-Duo / code /Dockerfile
ryanli-me's picture
Logits Sigma-1 Duo (soup-a): weights and code
d9641cd verified
Raw History Blame Contribute Delete
2.95 kB
# Logits Sigma-1 Duo (decisions.md D31): the serving image, built from the model repo's code/ directory.
#
# docker build -f code/Dockerfile --build-context kit=<decision-index checkout @ 25c6ec7> -t logits-sigma-1-duo code
# docker run --gpus all -v <Logits-Sigma-1-Duo checkout>:/models/duo:ro -v $PWD/runs:/runs logits-sigma-1-duo \
# pipeline --compact --out /runs/<name> # or: run --rows /runs/rows.jsonl --out /runs/out
#
# Weights are mounted, not baked in. The kit comes in as the named build context `kit`.
#
# causal-conv1d: d3-ultra's Gated DeltaNet layers bind it when it is installed; without it transformers falls back to
# its PyTorch reference (same answers, slower on long requests). The board measures entries with the author's serving,
# so the image builds it: no prebuilt wheel matches torch 2.15 + CUDA 13, so it is compiled in the devel stage (nvcc,
# g++) for sm_90 (H200) and sm_120 (RTX PRO 6000). --build-arg CAUSAL_CONV1D= (empty) skips it; the engine then logs
# the fallback at startup.
ARG CUDA_DEVEL=nvidia/cuda:13.0.0-devel-ubuntu24.04
ARG CUDA_BASE=nvidia/cuda:13.0.0-base-ubuntu24.04
FROM ${CUDA_DEVEL} AS build
# The toolchain D20 run 2 built causal-conv1d 1.7.0 with on the RTX PRO 6000 (2026-11-07): nvcc 13.0.88 (this image's),
# host compiler gcc-12 / g++-12 12.3, against torch 2.15.0+cu132; 6.5 min for sm_120 alone on 16 vCPUs. gcc and g++
# must be the same major version (a gcc-12 / g++-11 mix fails with "cannot execute cc1plus").
RUN apt-get update && apt-get install -y --no-install-recommends python3 python3-venv python3-dev gcc-12 g++-12 git \
&& rm -rf /var/lib/apt/lists/*
ENV CC=gcc-12 CXX=g++-12 CUDA_HOME=/usr/local/cuda
ENV VIRTUAL_ENV=/opt/venv PATH=/opt/venv/bin:$PATH
RUN python3 -m venv /opt/venv && pip install -q uv
COPY requirements.lock /tmp/requirements.lock
RUN uv pip install -q --python /opt/venv/bin/python -r /tmp/requirements.lock
COPY --from=kit . /opt/di
RUN uv pip install -q --python /opt/venv/bin/python --no-deps /opt/di
COPY pyproject.toml /opt/code/pyproject.toml
COPY logits_sigma_1_duo /opt/code/logits_sigma_1_duo
RUN uv pip install -q --python /opt/venv/bin/python --no-deps /opt/code
ARG CAUSAL_CONV1D=1.7.0
ARG TORCH_CUDA_ARCH_LIST="9.0;12.0"
RUN if [ -n "$CAUSAL_CONV1D" ]; then \
CAUSAL_CONV1D_FORCE_BUILD=TRUE MAX_JOBS=16 TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST" \
pip install -q --no-build-isolation --no-deps "causal-conv1d==$CAUSAL_CONV1D" \
&& python -c "import causal_conv1d; print('causal-conv1d', causal_conv1d.__version__)"; \
fi
FROM ${CUDA_BASE}
RUN apt-get update && apt-get install -y --no-install-recommends python3 && rm -rf /var/lib/apt/lists/*
COPY --from=build /opt/venv /opt/venv
COPY serve.sh /opt/serve.sh
ENV PATH=/opt/venv/bin:$PATH PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True TOKENIZERS_PARALLELISM=false \
MODEL=/models/duo
WORKDIR /runs
ENTRYPOINT ["bash", "/opt/serve.sh"]