Repository navigation
Docker ROCm Studio image: ship JupyterLab with the notebooks, as the CUDA image does - #11286
Conversation
…d supervisord, as the CUDA image does unsloth/unsloth:studio runs Studio on :8000 and JupyterLab on :8888 with the Unsloth notebooks preloaded; the ROCm Studio image ran Studio alone. The CUDA core image already carries JupyterLab, the notebook tooling and the notebooks, so Dockerfile.studio inherits them; the ROCm base carries none, so this installs the lot in Dockerfile.studio-rocm: - jupyterlab, notebook and ipywidgets into the base venv at the CUDA image's pins, with the base torch asserted unmoved by the resolve - the labext-builder stage (Node 20, jlpm build:prod) for the Unsloth Dark theme and cell-nav keymap, jlpm installed into that stage since the base has none - the branding chain (favicons, logo, login.html, sloth stickers, the labextension disable/lock pairs) and the unsloth_branding --verify guard - the pip/uv shim, the IPython startup hook and the notebook sync/view tooling from docker/Dockerfile, plus unslothai/notebooks baked as the read-only template; the build fails if the ref carries no AMD-* notebooks - supervisord running Studio, JupyterLab and key-only sshd through the shared studio_launch.sh, replacing the single-service CMD entrypoint-rocm.sh gains the two hooks entrypoint.sh has on the CUDA image: link Studio's code into the home before anything reads it, and sync the notebooks before every exec. Both are no-ops on the base image. The Studio image reinstalls the entrypoint, since the published base predates them. studio_launch.sh keeps the HSA_/HIP_/ROCM_/ROCR_/ROCBLAS_ variables in the profile it writes for SSH login shells, so an SSH session runs on the same ROCm configuration as Studio and Jupyter. tests/python/test_docker_studio_rocm_jupyter.py pins each piece to the CUDA file it mirrors, the entrypoint hook order, and the .dockerignore allow-list. Fixes unslothai#11235
…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.
…pyterlab # Conflicts: # docker/Dockerfile.studio-rocm
… the studio tag's JupyterLab on the Hub page
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#7. It looked at 274f61ad11 there, which is this PR's bdadf4eb2 replayed onto main df18fa7bd. Nothing was reviewed or resolved on the copy: the findings are here, in Codex's words, to be worked through on this pull request.
1 finding, inline below where the line is on this diff.
|
Pushed The ROCm publisher never built
Run: CI at |
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#7. It looked at a7dfd88787 there, which is this PR's bfc1d6927 replayed onto main df18fa7bd. 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.
…s the prebuilt bitsandbytes, and restore the header's run lines
|
Pushed
Run: the two docker test files on WSL2 Ubuntu 24.04, 52 passed / 1 skipped, the new assertion failing at |
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#7. It looked at e169828b85 there, which is this PR's 1632420b3 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.
1 finding, inline below where the line is on this diff.
…image, at the CUDA core image's pins
|
Pushed The image baked JupyterLab and nothing the notebooks import at runtime. The CUDA core image installs soundfile, evaluate, jiwer, librosa, decord, omegaconf, einx, tensorboard, matplotlib, langid, easydict and ftfy plus system ffmpeg, because the notebooks' install cells declare them and the shim then keeps those cells from moving the stack; the ROCm base has none of them (checked in Run: the exact new apt and pip lines executed inside the published base, torch |
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#8. It looked at 00ee24ca5c there, which is this PR's 4838185d9 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.
1 finding, inline below where the line is on this diff.
|
Pushed The base's tag job ran as soon as the base digest existed, and the Studio build waited on it, so Two default-branch runs can still overlap, since each gets its own concurrency group so a burst is not discarded, and an older run's tag pair can land after a newer run's. This commit shrinks that window from the length of a Studio build to the minutes the two tag jobs take; closing it would mean serialising main runs, which the workflow declines to do for the reason at its Run: the two docker test files on WSL2 Ubuntu 24.04, 53 passed / 1 skipped. Not run: the workflow. |
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#8. It looked at c9df8c068a there, which is this PR's a24487ce6 replayed onto main 847e70f96. Nothing was reviewed or resolved on the copy: the findings are here, in Codex's words, to be worked through on this pull request.
Codex found no major issues. Its comment: https://github.com/LeoBorcherding/unsloth-staging-review/pull/8#issuecomment-5737282024
|
Checked this against docker/Dockerfile.studio and docker-publish.yml and the mirroring looks right, including the frozen notebooks ref and the new build-studio and tag-studio jobs. Since it carries #11218's commits, I will review the two together, and please confirm the intent that the base tag job now waits on the Studio build so a Studio failure holds latest back. |
…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.
This PR is for the notebooks: JupyterLab beside Studio on the AMD image, with the AMD-* set baked in and pinned by the publish workflow. sshd rode along with it and has no argument of its own here, so it comes out. Key-only SSH into a 57 GB GPU container is a bigger surface than a notebook editor, and nothing in issue unslothai#11235 asks for it. supervisord stays. It is not something this PR adds: docker/supervisord.conf and docker/studio_launch.sh are already on main, driving the CUDA studio image, and this branch only points the ROCm image at them. Running Studio and JupyterLab in one container is what it is for, and dropping it would mean inventing a second way to do that for ROCm alone. So the removal is confined to this image: - openssh-server is no longer installed, and EXPOSE is 8000 8888 - studio_launch.sh already gates on `command -v sshd`, so with no binary UNSLOTH_ENABLE_SSHD stays false and the shared supervisord program never starts. The ENV default stays, because supervisord.conf is shared with the CUDA image and still expands %(ENV_UNSLOTH_ENABLE_SSHD)s on startup - the Hub page drops both mentions of key-only SSH test_every_supervisord_program_is_installed_by_the_dockerfile asserted the opposite for the sshd program; it now asserts the absence, the gate and the default together, so reinstating openssh-server without a decision fails. test_ssh_login_shells_keep_the_rocm_variables is renamed rather than deleted: the /etc/profile.d export still matters, because a JupyterLab terminal and `docker exec -it ... bash -l` are login shells too and see no `docker run -e` value otherwise, which is exactly how a notebook would end up on a different HSA_OVERRIDE_GFX_VERSION than the Studio process. 788 docker tests pass, 13 skipped.
|
Stripped this down to the JupyterLab and notebooks work, and pushed it to the branch ( sshd is out. It rode along with the notebooks and has no argument of its own here: key-only SSH into a 57 GB GPU container is a much bigger surface than a notebook editor, and nothing in #11235 asks for it. supervisord stays, and I want to be clear that it is not something this PR adds. Two test changes rather than deletions:
788 docker tests pass, 13 skipped. Still worth knowing before this goes in: your verification had |
|
Review record for #11286, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#50. 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
|
|
Cross-platform CI on this head, off the org queue (the org queue is 200+ runs deep right now, which is why the checks above have not reported):
The Windows failure is not this PR's. The line is byte-identical on |
…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:studioruns Studio on :8000 and JupyterLab on :8888 with the Unsloth notebooks preloaded. 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, whichDockerfile.studioinherits; the ROCm base carries none of it.Stacked on #11218 (its two commits are in this branch).
Scope note. An earlier revision of this branch also enabled key-only sshd on :22. That rode along with the notebooks and had no argument of its own, so it was stripped in
c213eef07:openssh-serveris not installed,EXPOSEis8000 8888, andstudio_launch.sh's existingcommand -v sshdgate keeps the shared supervisord program down. Key-only SSH into a 57 GB GPU container is a much bigger surface than a notebook editor, and nothing in #11235 asks for it.Changes
All in
docker/Dockerfile.studio-rocm, mirroring the CUDA files piece by piece:jupyterlab,notebookandipywidgetsinto the base venv at the CUDA core image's pins, so the kernel is the ROCm torch. The resolve runs against pypi alone, where a moved torch would be a CUDA wheel, so the base torch is asserted unmoved.labext-builderstage (Node 20,jlpm build:prod) for the Unsloth Dark theme and cell-nav keymap. jlpm is installed into that stage's venv, since the base has no jupyterlab.login.html, sloth stickers, thelabextension disable/lockpairs) and theunsloth_branding --verifyguard, both against/opt/unsloth-venvas on CUDA.docker/Dockerfile, plusunslothai/notebooksbaked as the read-only template. The build fails if the ref carries noAMD-*notebook, since that set is the point of the image.studio_launch.sh, replacing the single-service CMD. Bothdocker/supervisord.confanddocker/studio_launch.share already on main driving the CUDA Studio image; this points the ROCm image at them rather than adding a second mechanism.entrypoint-rocm.shgains the two hooksentrypoint.shhas on CUDA: link Studio's code into the home before anything reads it (a volume on the home hides the build-time link), and sync the notebooks before every exec. Both are no-ops on the base image, which has neither script. The Studio image reinstalls the entrypoint, since the published base predates them.studio_launch.shkeepsHSA_/HIP_/ROCM_/ROCR_/ROCBLAS_variables in the profile it writes for login shells. Nothing here arrives over SSH, but a JupyterLab terminal anddocker exec -it ... bash -lare login shells too and see nodocker run -evalue otherwise, so a terminal sees the sameROCBLAS_USE_HIPBLASLT=1as the Studio and Jupyter processes.No transformers sidecars: the CUDA image derives its set from the vLLM it carries, and this image carries none, so a notebook's
transformers==Xpin is recorded by the shim and the base venv's transformers is used.tests/python/test_docker_studio_rocm_jupyter.pypins the jupyterlab pins, the branding chain and the notebook helper list to the CUDA files they mirror, the supervisord programs to what the Dockerfile installs, the entrypoint hook order, and every COPY source to the.dockerignoreallow-list.Verification
Built at
ad4000ec66onunsloth/unsloth-rocm@sha256:2b62b0e5(published 2026-09-15) withUNSLOTH_STUDIO_REF=14b40739a0andUNSLOTH_NOTEBOOKS_REF=bce1b9d1. Host: Windows 11 26200, Docker Desktop 4.74 (engine 29.4.3, WSL2 backend), Radeon AI PRO R9700 seated,--device /dev/dxg,UNSLOTH_SKIP_GPU_CHECK=1.2.12.1+rocm7.2; branding guard passed; 153AMD-*notebooks bakedjupyter RUNNING,studio RUNNING,studio-password EXITED(one-shot); ready banner printed with both URLs/login200 with the attribution line; Unsloth Dark theme, logo and splash locks in place; file browser opens onUnsloth Notebooks, folder26 AMD Notebooksholds all 153/and/api/health200nbconvert --execute:UNSLOTH_NB_SHIM=1,pipresolves to the shim,!pip install torch bitsandbytes "transformers==4.56.2"printskept baked versions, skipped: torch bitsandbytes transformers==4.56.2, torch unchanged afterwardspython -m unsloth_branding --verifypasses inside the running containerNot verified: the GPU. Through Docker Desktop's
/dev/dxgthe torch wheel's bundled HSA runtime has no DXG path (hsaKmtOpenKFDundefined), which is what #11212 addresses, sotorch.cuda.is_available()was False in both venvs and no notebook trained. Also untested: a Linux host with/dev/kfd(any card), a per-archROCM_GFX=base, the Cloudflare tunnel, anddocker run --user <uid>. Everything JupyterLab-side is host-independent, so those gaps are about the training half, not this diff.Fixes #11235
Cross-platform CI
The org Actions queue is 200+ runs deep, so the checks on this PR have not reported. Run on owned staging repos instead, at
c213eef07:main's, fixed in #11457origin/mainworktreeThe Windows error is
tests/python/test_docker_rocm.py:548, an unguardedos.geteuid()in askipifdecorator that has been there since #10820 and is byte-identical on main.os.geteuiddoes not exist on Windows and a skipif is evaluated at collection, so it takes the whole module down instead of skipping one test. The org CI runs the Python suites on Linux only, which is why it has never been seen.The 8 staging failures are five Studio frontend contract tests,
test_source_read_encoding(namingstudio/backend/tests/test_reset_password_command.py) andtest_formatter_fixed_point. The first seven fail identically onorigin/main; the last one was this branch's and pre-commit.ci fixed it ina5bc8f44d.