Repository navigation
Docker ROCm image: ship Unsloth Studio, as the CUDA image already does - #11218
Conversation
LeoBorcherding
left a comment
There was a problem hiding this comment.
Codex review, relayed from a mirror
Codex does not answer on this repository, so the commits on this pull request were replayed onto LeoBorcherding/unsloth-staging-review#5 and reviewed there. Reviewed commit 6fca120f04 on the mirror, which is this PR's fd99c8647 replayed onto main 14b40739a.
2 findings, in Codex's words, inline below where the line is on this diff.
…its header a launch line that works The workflow built only Dockerfile.rocm, so Dockerfile.studio-rocm was never published and the comment saying CI pins its refs described a job that did not exist. build-studio now layers it on the base this run pushed, by digest and with the same UNSLOTH_REF / zoo ref, and tag-studio gives it every base tag with a -studio leaf under the same gates (:studio beside :latest). The Hub page syncs once both moved and documents the tag. The header pointed WSL2 users at `docker/run.sh --rocm`, which has no DXG path on main (that is unslothai#11212), picks :latest, and publishes no port; the by-hand line passed group names, which the image cannot resolve. Both lines now say what actually works, and WSL2 is named as waiting on unslothai#11212.
|
Pushed
The header's run lines could not start the image as written: Not run: the workflow itself. No image was rebuilt, since the Dockerfile change is comments only. |
LeoBorcherding
left a comment
There was a problem hiding this comment.
Codex findings, via a mirror
Codex does not answer on this repository, so it ran against a copy of this pull request's commits at LeoBorcherding/unsloth-staging-review#5. It looked at 288f47c6eb there, which is this PR's 53fd8c943 replayed onto main 9f76c5a3e. Nothing was reviewed or resolved on the copy: the findings are here, in Codex's words, to be worked through on this pull request.
2 findings, inline below where the line is on this diff.
|
Pushed Restart with gfx906. Tag order. Base tags used to move before Studio built, so 5 tests added, 43 pass. Not run: a gfx906 base. Built the image at this commit on the published The red check on this head, |
…, tell install.sh the gfx, and move no stable tag before both builds exist The CMD handed Studio UNSLOTH_STUDIO_PASSWORD on every start. It only sets the first admin password and `unsloth studio` exits 1 when given one after that, so a `docker restart` with the variable still set (a Compose file) never came back up. studio_launch_rocm.sh is now the CMD: as the CUDA launcher does, it writes the value to a root-only file that studio_run.sh hands over only while no password is stored, and drops it from Studio's environment. The copied studio_password.sh went, since nothing ran it and it waits on JupyterLab. install.sh only skips bitsandbytes on gfx906 when told the arch, and the GPU-less builder cannot probe it, so a gfx906-studio image would have shipped a 4-bit backend with no kernels. The base's ROCM_GFX is forwarded as UNSLOTH_ROCM_GFX_ARCH, and the build asserts a gfx906 Studio venv has no bitsandbytes. The base tags moved before build-studio ran, so a Studio failure or a second overlapping run could leave :latest and :studio from different builds. Both digests are now built first, and the tag job creates both manifests back to back; tag-studio and its job-scheduling gap are gone.
|
Pushed |
The workflow concurrency group carries github.run_id on main, deliberately, so a dispatch runs alongside the cron instead of discarding it. That was harmless while one stable tag moved. This workflow now promotes two, and DOCKERHUB-ROCM.md documents them as a pair: `studio` is the Studio twin of `latest`. Unserialized, two runs interleave: A writes latest, B writes latest and studio, A writes studio, and the pair stays sourced from different builds until the next run. Reachable rather than theoretical, since the cadence is a weekly cron plus dispatch and a ROCm run takes hours. The tag job gets its own group with no run_id, so stable promotion queues across runs. cancel-in-progress stays false: a cancelled promotion is the split this exists to prevent. The existing test comment claimed one job "back to back" was enough for another run not to land between the two writes. That is true within a run and not across runs, so it is corrected rather than left to reassure the next reader. Negative control: with the test present and the concurrency block reverted, test_stable_tag_promotion_is_serialized_across_runs fails (1 failed, 44 passed); with the fix, 45 pass.
# Conflicts: # tests/python/test_docker_rocm.py
6f19113 added a shared concurrency group to the tag job to stop two runs splitting the latest/studio pair. That trades a small window for a bigger loss: GitHub concurrency is not a queue. A shared group holds one running job and one pending job, and a third arrival cancels the pending one, which this repo has already written down twice in tests/studio/test_main_runs_survive_merge_bursts.py ("any existing pending job or workflow in the same concurrency group will be canceled"). For an override build the tag job is the only step that writes the run's SHA tags, so a cancelled one leaves two pushed digests with no tags at all. The pairing window itself is not this workflow's to close. docker-publish.yml promotes latest and core from the same per-run group with no job-level group, so the shape is repo-wide and accepted; closing it needs a real lock that preserves every arrival, not concurrency, and that belongs in its own change against both workflows. The test comment stays corrected, because the claim that started this ("one job, back to back, so another run cannot land between them") is true within a run and false across runs, and it is what hid the window. It now says what is actually true, including why the obvious fix is worse.
…oBorcherding/unsloth into pr11218 # Conflicts: # tests/python/test_docker_rocm.py
|
Review record for #11218, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#25. Findings are quoted as posted and attributed to the account that posted them. The reactions shown are the triage recorded on the mirror; none were re-applied here. Commits are named as the mirror's, with this PR's equivalent where one was found. Round 1 — reviewed mirror
|
…ion of it This branch is stacked on unslothai#11218, which has since been squash-merged, so main and the branch carry the same work under different SHAs and three files conflicted: the ROCm publish workflow, the Hub page and Dockerfile.studio-rocm. No commit on main has touched any of them since that merge, so the branch side is the later revision in each case and is kept. Two places needed more than "keep ours": The Hub page. The branch predates unslothai#11212, so taking its copy wholesale silently reverted the WSL2 section that PR added: the /dev/dxg flags, the librocdxg mount and the per-architecture build note. Rebuilt from main instead, with only this branch's three real additions applied (the studio tag row, the studio paragraph, and 8888 in the run command). test_the_hub_page_gives_the_same_wsl_ flags_as_run_sh caught the revert. Two tests in test_docker_rocm.py still pinned unslothai#11218's shape, which this PR deliberately replaces: - the image now runs the shared studio_launch.sh under supervisord rather than the single-service studio_launch_rocm.sh, so the assertion follows the Dockerfile, and the supervisord program list is covered by the new suite. - the auto-merge left TWO copies of the publish test, the branch's updated one and main's older one, which asserts `"tag-studio" not in wf["jobs"]`. That is exactly the job this PR adds, so the stale copy is removed rather than the survivor weakened. 778 docker tests pass, 2 skipped.
…CUDA image does (#11286) The ROCm Studio image from #11218 runs Studio alone, so an AMD user who follows the Docker quickstart has nowhere to open a notebook. The CUDA core image already carries JupyterLab, the notebook tooling and the notebooks, which Dockerfile.studio inherits; the ROCm base carries none of it, so Dockerfile.studio-rocm installs it itself, piece by piece against the CUDA files, with a suite pinning the two together. supervisord and studio_launch.sh are not new here: both are already on main driving the CUDA Studio image, and this points the ROCm image at them rather than adding a second way to run two services in one container. An earlier revision also enabled key-only sshd on :22. That rode along with the notebooks and had no argument of its own, so it was stripped: openssh-server is not installed, EXPOSE is 8000 8888, and studio_launch.sh's existing `command -v sshd` gate keeps the shared supervisord program down. The org Actions queue is 200+ runs deep, so this PR's own checks never reported. Run on staging instead: 70 passed on ubuntu-latest and on macos-15, and the full repo suite at 8034 + 11465 passed. Eight failures there, seven of which reproduce on a clean origin/main worktree and one of which pre-commit.ci fixed on the branch. The windows-latest leg errors on an unguarded os.geteuid() that has been in tests/python/test_docker_rocm.py since #10820, byte-identical on main; fixed separately in #11457. Not verified: the GPU. The author's run went through Docker Desktop's /dev/dxg, where the torch wheel's bundled HSA runtime has no DXG path, so torch.cuda.is_available() was False and no notebook in this image has trained. Closes #11235
unslothai#11218) * Docker ROCm image: ship Unsloth Studio, as the CUDA image already does * Assert the base ROCm leaf, not the exact torch version, in the Studio venv * Publish the ROCm Studio image from docker-publish-rocm.yml, and give its header a launch line that works The workflow built only Dockerfile.rocm, so Dockerfile.studio-rocm was never published and the comment saying CI pins its refs described a job that did not exist. build-studio now layers it on the base this run pushed, by digest and with the same UNSLOTH_REF / zoo ref, and tag-studio gives it every base tag with a -studio leaf under the same gates (:studio beside :latest). The Hub page syncs once both moved and documents the tag. The header pointed WSL2 users at `docker/run.sh --rocm`, which has no DXG path on main (that is unslothai#11212), picks :latest, and publishes no port; the by-hand line passed group names, which the image cannot resolve. Both lines now say what actually works, and WSL2 is named as waiting on unslothai#11212. * ROCm Studio image: survive a restart with UNSLOTH_STUDIO_PASSWORD set, tell install.sh the gfx, and move no stable tag before both builds exist The CMD handed Studio UNSLOTH_STUDIO_PASSWORD on every start. It only sets the first admin password and `unsloth studio` exits 1 when given one after that, so a `docker restart` with the variable still set (a Compose file) never came back up. studio_launch_rocm.sh is now the CMD: as the CUDA launcher does, it writes the value to a root-only file that studio_run.sh hands over only while no password is stored, and drops it from Studio's environment. The copied studio_password.sh went, since nothing ran it and it waits on JupyterLab. install.sh only skips bitsandbytes on gfx906 when told the arch, and the GPU-less builder cannot probe it, so a gfx906-studio image would have shipped a 4-bit backend with no kernels. The base's ROCM_GFX is forwarded as UNSLOTH_ROCM_GFX_ARCH, and the build asserts a gfx906 Studio venv has no bitsandbytes. The base tags moved before build-studio ran, so a Studio failure or a second overlapping run could leave :latest and :studio from different builds. Both digests are now built first, and the tag job creates both manifests back to back; tag-studio and its job-scheduling gap are gone. * Hub page: name the -studio twins, since latest's is :studio and not latest-studio * Serialize stable tag promotion, so latest and studio cannot split The workflow concurrency group carries github.run_id on main, deliberately, so a dispatch runs alongside the cron instead of discarding it. That was harmless while one stable tag moved. This workflow now promotes two, and DOCKERHUB-ROCM.md documents them as a pair: `studio` is the Studio twin of `latest`. Unserialized, two runs interleave: A writes latest, B writes latest and studio, A writes studio, and the pair stays sourced from different builds until the next run. Reachable rather than theoretical, since the cadence is a weekly cron plus dispatch and a ROCm run takes hours. The tag job gets its own group with no run_id, so stable promotion queues across runs. cancel-in-progress stays false: a cancelled promotion is the split this exists to prevent. The existing test comment claimed one job "back to back" was enough for another run not to land between the two writes. That is true within a run and not across runs, so it is corrected rather than left to reassure the next reader. Negative control: with the test present and the concurrency block reverted, test_stable_tag_promotion_is_serialized_across_runs fails (1 failed, 44 passed); with the fix, 45 pass. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Revert the job-level concurrency group; it loses whole runs 6f19113 added a shared concurrency group to the tag job to stop two runs splitting the latest/studio pair. That trades a small window for a bigger loss: GitHub concurrency is not a queue. A shared group holds one running job and one pending job, and a third arrival cancels the pending one, which this repo has already written down twice in tests/studio/test_main_runs_survive_merge_bursts.py ("any existing pending job or workflow in the same concurrency group will be canceled"). For an override build the tag job is the only step that writes the run's SHA tags, so a cancelled one leaves two pushed digests with no tags at all. The pairing window itself is not this workflow's to close. docker-publish.yml promotes latest and core from the same per-run group with no job-level group, so the shape is repo-wide and accepted; closing it needs a real lock that preserves every arrival, not concurrency, and that belongs in its own change against both workflows. The test comment stays corrected, because the claim that started this ("one job, back to back, so another run cannot land between them") is true within a run and false across runs, and it is what hid the window. It now says what is actually true, including why the obvious fix is worse. --------- Co-authored-by: Daniel Han <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…CUDA image does (unslothai#11286) The ROCm Studio image from unslothai#11218 runs Studio alone, so an AMD user who follows the Docker quickstart has nowhere to open a notebook. The CUDA core image already carries JupyterLab, the notebook tooling and the notebooks, which Dockerfile.studio inherits; the ROCm base carries none of it, so Dockerfile.studio-rocm installs it itself, piece by piece against the CUDA files, with a suite pinning the two together. supervisord and studio_launch.sh are not new here: both are already on main driving the CUDA Studio image, and this points the ROCm image at them rather than adding a second way to run two services in one container. An earlier revision also enabled key-only sshd on :22. That rode along with the notebooks and had no argument of its own, so it was stripped: openssh-server is not installed, EXPOSE is 8000 8888, and studio_launch.sh's existing `command -v sshd` gate keeps the shared supervisord program down. The org Actions queue is 200+ runs deep, so this PR's own checks never reported. Run on staging instead: 70 passed on ubuntu-latest and on macos-15, and the full repo suite at 8034 + 11465 passed. Eight failures there, seven of which reproduce on a clean origin/main worktree and one of which pre-commit.ci fixed on the branch. The windows-latest leg errors on an unguarded os.geteuid() that has been in tests/python/test_docker_rocm.py since unslothai#10820, byte-identical on main; fixed separately in unslothai#11457. Not verified: the GPU. The author's run went through Docker Desktop's /dev/dxg, where the torch wheel's bundled HSA runtime has no DXG path, so torch.cuda.is_available() was False and no notebook in this image has trained. Closes unslothai#11235

unsloth/unsloth-rocmis training-only. The CUDA image gets Studio on :8000 viadocker/Dockerfile.studio; the ROCm image has no equivalent, so an AMD user in Docker gets a Python prompt where an NVIDIA user gets a UI.Changes
One new file,
docker/Dockerfile.studio-rocm, layering Studio on the ROCm base. Kept separate fromDockerfile.studiobecause that file bakes a CUDA llama.cpp, stages NVRTC and dedupsnvidia-*wheels, none of which mean anything on ROCm./etc/unsloth-rocm-build, written by the base with the index it resolved against. Lettinginstall.shdetect would land on CPU wheels, since the builder has no GPU.studio/frontend/dist/index.htmlexists, so a missing UI build is caught at build time, not as a 404.No JupyterLab, sshd or supervisord, unlike
unsloth/unsloth:studio(#11235).Verification
R9700 (gfx1201), Windows 11 26200, WSL2 Ubuntu 24.04,
/dev/dxgonly, host ROCm 7.2.1,BASE_IMAGE=unsloth/unsloth-rocm:latest.GET /and/api/healthROCm (HIP 7.2.26015) -- AMD Radeon AI PRO R97002.11.0+rocm7.2,cuda.is_available() TrueRun with
UNSLOTH_SKIP_GPU_CHECK=1, since the published base predates #11212 and still gates on/dev/kfd.Not verified: any non-WSL host, a training run through the UI, GGUF chat, multi-GPU, per-arch
ROCM_GFX=base.