Repository navigation
Move the CI docker image to Ubuntu 24.04 for PyTorch 2.15 - #3988
Merged
Merged
Conversation
torch 2.15 requires Python >= 3.11 and publishes no cp310 wheels, so `pip install torch==2.15` fails on the Ubuntu 22.04 image (system Python 3.10) with "No matching distribution found", as in the Docker Build run https://github.com/pytorch/tutorials/actions/runs/40756929817. Ubuntu 24.04 ships Python 3.12. Besides the base image, three things change with it: - The cmake=3.22* pin does not exist on 24.04; use the distro cmake. - 24.04 marks the system Python as externally managed (PEP 668), so pip is told via /etc/pip.conf to install into it. A config file rather than an env var so the `sudo pip` call in .jenkins/build.sh is covered too. `pip install --upgrade pip` needs --ignore-installed because the apt-installed pip has no RECORD file to uninstall. - numpy, scipy, numba and spacy were pinned to versions with no Python 3.12 wheels (and numpy 1.24.4 conflicts with the current onnx on 3.12). Bump each to the first release with 3.12 support. Alternative considered: keep 22.04 and install Python 3.11. That leaves every pin untouched, but adds a source-built or third-party Python to the image; the 24.04 route uses the distro Python. Test Plan: Dependency resolution only (torch 2.14.1 stands in for 2.15 because the internal PyPI mirror did not have the 2.15 wheels yet): ``` uv pip compile .ci/docker/requirements.txt --python-version 3.12 --python-platform x86_64-manylinux_2_39 ``` With the old pins this fails on numpy==1.24.4 vs onnx; with the new pins it resolves. The image itself has not been built: run the Docker Build workflow on this PR to verify the apt and pip steps. This change was authored with an AI assistant (Claude Code).
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3988
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 1 PendingAs of commit 1e3b506 with merge base 71db083 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
huydhn
approved these changes
Oct 28, 2026
4 tasks
atalman
added a commit
to atalman/tutorials
that referenced
this pull request
Oct 28, 2026
The Ubuntu 24.04 image (pytorch#3988) pins numpy==1.26.4, because numba 0.59.1 and spacy 3.7.2 need numpy < 2. pyarrow's wheels declare no numpy requirement, so pip installs the latest pyarrow, 26.0.0, which fails at import with "pyarrow requires NumPy 2.0 or newer, found 1.26.4". ray.train reports any failure to import fsspec, pandas, pyarrow or requests as "Can't import ray.train as some dependencies are missing", so beginner_source/distributed_training_with_ray_tutorial.py failed the Build tutorials job on main: https://github.com/pytorch/tutorials/actions/runs/40763826746/job/123082673219 Cap pyarrow below 26. Drop the cap when numpy moves to 2.x. Alternative considered: moving numpy to 2.x. That needs new numba and spacy, which is a much larger change to the tutorial environment. Test Plan: In a Python 3.12 venv with numpy==1.26.4, ray[train]==2.55.0, pandas==3.0.6, fsspec and requests: ``` python -c "import pyarrow" # 26.0.0: ImportError, NumPy 2.0 required python -c "import pyarrow" # 22.0.0 to 25.0.0: ok python -c "import ray.train" # with pyarrow<26: ok ``` The image has not been rebuilt: run the Docker Build workflow on this PR, then the tutorial build, to verify. This change was authored with an AI assistant (Claude Code).
atalman
added a commit
that referenced
this pull request
Oct 28, 2026
Follow-up to #3988. Fixes the failing Build tutorials job on `main`: https://github.com/pytorch/tutorials/actions/runs/40763826746/job/123082673219 and https://github.com/pytorch/tutorials/actions/runs/40773662620 ## Description #3988 moved the CI image to Ubuntu 24.04 (Python 3.12) and pinned `numpy==1.26.4`. Nothing caps the other packages, so pip resolves newer majors that do not work with it. Two caps in `.ci/docker/requirements.txt` fix the four failing tutorials: - `pyarrow<26`: `pyarrow` 26.0.0 raises `ImportError: pyarrow requires NumPy 2.0 or newer, found 1.26.4`. Its wheels declare no numpy requirement, so pip installs it anyway. This broke `distributed_training_with_ray_tutorial`, `hyperparameter_tuning_tutorial` and `serving_tutorial`. `ray.train` and `ray.tune` report any failure to import `fsspec`, `pandas`, `pyarrow` or `requests` as "dependencies are missing", which hides the real error. - `pandas<3`: pandas 3.0 makes `Series.values` read-only (copy-on-write). Ax 0.4.3 builds its observation means from `d["mean"].values` and assigns into them in its winsorize transform, so `ax_multiobjective_nas_tutorial` fails with `ValueError: assignment destination is read-only`. Both caps can come out when numpy moves to 2.x (and, for pandas, when the Ax tutorial moves to an Ax release that works with pandas 3). Alternative: move numpy to 2.x, which needs new numba and spacy and is a much larger change. Checked in a Python 3.12 venv with numpy 1.26.4: `pyarrow` 26.0.0 fails to import and 22.0.0 to 25.0.0 import fine, `import ray.train` passes with the cap, and `to_numpy()` is read-only under pandas 3.0.6. A resolve of `requirements.txt` gives pandas 2.3.3, pyarrow 25.0.1, numpy 1.26.4. On the first run of this PR the `pyarrow` shards (1 and 9) passed and the Ax shard (4) failed; the second commit adds the pandas cap for it. **Not verified:** the Build tutorials run on the latest commit of this PR. > **AI disclosure:** this change was authored with an AI assistant (Claude Code). It is a draft until the author has reviewed it. ## Checklist - [ ] The issue that is being fixed is referred in the description (see above "Fixes #ISSUE_NUMBER") - [ ] Only one issue is addressed in this pull request - [ ] Labels from the issue that this PR is fixing are added to this pull request - [ ] No unnecessary issues are included into this pull request. --------- Co-authored-by: Andrey Talman <atalman@users.noreply.github.com>
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 the failing Docker Build on
main: https://github.com/pytorch/tutorials/actions/runs/40756929817/job/123058245317Description
torch 2.15 requires Python >= 3.11 and has no cp310 wheels, but the CI image is Ubuntu 22.04 (system Python 3.10), so
pip install torch==2.15fails withNo matching distribution found. This moves the image to Ubuntu 24.04 (Python 3.12) and makes the changes that move needs:build.sh:UBUNTU_VERSION22.04 -> 24.04 (nvidia/cuda:12.6.3-devel-ubuntu24.04exists).install_base.sh: drop thecmake=3.22*pin, which does not exist on 24.04.install_pip_requirements.sh: 24.04 marks system Python as externally managed (PEP 668); write/etc/pip.confwithbreak-system-packages = true(a config file so thesudo pipcall in.jenkins/build.shis covered), and use--ignore-installedfor the pip upgrade since the apt pip has no RECORD file.requirements.txt: numpy 1.24.4 -> 1.26.4, scipy 1.11.1 -> 1.11.4, numba 0.57.1 -> 0.59.1, spacy 3.7.1 -> 3.7.2, the first releases with Python 3.12 wheels. Without the numpy bump, resolution fails against onnx on 3.12.Alternative: keep 22.04 and install Python 3.11, which leaves every pin alone but adds a non-distro Python to the image.
Not verified: I only checked dependency resolution, with
uv pip compile --python-version 3.12and torch 2.14.1 standing in for 2.15 (the internal mirror lacked the 2.15 wheels). The image was not built and no tutorial was run against the bumped numpy/scipy/numba/spacy. Please run the Docker Build workflow on this PR before merging.Checklist