Skip to content

Synchronization functions and USM allocations functions release GIL - #736

Merged
oleksandr-pavlyk merged 3 commits into
masterfrom
wait-releases-GIL
Jan 5, 2022
Merged

oleksandr-pavlyk merged 3 commits into
masterfrom
wait-releases-GIL

Conversation

@oleksandr-pavlyk

@oleksandr-pavlyk oleksandr-pavlyk commented Jan 5, 2022 •

Copy link
Copy Markdown
Contributor

DPCTLQueue_Wait and friends are declared nogil, and their use
is moved into with nogil context.

This allows us to use sycl::host_task to manipulate reference count on a Python object without introducing a deadlock.

Since USM allocation functions are also synchronous and can take some time for
large allocations, we release GIL for them too. We may perhaps revisit this in the future, only release GIL for large enough allocations.

DPCTLQueue_Wait and friends are declared nogil, and their use
is moved into `with nogil` context.

This allows us to use host_task to decrement reference count on
a Python object without introducing a deadlock.
@github-actions

github-actions Bot commented Jan 5, 2022

Copy link
Copy Markdown

@coveralls

coveralls commented Jan 5, 2022 •

Copy link
Copy Markdown
Collaborator

Coverage Status

Coverage decreased (-0.04%) to 81.487% when pulling 0ae7844 on wait-releases-GIL into b4b9722 on master.

@diptorupd

Copy link
Copy Markdown
Contributor

Does it address #170?

diptorupd
diptorupd previously approved these changes Jan 5, 2022
Large USM allocations can be constly, so releasing GIL while
invoking them may be a good idea.
@oleksandr-pavlyk

Copy link
Copy Markdown
Contributor Author

The latest batch of changes closes #170

@oleksandr-pavlyk oleksandr-pavlyk changed the title Synchronization function release GIL Synchronization functions and USM allocations functions release GIL Jan 5, 2022
@oleksandr-pavlyk
oleksandr-pavlyk merged commit fab1c99 into master Jan 5, 2022
@oleksandr-pavlyk
oleksandr-pavlyk deleted the wait-releases-GIL branch January 5, 2022 20:54
@github-actions

github-actions Bot commented Jan 5, 2022

Copy link
Copy Markdown

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

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.

3 participants