-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Serve] Add experimental pipeline docs #20292
Conversation
@@ -24,7 +24,8 @@ async def call_async(self, input_arg: Tuple[Any]) -> Union[Any, ObjectRef]: | |||
class LocalExecutor(Executor): | |||
"""Executor that runs code in-process.""" | |||
|
|||
def __init__(self, serialized_callable_factory: bytes, config: StepConfig): | |||
def __init__(self, serialized_callable_factory: bytes, | |||
_config: StepConfig): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused variable, underscore it.
@@ -26,11 +25,8 @@ class Pipeline: | |||
def __init__(self, entry_node: PipelineNode): | |||
self._entry_node = entry_node | |||
|
|||
def deploy(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
best error is attribute doesn't exist :D.
@edoakes ready for review |
@richardliaw help review too please? |
gave feedback offline. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome start!
doc/source/serve/ml-models.rst
Outdated
@@ -44,6 +44,10 @@ dive. | |||
Model Composition | |||
================= | |||
|
|||
.. note:: | |||
Serve recently added experimental first-class model composition API. Please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Serve recently added experimental first-class model composition API. Please | |
Serve recently added an experimental first-class API for model composition (pipelines). Please |
please try to be careful about grammar in documentation
doc/source/serve/ml-models.rst
Outdated
@@ -44,6 +44,10 @@ dive. | |||
Model Composition | |||
================= | |||
|
|||
.. note:: | |||
Serve recently added experimental first-class model composition API. Please | |||
take a look at :ref:`Pipeline API <serve-pipeline-api>` and try it out! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
take a look at :ref:`Pipeline API <serve-pipeline-api>` and try it out! | |
take a look at the :ref:`Pipeline API <serve-pipeline-api>` and try it out! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a call to action for people to file issues or post on forum w/ questions.
doc/source/serve/pipeline.rst
Outdated
- understand the experimental pipeline API | ||
- build on top of the API to construct your multi-model inference pipelines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inconsistent period usage
doc/source/serve/pipeline.rst
Outdated
|
||
.. note:: | ||
This API is experimental and the API is subject to change. | ||
We are actively looking for feedback via the Ray Slack or Github issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add links for these
We are actively looking for feedback via the Ray Slack or Github issues. | |
We are actively looking for feedback via the Ray Slack or Github issues. |
doc/source/serve/pipeline.rst
Outdated
Serve Pipeline is a standalone package that can be used without Ray Serve. | ||
However, the expected usage is to use it inside your Serve deployment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kind of a weird thing to open with. I'd start with the problem statement: This package is mean to make it seamless to develop and deploy multi-model pipelines. Add a sentence or two about what the advantages are (all in code, good perf)
doc/source/serve/pipeline.rst
Outdated
For classes, you need to instantiate them with init args first, then pass in their | ||
upstream nodes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For classes, you need to instantiate them with init args first, then pass in their | |
upstream nodes. | |
For classes, you need to instantiate them with init args first, then pass in their | |
upstream nodes. This allows you to have the same code definition but pass different arguments, like URIs for model weights. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should add an example for that
doc/source/serve/pipeline.rst
Outdated
|
||
.. autofunction:: ray.serve.pipeline.step | ||
|
||
Here is an example pipeline that uses actors instead of local execution mode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
say that local execution mode is useful for testing?
doc/source/serve/pipeline.rst
Outdated
---------------- | ||
|
||
In this section, we show how to implement a two stage pipeline that's common | ||
for computer vision task. For workload like image classification, the preprocessing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for computer vision task. For workload like image classification, the preprocessing | |
for computer vision tasks. For workloads like image classification, the preprocessing |
doc/source/serve/pipeline.rst
Outdated
In this section, we show how to implement a two stage pipeline that's common | ||
for computer vision task. For workload like image classification, the preprocessing | ||
steps are CPU bounded and hard to parallelize. The actual inference steps can run | ||
on GPU and batched. They are often split up into separate stages and scaled separately |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do I want to batch it?
:end-before: __preprocessing_pipeline_example_end__ | ||
|
||
|
||
Ensemble Example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a section after this listing more potential use cases?
Also, can we add a simple example of "combining business logic + ML"? This could be just calling out that you can do anything in the "combine output" step
@simon-mo can you also add a pointer to this on the index page? Can say something like "Serve is great for model composition -- check out our new pipeline API!" |
doc/source/serve/index.rst
Outdated
Ray Serve enables seamless multi-models inference pipeline (also known as model composition). You can | ||
write your inference pipeline all in code and integrate business logic with ML. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add link to pipelines here?
@@ -145,5 +148,18 @@ def combiner(greeting1: str, greeting2: str): | |||
assert greeter.call("Teddy") == "Howdy Teddy!|How's it hanging, Teddy?" | |||
|
|||
|
|||
def test_cleanup_and_destory(shared_ray_instance): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
destory --> destroy
empty merge commit
Why are these changes needed?
This PR adds documentation for the
ray.serve.pipeline
module.Related issue number
Closes #19478
Checks
scripts/format.sh
to lint the changes in this PR.