-
Notifications
You must be signed in to change notification settings - Fork 26
build: add freethreaded python ci and wheels #284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Nope it's in beta now! |
refreshing this PR since there's now beta2 of the freethreaded pydantic |
I noticed when it's doing the freethreaded windows build that the MS linker is looking for Results in the error (I think):
I think that's the only blocker on windows. |
That looks like https://gitlab.kitware.com/cmake/cmake/-/issues/26016, which is supposedly fixed but I'm not sure in which CMake version. |
Ah, sorry, now I see 3.30.3 — so supposedly it should work here. |
Sorry for thinking loudly. I see that CMake is doing the right thing:
So looks like |
No problem - think out loud all you want. I'm just not sure where to look :-) |
You need to use the modern FindPython, not the old one. FindPythonLibs / FindPythonInterp was "removed" (sort of) in CMake 3.27, so that's not what 3.30.3 is referring to. |
Right above here Lines 16 to 21 in ea10902
set(PYBIND11_FINDPYTHON ON) . pybind11 3.0 will change the default.
|
Thanks @henryiii, giving it a try. |
3.13t manylinux wheels are dying on tests because of missing awkward 3.13t wheel. Otherwise they build fine! |
@henryiii I guess the best way to test this in freethreaded mode for races and such would to first just try pytest-parallel? Probably mark the dask tests to not be run in parallel? |
Yes, I believe so. |
Nice - parallel tests seem to go, except on windows. Looks like some issue with parallel processing on windows to begin with. |
I don't really understand this failure in macos. Must be a threadsafety thing, but then why not in ubuntu? |
Oh wow, it's definitely a thread safety issue (it passed in this latest commit!). Yikes! |
@nsmith- Any first ideas on what needs a mutex around it? |
For reference the error that crops up in the MT tests is:
|
My best guess would be something related to this: Lines 106 to 108 in 093ce46
is not threadsafe. |
Digging around there seems to be something suspicious w.r.t. the Will continue digging. |
@@ -50,16 +49,21 @@ jobs: | |||
fetch-depth: 0 | |||
fetch-tags: true | |||
|
|||
- uses: actions/setup-python@v3 | |||
- uses: Quansight-Labs/setup-python@v5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normal setup-python works now (but not such an old version!)
- uses: Quansight-Labs/setup-python@v5 | |
- uses: actions/setup-python@v5 |
@@ -94,7 +97,7 @@ skip = ["pp*-*"] | |||
test-extras = "test" | |||
test-command = "python -m pytest {package}/tests" | |||
# When cpython 3.7 is dropped we can ignore i686 (numpy not built) | |||
test-skip = ["pp*-*", "*-musllinux_*", "cp3{10,11,12}-win32", "cp3{8,9,10,11,12}-manylinux_i686"] | |||
test-skip = ["pp*-*", "*-musllinux_*", "cp3{10,11,12}-win32", "cp3{8,9,10,11,12}-manylinux_i686", "*cp313t*"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test-skip = ["pp*-*", "*-musllinux_*", "cp3{10,11,12}-win32", "cp3{8,9,10,11,12}-manylinux_i686", "*cp313t*"] | |
test-skip = ["pp*-*", "*-musllinux_*", "cp3{10,11,12}-win32", "cp3{8,9,10,11,12}-manylinux_i686", "*cp313t*"] |
This is skipping the tests on 3.13t, so they aren't currently running. Ahh, you are running the normal tests in free-threading; probably makes sense until that is fixed.
run: python -m pytest -ra | ||
|
||
- name: Test package (parallel) | ||
if: matrix.python-version == '3.13t' && matrix.runs-on != 'windows-latest' | ||
run: python -Xgil=0 -m pytest -ra --tests-per-worker auto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could increase this a bit, I think it will be around 2-4 on GHA, more might fail more consistently.
I'd recommend retrying with pybind11 3.0, we did make a few fixes related to free-threading. |
Will add wheels when they're fixed up by #283