Skip to content

Remove python-gil requirement and enable free-threaded Python#2250

Draft
ndgrigorian wants to merge 9 commits intofeature/uncouple-tensor-from-dpctlfrom
feature/enable-free-threaded-python
Draft

Remove python-gil requirement and enable free-threaded Python#2250
ndgrigorian wants to merge 9 commits intofeature/uncouple-tensor-from-dpctlfrom
feature/enable-free-threaded-python

Conversation

@ndgrigorian
Copy link
Collaborator

This PR removes the required python-gil dependency from the dpctl conda package workflow and enables free-threaded Python in extension modules

Adjustments are made to the SequentialOrderManager class such that the class is safe in free-threaded, including mutexes in the C++ class as a fall-back in case of (not recommended) simultaneous access to its members and methods

Caching using defaultdict such as that in SequentialOrderManager and the queue and device managers are also adjusted to be more thread-safe, using lazily initialized factory functions so each thread will carry its own cache or manager

This PR builds on top of work already done removing the tensor submodule, which is pending migration to dpnp

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?
  • If this PR is a work in progress, are you opening the PR as a draft?

@ndgrigorian ndgrigorian changed the base branch from master to feature/uncouple-tensor-from-dpctl February 17, 2026 01:29
@ndgrigorian ndgrigorian force-pushed the feature/uncouple-tensor-from-dpctl branch from dcac1f6 to e450664 Compare February 17, 2026 02:08
@ndgrigorian ndgrigorian force-pushed the feature/enable-free-threaded-python branch from 085aece to 5dda977 Compare February 17, 2026 03:12
@github-actions
Copy link

@ndgrigorian ndgrigorian force-pushed the feature/enable-free-threaded-python branch 3 times, most recently from eed544e to 82e9a5e Compare February 17, 2026 12:03
@ndgrigorian ndgrigorian force-pushed the feature/enable-free-threaded-python branch from 82e9a5e to a1d36ce Compare February 17, 2026 12:06
free-threaded builds use a new GC that skips PyGC_Head, and this seems to cause some objects to change in size by ~16 bytes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant