Skip to content
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

Replace default asyncio by uvloop when available #821

Draft
wants to merge 2 commits into
base: branch-0.24
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ucp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@
logger = get_ucxpy_logger()


try:
import uvloop

uvloop.install()
except ImportError:
pass
Comment on lines +44 to +49
Copy link
Member

Choose a reason for hiding this comment

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

Per Jim's comment, perhaps this should be moved to the benchmarking script instead?



__version__ = _get_versions()["version"]
__ucx_version__ = "%d.%d.%d" % get_ucx_version()

Expand Down
3 changes: 2 additions & 1 deletion ucp/continuous_ucx_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def _fd_reader_callback(self):

# Notice, we can safely overwrite `self.dangling_arm_task`
# since previous arm task is finished by now.
assert self.asyncio_task is None or self.asyncio_task.done()
if self.asyncio_task is None or self.asyncio_task.done():
return
self.asyncio_task = self.event_loop.create_task(self._arm_worker())

async def _arm_worker(self):
Expand Down