Skip to content

[1/X][Pipeline] Add deployment nodes#22549

Merged
edoakes merged 7 commits intoray-project:masterfrom
jiaodong:deployment_node
Feb 23, 2022
Merged

[1/X][Pipeline] Add deployment nodes#22549
edoakes merged 7 commits intoray-project:masterfrom
jiaodong:deployment_node

Conversation

@jiaodong
Copy link
Copy Markdown
Member

@jiaodong jiaodong commented Feb 22, 2022

WIP, but content is there up for review, I will add more tests on this PR.

Diff Summary

Ray DAG Changes

  • Restructured and resolves circular imports in current dag_node.py.
  • Moved __str__ to each DAGNode subclass level with centralized utils imports
  • Removed restrictions on binding InputNode to FunctionNode and ClassMethodNode
  • Moved _contain_input_node to only ClassNode and DeploymentNode

Serve DAG Changes

  • Added DeploymentNode
    • Cannot be directly constructed
    • Holds deployment func or class body as well as handle that trivially maps to __call__ method (match current behavior)
    • Upon accessing an attribute, it will spawn DeploymentMethodNode node with other_args_to_resolve passed in to differentiate sync handle type and others
  • Added DeploymentMethodNode
    • Holds arg and deployment handle
    • Executing on it translate to deployment handle call on the method.

Related issue number

Test Plan

Ray dag unit tests
New serve deployment node tests

Checks

  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@jiaodong jiaodong requested review from edoakes, ericl and simon-mo and removed request for edoakes February 23, 2022 00:37
@jiaodong jiaodong marked this pull request as ready for review February 23, 2022 00:37
Copy link
Copy Markdown
Contributor

@ericl ericl left a comment

Choose a reason for hiding this comment

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

Core dag lib changes LGTM

@ericl ericl added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Feb 23, 2022
Copy link
Copy Markdown
Collaborator

@edoakes edoakes left a comment

Choose a reason for hiding this comment

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

Looks good, only questions/nits. Thanks for splitting this out, makes it much easier to read.


def __init__(
self,
deployment_body: Deployment,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

not sure what a deployment body is, let's just call it deployment?

Comment on lines +40 to +45
super().__init__(
method_args,
method_kwargs,
method_options,
other_args_to_resolve=other_args_to_resolve,
)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what does the parent constructor do in this case?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it's needed to have a DAGNode level stable uuid, but this comment reminds me we can merge super().init with serve DAGNode level init.. let me change it


def _execute_impl(self, *args):
"""Executor of DeploymentNode by ray.remote()"""
return self._deployment_handle.options(**self._bound_options).remote(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we support options to the handle?

Copy link
Copy Markdown
Member Author

@jiaodong jiaodong Feb 23, 2022

Choose a reason for hiding this comment

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

good question. I'm leaning towards no, I think it should be preferred to just edit the YAML for everything we put in .options(), that's the ground truth, and variants of a deployment.

Proper implementation of this can happen in diff ... #5 or so when we implement build() tho.

@jiaodong jiaodong removed the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Feb 23, 2022
Copy link
Copy Markdown
Collaborator

@edoakes edoakes left a comment

Choose a reason for hiding this comment

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

Please try to avoid force pushing, makes it harder for me to review the diffs between revisions

@edoakes edoakes merged commit a20748f into ray-project:master Feb 23, 2022
simonsays1980 pushed a commit to simonsays1980/ray that referenced this pull request Feb 27, 2022
Ray DAG Changes
- Restructured and resolves circular imports in current dag_node.py. 
- Moved `__str__` to each DAGNode subclass level with centralized utils imports
- Removed restrictions on binding `InputNode` to `FunctionNode` and `ClassMethodNode`
- Moved `_contain_input_node` to only `ClassNode` and `DeploymentNode`

Serve DAG Changes
- Added DeploymentNode
  - Cannot be directly constructed
  - Holds deployment func or class body as well as handle that trivially maps to `__call__` method (match current behavior)
  - Upon accessing an attribute, it will spawn DeploymentMethodNode node with `other_args_to_resolve` passed in to differentiate sync handle type and others
- Added DeploymentMethodNode
  - Holds arg and deployment handle
  - Executing on it translate to deployment handle call on the method.
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.

3 participants