Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

BUG: move reduction initialization to ufunc initialization #28131

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

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

charris
Copy link
Member

@charris charris commented Jan 9, 2025

Backport of #28123.

Fixes #28041.

Because the reduction initialization happens during ufunc initialization, this means that ufunc initialization now depends on the allocator context variables being initialized, so I moved those initialization steps up before ufunc initialization in the main _multiarray_umath module initialization function.

  • BUG: move reduction initialization to ufunc initialization

  • MAINT: refactor to call get_initial_from_ufunc during init

  • TST: add test for multithreaded reductions

  • MAINT: fix linter

  • Apply suggestions from code review

  • MAINT: simplify further


* BUG: move reduction initialization to ufunc initialization

* MAINT: refactor to call get_initial_from_ufunc during init

* TST: add test for multithreaded reductions

* MAINT: fix linter

* Apply suggestions from code review

Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>

* MAINT: simplify further

---------

Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
@charris charris added 08 - Backport Used to tag backport PRs 39 - free-threading PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703) labels Jan 9, 2025
@charris charris added this to the 2.2.2 release milestone Jan 9, 2025
@charris charris changed the title BUG: move reduction initialization to ufunc initialization (#28123) BUG: move reduction initialization to ufunc initialization Jan 9, 2025
@charris charris merged commit 1dc5989 into numpy:maintenance/2.2.x Jan 9, 2025
68 checks passed
@charris charris deleted the backport-28123 branch January 9, 2025 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
00 - Bug 08 - Backport Used to tag backport PRs 39 - free-threading PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.