docs(cuda): document Docker-free PyTorch worker layout - #600
Open
NickyHeC wants to merge 4 commits into
Open
Conversation
|
Ready to review this PR? Stage has broken it down into 3 individual chapters for you:
Chapters generated by Stage for commit 5da5bba on Jul 13, 2026 1:52am UTC. |
The CUDA section still described Runtime-API workloads as unsupported ("a pure
libcuda shim cannot provide it", Phase 4), which predates the smolvm-cudart-shim
merge — PyTorch/vLLM/Triton now run. Correct that, and document the one
non-obvious requirement that bit us: auto-staging overlays the guest shims onto
pip NVIDIA wheels at IMAGE PULL TIME under site-packages/nvidia/, so the image
must already contain pip torch when smolvm pulls it. conda /opt/conda/lib and
runtime `pip install torch` are not staged.
Add examples/cuda-pytorch/ (Dockerfile + Smolfile + README) with the working
recipe, a staging-verification check, and the math-SDPA note for training.
Refs smol-machines#598.
NickyHeC
force-pushed
the
nickyhec/docs-cuda-pytorch-image-layout
branch
from
July 13, 2026 01:52
9132956 to
5da5bba
Compare
BinSquare
reviewed
Jul 25, 2026
| # PyTorch worker on smolvm with CUDA forwarding. | ||
| # | ||
| # Build the image first (torch must be present at pull time — see README.md): | ||
| # docker build -t torch-cuda examples/cuda-pytorch |
Contributor
There was a problem hiding this comment.
a smolvm example should not have a dependency on docker + dockerfile because it adds a third party dependency + increases complexity/management
Contributor
Author
There was a problem hiding this comment.
Remove the Docker build dependency from the example and rely on the conda staging support already validated by the companion CUDA PRs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #598.
Problem
The CUDA section still described Runtime-API workloads as unsupported and did not explain the pull-time staging requirement. PyTorch's CUDA libraries must already exist in the image when smolvm pulls it so the agent can overlay the forwarding shims at each RPATH-pinned soname.
Changes
smolvm-cudart-shimSMOLVM_CUDA_STAGE_EXTRA_DIRSstaging layoutspytorch/pytorch:2.4.0-cuda12.4-cudnn9-runtimeimage directlyNo Dockerfile, local image build, or third-party container toolchain is required; smolvm pulls the existing OCI image itself.
Validation
The exact official image was validated on a Lambda A10 with #602 + #638:
The staged
/opt/conda/lib/libcudart.so.12.4.127was the ~901 KB shim bind-mount rather than the real NVIDIA library, with noLD_PRELOAD.