Skip to content

Release GIL around blocking oneMKL calls in BLAS/LAPACK - #3027

Merged
antonwolfy merged 13 commits into
IntelPython:masterfrom
abagusetty:fix/gil-release-blas-lapack
Aug 18, 2026
Merged

Release GIL around blocking oneMKL calls in BLAS/LAPACK#3027
antonwolfy merged 13 commits into
IntelPython:masterfrom
abagusetty:fix/gil-release-blas-lapack

Conversation

@abagusetty

Copy link
Copy Markdown
Contributor

potrf, getrf, geqrf, gesv, gesvd, heevd, syevd, ungqr and the BLAS dot/gemm family block the calling thread for the whole oneMKL call while holding the GIL. That stalls every other Python thread, including the host tasks dpnp queues to manage object lifetimes, which reacquire the GIL to drop references.

Completes the backport of #2850, which applied the same fix to orgqr.cpp; gesv_batch, gesvd_batch, heevd_batch and syevd_batch already had it.

  • 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?

potrf, getrf, geqrf, gesv, gesvd, heevd, syevd, ungqr and the BLAS
dot/gemm family block the calling thread for the whole oneMKL call while
holding the GIL. That stalls every other Python thread, including the
host tasks dpnp queues to manage object lifetimes, which reacquire the
GIL to drop references.

Completes the backport of IntelPythongh-2850, which applied the same fix to
orgqr.cpp; gesv_batch, gesvd_batch, heevd_batch and syevd_batch already
had it.
abagusetty and others added 3 commits August 14, 2026 12:17
potrf, getrf, geqrf, gesv, gesvd, heevd, syevd, ungqr and the BLAS
dot/gemm family block the calling thread for the whole oneMKL call while
holding the GIL. That stalls every other Python thread, including the
host tasks dpnp queues to manage object lifetimes, which reacquire the
GIL to drop references.

Completes the backport of IntelPythongh-2850, which applied the same fix to
orgqr.cpp; gesv_batch, gesvd_batch, heevd_batch and syevd_batch already
had it.
@intel-python-devops

Copy link
Copy Markdown

Can one of the admins verify this patch?

Comment thread dpnp/tests/test_blas_lapack_gil.py
@coveralls

coveralls commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Coverage Status

No base build to compare — abagusetty:fix/gil-release-blas-lapack into IntelPython:master

@antonwolfy antonwolfy added this to the 0.21.0 release milestone Aug 17, 2026
Comment thread dpnp/tests/test_blas_lapack_gil.py

@antonwolfy antonwolfy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @abagusetty for contributing the complete fix, LGTM

@antonwolfy
antonwolfy merged commit 7a2714b into IntelPython:master Aug 18, 2026
86 of 94 checks passed
github-actions Bot added a commit that referenced this pull request Aug 18, 2026
potrf, getrf, geqrf, gesv, gesvd, heevd, syevd, ungqr and the BLAS
dot/gemm family block the calling thread for the whole oneMKL call while
holding the GIL. That stalls every other Python thread, including the
host tasks dpnp queues to manage object lifetimes, which reacquire the
GIL to drop references.

Completes the backport of #2850, which applied the same fix to
orgqr.cpp; gesv_batch, gesvd_batch, heevd_batch and syevd_batch already
had it. 7a2714b
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.

5 participants