Bump the Python 3.15 numpy pin to 2.5.2 (#194741)
Bumps the Python 3.15 numpy pin from 2.5.1 to 2.5.2 in the two build-dependency tables that were still on 2.5.1.
```diff
.ci/manywheel/build_install_deps.py
- ((3, 15), "2.5.1"),
+ ((3, 15), "2.5.2"),
.ci/macwheel/build_install_deps.py
- "3.15": "2.5.1",
+ "3.15": "2.5.2",
```
Only the 3.15 entry changes; 3.14 and below keep their pins.
## Why this matters beyond a version bump
**numpy 2.5.1 shipped no cp315 wheels at all.** 2.5.2 ships 22 of them:
| platform | cp315 | cp315t |
|---|---|---|
| `manylinux_2_28_x86_64` | yes | yes |
| `manylinux_2_28_aarch64` | yes | yes |
| macOS (x86_64 + arm64) | yes | yes |
| `win_amd64` / `win_arm64` | yes | yes |
| musllinux | yes | yes |
That is what the from-source path in `.ci/manywheel/build_install_deps.py` exists for — its docstring says *"cp315 has no numpy wheel, so numpy is built from source"*, with `is_rocm_py315()` / `prefer_target_python_pkgconfig()` working around the ROCm image resolving `pkg-config python3` to Python 3.6 during numpy's meson Cython check. With 2.5.2, pip should resolve a manylinux wheel instead of building, so 3.15 wheel builds get faster and stop depending on that workaround.
## Consistency
Windows was already on 2.5.2:
```python
# .ci/pytorch/windows/build_install_deps.py
NUMPY_PINS: list[tuple[str, str]] = [
("cp315", "2.5.2"),
```
so this brings manywheel and macwheel in line rather than moving to a new version unilaterally.
## Follow-ups, deliberately not in this PR
1. **The ROCm cp315 source-build workaround is now dead code** on the happy path, and its comment is factually stale. I left it in place: it is the fallback if a cp315 wheel is ever unavailable again, and removing it touches a ROCm-only path I cannot exercise here. Worth a separate cleanup (or at least a comment update) once a 3.15 ROCm build confirms the wheel is picked up.
2. **`.ci/docker/requirements-ci.txt` has no 3.15 entry** — its top pin is `numpy==2.3.4; python_version >= "3.14"`, and 2.3.4 has no cp315 wheels. Not touched here since it never referenced 2.5.1, but it will need a 3.15 line before CI tests on 3.15.
3. `--pre` is still passed on the manywheel numpy install; with a final release pinned exactly it is a no-op, but it could be dropped.
## Verification
Pin resolution after the change (manywheel's floor-matching logic):
```
py3.15 -> 2.5.2
py3.14 -> 2.3.4
py3.13 -> 2.1.0
py3.10 -> 2.1.0
py3.9 -> 2.0.2 (DEFAULT_NUMPY)
```
macwheel table parses to `{'3.10': '2.0.2', ..., '3.14': '2.3.4', '3.15': '2.5.2'}`. numpy 2.5.2 confirmed present on PyPI (current latest) with an sdist plus the wheels above.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/194741
Approved by: https://github.com/pytorchgreenlight, https://github.com/malfet A
Andrey Talman committed
c2143af9a8661a3a829dac7581c949e97763bbf6
Parent: 64b9efd
Committed by PyTorch MergeBot <pytorchmergebot@users.noreply.github.com>
on 8/25/2026, 10:28:52 PM