fix(docker): install python3.12-dev so Triton can JIT in the container (#453) - #456
Open
Anai-Guo wants to merge 1 commit into
Open
fix(docker): install python3.12-dev so Triton can JIT in the container (#453)#456Anai-Guo wants to merge 1 commit into
Anai-Guo wants to merge 1 commit into
Conversation
theroyallab#453) The image installs triton (a cu12/cu13 dependency), which compiles its cuda_utils extension at runtime and therefore needs Python.h. Only python3.12/-venv/-pip were installed, so every JIT attempt failed with 'fatal error: Python.h: No such file or directory' and flash-linear-attention rolled back to CPU.
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.
Is your pull request related to a problem? Please describe.
Fixes #453. Starting the container logs a burst of build failures before the server comes up:
tritonis a declared dependency of both thecu12andcu13groups(
pyproject.tomlL74-76 / L101-102), so it is always in the image. Triton compiles itscuda_utilsextension at runtime, which needs the CPython development headers.Both Dockerfiles install
python3.12,python3-pipandpython3.12-venv, but notpython3.12-dev— soPython.his not in the image.build-essentialis already there,so the headers are the only missing piece.
Putting them in the venv would not help:
sysconfigreports the interpreter's includepath from the base prefix even inside a venv, which is where Triton looks —
and on Ubuntu 24.04 that path is owned by
python3.12-dev(vialibpython3.12-dev):Why should this feature be added?
The failure is not only log noise. The compile error is what
flash-linear-attention'sTriton probe hits, and it responds by rolling back to CPU — so an image that ships Triton
on purpose silently runs without it.
Both
docker/Dockerfileanddocker/Dockerfile.cu13have the identicalapt-getblockand the identical gap, so both are fixed here.
Examples
Before:
After:
Python.hresolves, the JIT build succeeds, and the rollback warning is gone.Additional context
One package added per Dockerfile; no change to the venv, the install steps, or the
entrypoint. The added layer is a few MB. The existing
Docker smoke testworkflow buildsboth files on any
docker/**change, so this PR exercises both images.I do not have a CUDA host to run the image on, so I verified the mechanism rather than the
container: the
sysconfiginclude path and thedpkg -Sownership above were both checkedon Ubuntu 24.04 with CPython 3.12. Worth a maintainer running the image once to confirm the
warning is gone end to end.
🤖 Generated with Claude Code