docker: pin xformers explicitly, forward the llama tag to the Studio build

The amd64 base install named the cu128-ampere-torch2110 extra, which does not
exist on main yet (the CUDA extras stop at torch2100): pip/uv only warn on an
unknown extra, so plain unsloth installed without xformers and the required-
package check failed the build. Both arches now take the plain huggingface
extra and amd64 pins xformers==0.0.35 explicitly in the same resolve (it
requires torch>=2.10 without an exact pin, pairing with the baked 2.11.0;
verified on PyPI, x86_64 wheels only, matching the arm64 exclusion). This
decouples the base image from the pending extras PR.

The Studio build now receives the SAME llama.cpp tag the base image baked:
Dockerfile.studio grows a LLAMA_PREBUILT_TAG arg exported as UNSLOTH_LLAMA_TAG
to install.sh (setup.sh honours it; the "latest" default is byte-identical to
setup.sh's own default for local builds), and the publish workflow forwards
the prepare job's resolved tag in the studio build-args. Without the pin a
dispatch override or an upstream release landing between the two jobs let the
no-GPU Studio build re-resolve "latest" and replace the pinned CUDA bundle.

The Studio venv-match assertion also needs installer support for torch 2.11
on the CUDA path; that lands in a separate installer PR and is now declared
as a merge-order dependency in the PR description (the publish workflow only
runs on main pushes, so nothing builds before both are merged).
This commit is contained in:
Daniel Han 2026-07-16 06:53:44 +00:00
commit 8fa588db2c
3 changed files with 26 additions and 19 deletions

View file

@ -60,6 +60,12 @@ ARG UNSLOTH_STUDIO_REF=main
# Studio builds, so the Studio backend runs the same zoo as the base image and
# the operator-requested ref instead of always tracking main.
ARG UNSLOTH_STUDIO_ZOO_REF=main
# The SAME llama.cpp tag the base image baked (the prepare job resolves it
# once). install.sh -> setup.sh honours UNSLOTH_LLAMA_TAG; without this pin a
# dispatch override, or an upstream release landing between the base and
# Studio jobs, lets the no-GPU Studio build re-resolve "latest" and replace
# the base's pinned CUDA bundle instead of reusing it.
ARG LLAMA_PREBUILT_TAG=latest
ARG TARGETARCH
# Services run as root in this revision (the base image is root-only by
@ -134,6 +140,7 @@ RUN set -eux \
&& UNSLOTH_STUDIO_HOME="${UNSLOTH_STUDIO_HOME}" \
UNSLOTH_TORCH_INDEX_FAMILY="${TORCH_FAMILY}" \
UNSLOTH_ZOO_REF="${UNSLOTH_STUDIO_ZOO_REF}" \
UNSLOTH_LLAMA_TAG="${LLAMA_PREBUILT_TAG}" \
UNSLOTH_PYTHON=3.12 \
bash install.sh --local \
# Fail loud unless the Studio venv torch EXACTLY matches the base venv