Skip to content

Add Python 3.14 support#3635

Merged
JCGoran merged 26 commits into
masterfrom
jelic/py314
Oct 29, 2025
Merged

Add Python 3.14 support#3635
JCGoran merged 26 commits into
masterfrom
jelic/py314

Conversation

@JCGoran

@JCGoran JCGoran commented Oct 8, 2025

Copy link
Copy Markdown
Collaborator

Changes:

  • update max Python version to 3.14 in CI
  • bump version of Ubuntu in CI from 22.04 to 24.04
  • add workaround for MPICH issue on Ubuntu 24.04
  • update Python dependencies for Python 3.14
  • explicitly skip free-threaded build
  • add fix for refcounting change in Python 3.14

@JCGoran JCGoran added the python label Oct 8, 2025
@JCGoran JCGoran linked an issue Oct 8, 2025 that may be closed by this pull request
3 tasks
@codecov

codecov Bot commented Oct 9, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.04%. Comparing base (eef4d9c) to head (5a52b55).
⚠️ Report is 56 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3635      +/-   ##
==========================================
- Coverage   68.55%   68.04%   -0.51%     
==========================================
  Files         686      686              
  Lines      116791   110907    -5884     
==========================================
- Hits        80065    75467    -4598     
+ Misses      36726    35440    -1286     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

✔️ 54ea798 -> artifacts URL

@JCGoran

JCGoran commented Oct 20, 2025

Copy link
Copy Markdown
Collaborator Author

So most of this works, except for Linux wheels on Azure. For some reason, MPI complains with:

======= Testing MPICH ========
+ mpirun.mpich -n 2 /home/vsts/work/1/s/nrn_test_venv_311/bin/python src/parallel/test0.py -mpi --expected-hosts 2
Warning: no DISPLAY environment variable.
--No graphics will be displayed.
Warning: no DISPLAY environment variable.
--No graphics will be displayed.
I am 0 of 1
numprocs=1
MPI Error : #ranks (1) different that the expected (2)
I am 0 of 1
numprocs=1
MPI Error : #ranks (1) different that the expected (2)

Maybe something changed on Azure infra? But then I would expect it to fail on other PRs as well, but it's only failing for this one. Note that mpi4py is always built from source, so I don't think it makes a difference. I also haven't made any changes that have to do with MPI.

@nrnhines any ideas?

@github-actions

Copy link
Copy Markdown
Contributor

✔️ d37716b -> artifacts URL

@nrnhines

nrnhines commented Oct 20, 2025

Copy link
Copy Markdown
Member

any ideas

What I'm experiencing is that I can download the wheel artifacts and install for python3.14 and both mpich and openmpi are working with it. i.e. VERSION 9.0.0-25-gd37716bdf jelic/py314 (d37716bdf). But note that the mpi library that is loaded (e.g possibly specified with LD_LIBRARY_PATH) has to be consistent with the mpirun.

~/Downloads$ export LD_LIBRARY_PATH=$HOME/soft/mpich/lib
~/Downloads$ $HOME/soft/mpich/bin/mpirun -n 2 python $HOME/neuron/nrn/src/parallel/test0.py
numprocs=2
I am 0 of 2
I am 1 of 2
~/Downloads$ unset LD_LIBRARY_PATH
~/Downloads$ mpirun.openmpi -n 2 python $HOME/neuron/nrn/src/parallel/test0.py
numprocs=2
I am 1 of 2
I am 0 of 2

So it seems that the CI portion of the problem is the test part.

@nrnhines

Copy link
Copy Markdown
Member

any ideas

I'm not at all familiar with update-alternatives. To make sure it is working properly, I would print the path of the libmpi that was dynamically loaded and make sure that is consistent with the mpirun. I.e are we certain that in the execution of

mpirun.mpich -n 2 /home/vsts/work/1/s/nrn_test_venv_314/bin/python src/parallel/test0.py -mpi --expected-hosts 2

that the mpich verson of libmpi.so was dynamically loaded. E.g. was that ensured by

sudo update-alternatives --set mpi-x86_64-linux-gnu /usr/include/x86_64-linux-gnu/mpich

@nrnhines

nrnhines commented Oct 21, 2025

Copy link
Copy Markdown
Member

I'm looking at the use of load_mpi in src/nrnmpi/nrnmpi_dynam.cpp and on first attempt it appears to dlopen the filename "libmpi.so" without a full path, then, if it exists, the path specified by the environment variable MPI_LIB_NRN_PATH, and finally "libmpich.sh" without a full path. The last is intended as a fallback for cray systems.

Grok says we can use ldconfig -p | grep libmpi.soto list the full path. On my machine.

