mirror of
https://github.com/vale981/ray
synced 2025-03-12 06:06:39 -04:00

This change adds introductory deployment graph documentation. Links to updated documentation: * [Model Composition](https://ray--26860.org.readthedocs.build/en/26860/serve/model_composition.html) * [Examples Overview](https://ray--26860.org.readthedocs.build/en/26860/serve/tutorials/index.html) * [Deployment Graph Pattern Overview](https://ray--26860.org.readthedocs.build/en/26860/serve/tutorials/deployment-graph-patterns.html) * [Pattern: Linear Pipeline](https://ray--26860.org.readthedocs.build/en/26860/serve/tutorials/deployment-graph-patterns/linear_pipeline.html) * [Pattern: Branching Input](https://ray--26860.org.readthedocs.build/en/26860/serve/tutorials/deployment-graph-patterns/branching_input.html) * [Pattern: Conditional](https://ray--26860.org.readthedocs.build/en/26860/serve/tutorials/deployment-graph-patterns/conditional.html) Co-authored-by: Archit Kulkarni <architkulkarni@users.noreply.github.com>
1,009 B
1,009 B
Pattern: Linear Pipeline
This deployment graph pattern is a linear pipeline of deployments. The request flows from each deployment to the next, getting transformed each time.
Code
:language: python
:start-after: __graph_start__
:end-before: __graph_end__
Execution
This graph has three nodes, which are all instances of the Model
deployment. Each Model
is constructed with a different weight
, and its forward
method adds that weight
to the input.
The call graph calls each deployment's forward
method, one after another, which adds all the Model
's weights
to the input. The code executes the graph on an input of 0 and after adding all the weights (0, 1, and 2), it gets a final sum
of 3:
$ python linear_pipeline.py
3