Skip to content

Freethreading on Python >= 3.13 #935

Open
@H-Plus-Time

Description

@H-Plus-Time

TLDR: I (barely) managed to get a 3.13t build functioning (a very basic read_parquet -> no segfault 🎉 check); the blockers boiled down to rust-numpy, arro3-core, and pyproj.

This more or less amounted to swapping numpy for a git dependency (to the source of PyO3/rust-numpy#471 ), marking each #[pymodule] as #[pymodule(gil_used = false)] (which is apparently fine for with_gil calls, though I haven't tried forcing thread-unsafe behaviour), and bumping pyproj's build-deps to cython==3.1.0a1 (freethreading_compatible is the directive to flip on).

The main sticking point is pyproj (a pixi environment with proj and python-freethreading does the trick, locally), so this isn't likely to be actionable for a while.

So a few questions I have are:

  1. Aside from file object interactions, there's not a whole lot that's likely to break unexpectedly in the absence of the GIL, right?
  2. The general idea going forward is to reduce, not increase the number of unmanaged rs->python callouts, right? By that I mean leaning heavily on buffer, array, dataframe and pycapsules.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions