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.
[ADAG] Support tasks with multiple return values in aDAG (ray-project…
…#47024) aDAG currently does not support multiple return values. We would like to add general support for multiple return values. This PR supports multiple returns by returning a separate `ClassMethodNode` for each return value of the tuple. It is an incremental change for `ClassMethodNode`, addign `_is_class_method_output`, `_class_method_call`, `_output_idx`. `_output_idx` is used to guide channel allocation and output writes. User needs to specify `num_returns > 1` to hint multiple return values. The upstream task allocates a separate output channel for each return value. A downstream task reads from one of the output channels. ## What is done? We modify `ClassMethodNode` to handle two logics, one is a class method call which is the original semantics (`self.is_class_method_call == True`), another is a class method output which is responsible for one of the multiple return values (`self.is_class_method_output == True`). We modify `WriterInterface` to support writes to multiple `output_channels` with `output_idxs`. If an output index is None, it means the complete return value is written to the output channel. Otherwise, the return value is a tuple and the index is used to extract the value to be written to the output channel. We allocate separate output channels to different readers. The downstream tasks of a `ClassMethodNode` with `self.is_class_method_output == True` are the readers of an output channel of its upstream `ClassMethodNode`. The example below demonstrates this. ``` upstream ClassMethodNode (self.is_class_method_call == True, self.output_channels = [c1, c2]) --> downstream ClassMethodNode (self.is_class_method_method == True, self.output_channels[c1]) --> ... ``` Closes ray-project#45569 --------- Signed-off-by: Weixin Deng <weixin@cs.washington.edu> Signed-off-by: ujjawal-khare <ujjawal.khare@dream11.com>
- Loading branch information
1 parent
a1f83d7
commit a1cbb6a
Showing
10 changed files
with
628 additions
and
135 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
Oops, something went wrong.