forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Core] Streaming generator exprimental backpressure (ray-project#40285)
This is the PR to support streaming generator backpressure API. The PR is a bit big, but most of them are tests and plumbing. The API is private. I'd be open to change the name of the argument, but since we have limited time, we can probably do it in 2.9 instead with an official API proposal (this PR is needed by Ray data by 2.8). Note that the API is not supported for async actors. There's no immediate use case & supporting async actor is much more difficult because we should implement unblocking pause. ``` * Backpressure Impl * ----------------- * Streaming generator optionally supports backpressure when * `streaming_generator_backpressure_size_bytes` is included in a task spec. * * Executor Side: * - When a new object is yielded, executor sends a gRPC request that * contains an object size and records total_object_generated. * - If a total_object_generated - total_object_consumed > threshold, * it blocks a thread and pauses execution. The consumer communicates * `object_consumed` (via gRPC reply) when objects are consumed from it, * and the execution resumes. * - If a gRPC request fails, the executor assumes all the objects are * consumed and resume execution. (alternatively, we can fail execution). * * Client Side: * - If object_generated - object_consumed < threshold, it sends a reply that * contains `object_consumed` to an executor immediately. * - If object_generated - object_consumed > threshold, it doesn't reply * until objects are consumed via TryReadObjectRefStream. * - If objects are not going to be consumed (e.g., generator is deleted * or objects are already consumed), it replies immediately. ``` See more details here; https://docs.google.com/document/d/1Ugxs7SgCDqUk44SMyO_l7Rj17drHY2Qn6GDd-BxV2Pk/edit --------- Signed-off-by: Jiajun Yao <[email protected]> Signed-off-by: Hao Chen <[email protected]> Co-authored-by: SangBin Cho <[email protected]> Co-authored-by: Jiajun Yao <[email protected]> Co-authored-by: Hao Chen <[email protected]>
- Loading branch information
1 parent
2104d63
commit 5d46919
Showing
41 changed files
with
1,503 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.