Repository navigation
[SPARK-59432][CONNECT][INFRA] Build free-threaded (cp3xxt) wheels #101
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
Draft
james-willis
wants to merge
8
commits into
apache:master
Choose a base branch
from
james-willis:spark-59432-freethreaded-wheels
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+151
−8
Draft
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3cc3fed
[SPARK-59432][CONNECT][INFRA] Build free-threaded (cp3xxt) wheels
james-willis 3d0aa20
[SPARK-59432][CONNECT][INFRA] Fix --zig in the free-threaded leg; cor…
james-willis 852215e
[SPARK-59432][CONNECT][INFRA] Build the free-threaded leg without abi3
james-willis 2bec0ae
[SPARK-59432][CONNECT][INFRA] Limit the free-threaded wheel to x86_64…
james-willis 00a1ddd
[SPARK-59432][CONNECT][INFRA] Run the connect parity suite on free-th…
james-willis 7ea218b
[SPARK-59432][CONNECT][INFRA] Force the GIL off only for the parity s…
james-willis 88c466e
[SPARK-59432][CONNECT][INFRA] Add a free-threaded known-failures mani…
james-willis 23b290d
[SPARK-59432][CONNECT][INFRA] Keep the shared manifest as the --manif…
james-willis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| name: Free-threaded build | ||
|
|
||
| # Builds the pyspark-rs extension against a free-threaded (no-GIL, PEP 703) | ||
| # CPython. The extension is excluded from the workspace default-members, so the | ||
| # regular Rust CI never compiles it against a free-threaded interpreter -- and | ||
| # compiling against Py_GIL_DISABLED is exactly what enforces that every #[pyclass] | ||
| # is Sync. This workflow is that missing check. | ||
|
|
||
| on: | ||
| push: | ||
| branches: [master, "branch-*"] | ||
| pull_request: | ||
| branches: [master, "branch-*"] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| freethreaded: | ||
| name: Build the extension against the free-threaded ABI | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.13t" | ||
| - name: Install Rust toolchain | ||
| shell: bash | ||
| run: | | ||
| rustup toolchain install stable --profile minimal | ||
| rustup default stable | ||
| - name: Install protoc | ||
| shell: bash | ||
| run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | ||
| - name: Build pyspark-rs against the free-threaded interpreter | ||
| # If any #[pyclass] were not Sync, this build would fail: pyo3 requires | ||
| # Sync pyclasses on the free-threaded ABI. So a green build proves the | ||
| # extension is free-threading-safe. | ||
| env: | ||
| PYO3_PYTHON: python | ||
| shell: bash | ||
| run: cargo build -p pyspark-rs --release | ||
| - name: Import the extension on the free-threaded interpreter | ||
| # Load the built extension standalone (avoiding the Python skin's heavier | ||
| # imports) to confirm it initializes on a free-threaded interpreter, and | ||
| # report whether the GIL is disabled. Under the pinned pyo3 0.28 a plain | ||
| # #[pymodule] is free-threading by default (it emits Py_MOD_GIL_NOT_USED), | ||
| # so the GIL is expected to stay off here (gil_enabled: False). | ||
| shell: bash | ||
| run: | | ||
| cp target/release/lib_pyspark.so /tmp/_pyspark.so | ||
| cd /tmp | ||
| python -c "import sys, _pyspark; print('loaded:', _pyspark.__name__); print('gil_enabled:', sys._is_gil_enabled())" | ||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Known environmental failures on free-threaded CPython only, applied on top of | ||
| # parity_known_failures.txt by the free-threaded parity leg. Same format and drift check. | ||
| # | ||
| # protobuf publishes its C (upb) backend only as an abi3 wheel, which free-threaded | ||
| # CPython cannot load, so pip installs the pure-Python backend there. The reference | ||
| # client builds every request as a Python protobuf message and serializes it with | ||
| # SerializeToString(); the pure-Python backend serializes recursively and overflows the | ||
| # default recursion limit on very deep plans, where upb does not. The reference client | ||
| # over grpcio hits the same overflow, so this is not a client regression. | ||
| pyspark/sql/tests/connect/test_connect_error.py::SparkConnectErrorTests::test_recursion_handling_for_plan_logging # 400-deep plan: pure-Python protobuf (no free-threaded upb wheel) overflows the recursion limit serializing the request |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.