Skip to content

Remove py_executor from run_actor_network#1023

Open
wence- wants to merge 4 commits into
rapidsai:release/26.06from
wence-:wence/fea/no-py-executor
Open

Remove py_executor from run_actor_network#1023
wence- wants to merge 4 commits into
rapidsai:release/26.06from
wence-:wence/fea/no-py-executor

Conversation

@wence-
Copy link
Copy Markdown
Contributor

@wence- wence- commented May 12, 2026

This, despite its name, was only ever used to offload the top-level asyncio.run to a thread so that it could run concurrently with the C++ actors. The multi-threading should belong in the application that chooses to offload work.

To facilitate this, make an awaitable version of when_all to wait for a list of C++ actors. We still need a single thread to run the resulting awaitable tasks because we do so in a fresh event loop which conflicts with any event loop that the cluster manager might have.

@wence- wence- added DO NOT MERGE Hold off on merging; see PR for details breaking Introduces a breaking change improvement Improves an existing functionality labels May 12, 2026
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 12, 2026

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@wence-
Copy link
Copy Markdown
Contributor Author

wence- commented May 12, 2026

Marking as do not merge because I don't want to get this in to 26.06, I think.

Copy link
Copy Markdown
Member

@madsbk madsbk left a comment

Choose a reason for hiding this comment

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

Thanks @wence-, I think we should include this in this release!

Comment thread python/rapidsmpf/rapidsmpf/streaming/core/actor.pyx Outdated
Comment thread python/rapidsmpf/rapidsmpf/streaming/core/actor.pyx Outdated
Comment thread python/rapidsmpf/rapidsmpf/streaming/core/actor.pyx
Comment thread python/rapidsmpf/rapidsmpf/streaming/core/actor.pyi
Comment thread python/rapidsmpf/rapidsmpf/examples/streaming/basic_example.py
Comment thread python/rapidsmpf/rapidsmpf/streaming/core/actor.pyx Outdated
@wence- wence- force-pushed the wence/fea/no-py-executor branch from 6b888ff to 3c3f12e Compare May 14, 2026 10:48
@wence- wence- marked this pull request as ready for review May 14, 2026 10:53
@wence- wence- requested a review from a team as a code owner May 14, 2026 10:53
Comment thread python/rapidsmpf/rapidsmpf/streaming/core/actor.pyx Outdated
@wence- wence- force-pushed the wence/fea/no-py-executor branch 2 times, most recently from 4ddc029 to b1c9b22 Compare May 14, 2026 15:52
@wence- wence- added non-breaking Introduces a non-breaking change and removed DO NOT MERGE Hold off on merging; see PR for details breaking Introduces a breaking change labels May 14, 2026
@wence- wence- force-pushed the wence/fea/no-py-executor branch from b1c9b22 to 0f7c234 Compare May 14, 2026 16:06
@wence- wence- added breaking Introduces a breaking change and removed non-breaking Introduces a non-breaking change labels May 14, 2026
@wence- wence- force-pushed the wence/fea/no-py-executor branch from 0f7c234 to 00b87e5 Compare May 14, 2026 16:20
Copy link
Copy Markdown
Contributor

@nirandaperera nirandaperera left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @wence-

Copy link
Copy Markdown
Member

@madsbk madsbk left a comment

Choose a reason for hiding this comment

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

@wence- did you run some numbers?

Comment thread python/rapidsmpf/rapidsmpf/streaming/core/actor.pyx
@wence-
Copy link
Copy Markdown
Contributor Author

wence- commented May 15, 2026

@wence- did you run some numbers?

Yes. With 8 threads in cudf-polars performance on the hardware I ran on was within the noise compared to main.

@wence- wence- changed the base branch from main to release/26.06 May 15, 2026 16:40
@wence- wence- requested a review from a team as a code owner May 15, 2026 16:40
@wence- wence- requested a review from a team as a code owner May 15, 2026 16:40
@wence- wence- requested a review from jameslamb May 15, 2026 16:40
wence- added 4 commits May 15, 2026 17:41
This, despite its name, was only ever used to offload the top-level
asyncio.run to a thread so that it could run concurrently with the C++
actors. The multi-threading should belong in the application that chooses
to offload work.

To facilitate this, make an awaitable version of when_all to wait for a
list of C++ actors. We still need a single thread to run the resulting
awaitable tasks because we do so in a fresh event loop which conflicts with
any event loop that the cluster manager might have.
If a python coroutine raises, the task group we are running all awaitables
in cancels them all. But the C++ awaitable is really a detached task, so
cancellation doesn't really make sense. To solve this, shield it from
cancellation and, if we are cancelled ensure it runs to completion before
raising the error.
@wence- wence- force-pushed the wence/fea/no-py-executor branch from 28f910a to 19a93b4 Compare May 15, 2026 16:41
@wence- wence- removed request for a team and jameslamb May 15, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Introduces a breaking change improvement Improves an existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set default executor in run_streaming_pipeline

6 participants