Skip to content

Support streaming + process-based execution mechanism#609

Merged
gtopper merged 2 commits intomlrun:developmentfrom
gtopper:ML-11878
Jan 29, 2026
Merged

Support streaming + process-based execution mechanism#609
gtopper merged 2 commits intomlrun:developmentfrom
gtopper:ML-11878

Conversation

@gtopper
Copy link
Collaborator

@gtopper gtopper commented Jan 28, 2026

ML-11878

Enables streaming (generator-based) runnables to work with process_pool and dedicated_process execution mechanisms.

Since generators cannot cross process boundaries directly, this implementation uses multiprocessing queues to transfer chunks from child processes to the parent:

  • Child process iterates the generator and sends chunks via queue
  • Parent process yields chunks from a queue-reading generator
  • Errors are serialized and re-raised in the parent as RuntimeError

Changes:

  • _streaming_run_wrapper / _static_streaming_run – execute streaming runnables in child process
  • _read_streaming_queue / _async_read_streaming_queue – yield chunks from queue in parent
  • Lazy-initialized multiprocessing.Manager for queue creation
  • Comprehensive test coverage for all execution mechanisms

[ML-11878](https://iguazio.atlassian.net/browse/ML-11878)

Enables streaming (generator-based) runnables to work with process_pool and dedicated_process execution mechanisms.

Since generators cannot cross process boundaries directly, this implementation uses multiprocessing queues to transfer chunks from child processes to the parent:
* Child process iterates the generator and sends chunks via queue
* Parent process yields chunks from a queue-reading generator
* Errors are serialized and re-raised in the parent as RuntimeError

Changes:
* `_streaming_run_wrapper` / `_static_streaming_run` - execute streaming runnables in child process
`_read_streaming_queue` / `_async_read_streaming_queue` - yield chunks from queue in parent
* Lazy-initialized `multiprocessing.Manager` for queue creation
* Comprehensive test coverage for all execution mechanisms
@gtopper gtopper marked this pull request as ready for review January 28, 2026 11:52
Copy link
Collaborator

@royischoss royischoss left a comment

Choose a reason for hiding this comment

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

Hey looks good few comments

@gtopper gtopper requested a review from royischoss January 28, 2026 14:21
Copy link
Collaborator

@royischoss royischoss left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@gtopper gtopper merged commit 0bc0410 into mlrun:development Jan 29, 2026
5 checks passed
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.

2 participants