Repository navigation
AMD Docker support (stacks on #5748) - #6231
LeoBorcherding wants to merge 1 commit into
Conversation
…h workflow)
Adds an AMD ROCm variant alongside the existing CUDA/Blackwell image, wiring
it through the unified build.sh/run.sh (--rocm) entry points.
New:
docker/Dockerfile.rocm single-stage ROCm build; ROCm torch wheels +
the bitsandbytes pre-release wheel carrying the
4-bit decode fix (bnb <=0.49.2 NaNs on AMD)
docker/Dockerfile.studio-rocm Studio variant layered on the ROCm base
docker/entrypoint-rocm.sh preflight: /dev/kfd reachable, rocm-smi, HIP
torch, gfx-arch check with HSA_OVERRIDE hints
docker/smoke_test_rocm.py ROCm smoke test incl. a 5-step LoRA train
docker/test_locally-rocm.sh end-to-end local build + smoke + notebook check
.github/workflows/docker-publish-rocm.yml GPU-less amd64 build + publish
Changed:
docker/build.sh, docker/run.sh --rocm flag selects the ROCm image/flags
docker/.dockerignore allowlist the rocm + studio files so the
COPY steps and CI build context resolve
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 078f5e8964
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| RUN mkdir -p "${UNSLOTH_STUDIO_HOME}" \ | ||
| && git clone --depth 1 --branch "${UNSLOTH_STUDIO_REF}" https://github.com/unslothai/unsloth "${UNSLOTH_STUDIO_HOME}/src" \ | ||
| && cd "${UNSLOTH_STUDIO_HOME}/src" \ | ||
| && UNSLOTH_STUDIO_HOME="${UNSLOTH_STUDIO_HOME}" bash install.sh --local \ |
There was a problem hiding this comment.
Pass the installer’s no-torch flag for Studio
When building the ROCm Studio image, setting SKIP_TORCH=true in the Docker environment does not make install.sh skip torch: the installer initializes SKIP_TORCH=false and only flips it from --no-torch, UNSLOTH_NO_TORCH, or Intel-Mac detection before it calls get_torch_index_url(). In this no-GPU Docker build path, bash install.sh --local therefore still runs the torch auto-detection/install path that the surrounding comments are trying to avoid, which can fail the Studio image build or overwrite the already-installed ROCm torch in the base layer. Pass --no-torch here or set UNSLOTH_NO_TORCH=true for the installer.
Useful? React with 👍 / 👎.
|
Strix Halo w/ Arch Linux on 7.0.12-arch1-1: I did see an error during build: I also had to revise the run.sh a bit to detect the resulting local image (from Full build log: https://pastebin.com/9FvW3wjY |
|
Thanks for putting this together. I built it locally while going through the Docker PRs and the default configuration does not currently build, so flagging it here with the reproduction.
The cause is the resolver configuration at
So PyPI wins and the build downloads the whole NVIDIA stack into a ROCm image before failing: Worth saying: the The Two smaller things from the same build:
On sequencing: this stacks on #5748, which has moved since (it picked up a main merge plus a fix for the llama.cpp CUDA backend), and it adds |
|
Thanks for keeping this moving. The default rocm6.2 build still resolves torch from PyPI because of the unsafe-best-match plus the PyPI extra index on an unpinned torch, and the bitsandbytes block still points at the continuous-release preview wheel now that 0.50.0 is on PyPI. Could you pin torch, or drop the PyPI extra index for the torch install, and rebase once #5748 and #4223 are in so the ROCm Dockerfile has a single owner? |
Part of #6230. This is the AMD ROCm counterpart to the Blackwell CUDA docker work in #5748, stacked directly on the docker-blackwell-build branch so the diff is AMD-only.
What
Adds an AMD ROCm variant of the Docker setup alongside the NVIDIA/Blackwell image, so Unsloth runs in a container on AMD GPUs (RDNA2/3/4 and CDNA/Instinct). Same docker/ layout, same build.sh / run.sh entry points, same smoke-test shape as the CUDA side.
What's included
Diff scope
9 files on top of #5748: 6 net-new rocm files plus the --rocm hooks in build.sh / run.sh / .dockerignore. No changes to the CUDA or Studio files, so the NVIDIA path is untouched.
GPU coverage
Validation so far
Base note
Targeting docker-blackwell-build so the diff is AMD-only. Will retarget to main once #5748 merges.