Repository navigation
Conversation
… interpreter Python 3.15 has no prebuilt numpy wheel on PyPI yet, so pip builds numpy from source for every arch. During that source build meson's Cython sanity check resolves the `python3` pkg-config dependency to obtain the Python include/link flags. The ROCm manylinux image ships the system Python 3.6 pkg-config file on the default search path, so `pkg-config python3` returns Python 3.6 (`/usr/include/python3.6m`) and Cython aborts with "#error Cython requires Python 3.8+", failing the build. CUDA/CPU/XPU manylinux images do not carry that system python3 pkg-config entry, so meson falls back to the correct interpreter and their py3.15 builds (and all ROCm builds for Python versions that have prebuilt numpy wheels, i.e. 3.11-3.14) succeed. Prepend the active interpreter's own pkgconfig directory (sysconfig LIBPC) to PKG_CONFIG_PATH before installing build deps so `pkg-config python3` resolves to the interpreter we are building for (3.15). This is a no-op for Pythons whose numpy comes from a wheel (no source build) and harmless on the non-ROCm images. Test Plan: - Nightly linux-binary-manywheel: manywheel-py3_15-rocm7_1-build / manywheel-py3_15-rocm7_2-build (and the py3_15t variants) previously failed at numpy source build; they should now build. - Confirm py3.11-3.14 ROCm and CUDA/CPU/XPU builds remain green (unchanged behavior, wheel installs of numpy). Made with Cursor
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/189266
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit b8e04c6 with merge base c24fd66 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
…config python3) PR pytorch#189266 fixed the py3.15 ROCm manywheel *build* by pointing pkg-config at the build interpreter, but the binary *test* (Test PyTorch binary / smoke test) still failed at the numpy install step. The smoke test runs a separate script (`.ci/pytorch/binary_linux_test.sh`, executed inside the manylinux container) that does `pip install -q numpy ...` in a fresh process, so the build-phase `PKG_CONFIG_PATH` from `build_install_deps.py` does not carry over. Root cause is identical: py3.15 has no prebuilt numpy wheel, so pip builds numpy from source and meson's Cython sanity check resolves the `python3` pkg-config dependency. The ROCm manylinux image ships the system Python 3.6 pkg-config file on the default search path, so `pkg-config python3` returns Python 3.6 (`-I/usr/include/python3.6m`) and Cython aborts with `sanity_check_for_cython.c: error: #error Cython requires Python 3.8+`, giving `meson ... Compiler cython cannot compile programs` -> `metadata-generation-failed`. This hit py3_15/py3_15t/py3_10/py3_14t rocm7_x test jobs. Fix: mirror the build-phase helper in the generated smoke-test script. Before the numpy pip install, prepend the active interpreter's own pkgconfig dir (its `sysconfig` `LIBPC`) to `PKG_CONFIG_PATH` so `pkg-config python3` resolves to the interpreter we are testing. It is a no-op for Pythons whose numpy comes from a wheel (no source build) and harmless on CUDA/CPU/XPU images, which do not carry the system `python3` pkg-config entry. The logic is inlined via a small `python` one-liner rather than a shared module because the two callers live on either side of a Python/bash boundary (Python build script vs. a bash-generated in-container script); an inline mirror keeps the change local and readable. Test Plan: Verified the generated in-container script escapes correctly and prepends the interpreter pkgconfig dir at runtime: ``` bash -x <generated ci_test_script.sh> # numpy_libpc=<interpreter LIBPC>; export PKG_CONFIG_PATH=<LIBPC>:... ``` Shellcheck clean on the modified script: ``` shellcheck .ci/pytorch/binary_linux_test.sh ``` CI: re-approve `ciflow/binaries_wheel` on PR pytorch#189266 and confirm the previously failing `manywheel-py3_15*-rocm7_x-test` (and py3_10/py3_14t) smoke jobs pass the numpy install step on the new head SHA. Made with Cursor
|
|
|
Closing in favor of #189722 |
Summary
Python 3.15 has no prebuilt numpy wheel on PyPI yet, so pip builds numpy from source for every arch. meson's Cython sanity check resolves the
python3pkg-config dependency to get Python include/link flags. The ROCmmanylinux2_28-builderimage ships the system Python 3.6 pkg-config file on the default search path, sopkg-config python3returns Python 3.6 (-I/usr/include/python3.6m) and Cython aborts with#error Cython requires Python 3.8+.CUDA/CPU/XPU manylinux images do not carry that system
python3pkg-config entry, so meson falls back to the correct interpreter and their py3.15 builds succeed. All ROCm builds for Python versions that ship a prebuilt numpy wheel (3.11-3.14) also succeed because numpy is never built from source there.This shows up in two separate places, each fixed the same way (prepend the active interpreter's own pkgconfig directory,
sysconfigLIBPC, toPKG_CONFIG_PATHbefore numpy is installed, sopkg-config python3resolves to the interpreter being built for; no-op when numpy comes from a wheel):.ci/manywheel/build_install_deps.py): fixesmanywheel-py3_15/py3_15t-rocm*-build..ci/pytorch/binary_linux_test.sh): the smoke test runs a separate in-container script that re-installs numpy from source, so it hit the identical failure inmanywheel-py3_15/py3_15t-rocm*-test(and flakily in a couple other rocm test shards) after the build was fixed.Reference: original failing build job https://github.com/pytorch/pytorch/actions/runs/28734817308/job/85207010577 (numpy meson build,
pkg-config --modversion python3-> 3.6); failing smoke-test job https://github.com/pytorch/pytorch/actions/runs/28952344908/job/85981822513.Test plan
ciflow/binaries_wheellinux-binary-manywheel(run https://github.com/pytorch/pytorch/actions/runs/28978925760, HUD https://hud.pytorch.org/pr/189266):manywheel-py3_15-rocm7_1/7_2-buildandpy3_15tvariants build past the numpy source-build step.manywheel-py3_15/py3_15t-rocm7_1/7_2-testsmoke tests pass the numpy source build inbinary_linux_test.sh.py3_11-py3_14ROCm builds/tests remain green (numpy installed from wheel, unchanged).LIBPCalready resolves to the correct interpreter).Made with Cursor
Tracking issue: https://github.com/ROCm/frameworks-internal/issues/17233
cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @jataylo @hongxiayang @naromero77amd @pragupta @jerrymannil @xinyazhang