$ ldconfig -p | grep libmpi.so
	libmpi.so.40 (libc6,x86-64) => /home/hines/soft/openmpi/lib/libmpi.so.40
	libmpi.so.40 (libc6,x86-64) => /lib/x86_64-linux-gnu/libmpi.so.40
	libmpi.so (libc6,x86-64) => /home/hines/soft/openmpi/lib/libmpi.so

which seems ok. Unfortunately, ldconfig -p ignores LD_LIBRARY_PATH

$ export LD_LIBRARY_PATH=$HOME/soft/mpich/lib
$ ldconfig -p | grep libmpi.so
	libmpi.so.40 (libc6,x86-64) => /home/hines/soft/openmpi/lib/libmpi.so.40
	libmpi.so.40 (libc6,x86-64) => /lib/x86_64-linux-gnu/libmpi.so.40
	libmpi.so (libc6,x86-64) => /home/hines/soft/openmpi/lib/libmpi.so

@JCGoran JCGoran changed the title Add Python3.14 support Add Python 3.14 support Oct 22, 2025
@azure-pipelines

Copy link
Copy Markdown

✔️ 7c1a2ba -> Azure artifacts URL

Comment thread .github/workflows/wheels-ci.yml
Comment thread .github/workflows/wheels-template.yml
Comment thread azure-pipelines.yml
Comment thread cmake/NeuronTestHelper.cmake
Comment thread docs/docs_requirements.txt
Comment thread packaging/python/build_wheels.bash
Comment thread pyproject.toml
Comment thread pyproject.toml
@JCGoran JCGoran marked this pull request as ready for review October 22, 2025 12:15
Comment thread ci/win_install_deps.cmd Outdated
Comment thread packaging/python/build_wheels.bash
Comment thread nmodl_requirements.txt
Comment thread pyproject.toml

@nrnhines nrnhines left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll approve after @ramcdougal has a chance to weigh in in regard to the rxd performance question.

Comment thread ci/win_install_deps.cmd Outdated
Comment thread cmake/NeuronTestHelper.cmake
@github-actions

Copy link
Copy Markdown
Contributor

✔️ 7c1a2ba -> artifacts URL

@azure-pipelines

Copy link
Copy Markdown

✔️ b30a4bb -> Azure artifacts URL

@github-actions

Copy link
Copy Markdown
Contributor

✔️ b30a4bb -> artifacts URL

@sonarqubecloud

Copy link
Copy Markdown

@azure-pipelines

Copy link
Copy Markdown

✔️ 5a52b55 -> Azure artifacts URL

@github-actions

Copy link
Copy Markdown
Contributor

✔️ 5a52b55 -> artifacts URL

@mgeplf

mgeplf commented Oct 28, 2025

Copy link
Copy Markdown
Collaborator

I don't have anything else to add here, things look reasonable to me.

@JCGoran JCGoran merged commit 738ee02 into master Oct 29, 2025
47 checks passed
@JCGoran JCGoran deleted the jelic/py314 branch October 29, 2025 10:21
JCGoran added a commit that referenced this pull request Nov 10, 2025
* update max Python version to 3.14 in CI

* bump version of Ubuntu in CI from 22.04 to 24.04

* add workaround in CI for MPICH issue on Ubuntu 24.04 (see #3646)

* update ci/requirements.txt for Python 3.14

* explicitly skip free-threaded build

* use cibuildwheel>=3.2.1 when building wheels

* remove pinning of max versions in Python runtime dependencies

* fix Python refcounting test on Python 3.14
@JCGoran JCGoran mentioned this pull request Nov 13, 2025
20 tasks
JCGoran added a commit that referenced this pull request Nov 13, 2025
* update max Python version to 3.14 in CI

* bump version of Ubuntu in CI from 22.04 to 24.04

* add workaround in CI for MPICH issue on Ubuntu 24.04 (see #3646)

* update ci/requirements.txt for Python 3.14

* explicitly skip free-threaded build

* use cibuildwheel>=3.2.1 when building wheels

* remove pinning of max versions in Python runtime dependencies

* fix Python refcounting test on Python 3.14
JCGoran added a commit that referenced this pull request Nov 14, 2025
* update max Python version to 3.14 in CI

* bump version of Ubuntu in CI from 22.04 to 24.04

* add workaround in CI for MPICH issue on Ubuntu 24.04 (see #3646)

* update ci/requirements.txt for Python 3.14

* explicitly skip free-threaded build

* use cibuildwheel>=3.2.1 when building wheels

* remove pinning of max versions in Python runtime dependencies

* fix Python refcounting test on Python 3.14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python 3.14 support

3 participants