-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
ray.experimental.serve
Module
#4095
Conversation
Test FAILed. |
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 stuff! Left some comments/questions.
python/ray/serve/README.md
Outdated
@@ -0,0 +1,63 @@ | |||
# Ray Serve Module |
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.
Use rst instead of markdown
python/ray/serve/Makefile
Outdated
@@ -0,0 +1,6 @@ | |||
format: |
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.
this file should be removed
python/ray/serve/.gitignore
Outdated
@@ -0,0 +1,3 @@ | |||
.vscode | |||
__pycache__ | |||
.benchmarks |
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.
Put these in the top level gitignore
python/ray/serve/__init__.py
Outdated
@@ -0,0 +1,12 @@ | |||
""" |
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.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
at the top of all Python files
|
||
@pytest.fixture(scope="module") | ||
def router(): | ||
ray.init() |
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 need ray.shutdown()
to run in the teardown
python/ray/serve/router/routers.py
Outdated
|
||
@ray.remote | ||
class DeadlineAwareRouter: | ||
def __init__(self, router_name): |
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.
class doc string and method doc strings also
python/ray/serve/mixin.py
Outdated
return func | ||
|
||
|
||
class RayServeMixin: |
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.
class doc string
also, can you explain what the name means?
|
||
|
||
@ray.remote | ||
class HTTPFrontendActor: |
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.
class doc string
python/ray/serve/router/__init__.py
Outdated
import ray | ||
|
||
|
||
def start_router(router_class, router_name): |
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.
doc string
python/ray/serve/router/routers.py
Outdated
|
||
|
||
@total_ordering | ||
class SingleQuery: |
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.
class doc string
My concern is that the |
Combined with uvicorn does have better performance than tornado. That’s why
we are considering it.
https://www.techempower.com/benchmarks/#section=data-r17&hw=ph&test=fortune&l=zijzen-1
…On Wed, Feb 20, 2019 at 7:03 AM Wang Qing ***@***.***> wrote:
My concern is that the python http server impemented by Starlette may not
meet the perf requirements for such real-time scenario.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4095 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AUI_g5hRrfL7-qY3gTBAlG4av5g7RdNkks5vPWPHgaJpZM4bCeAW>
.
|
Test FAILed. |
@simon-mo Thanks for your reply. |
Test FAILed. |
@@ -0,0 +1,63 @@ | |||
# Ray Serve Module |
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.
This file is redundant.
5166cfa
to
28a8fc3
Compare
Test FAILed. |
Test FAILed. |
Test FAILed. |
Test FAILed. |
When I run |
I also see this failure
|
@robertnishihara can we just call the tests separately? I have been debugging this for some time now and still can't fix it somehow, the only clue it got is that:
The ordering issue was due to oversubscribtion, should be fixed now. |
Test FAILed. |
Test FAILed. |
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.
Thanks @simon-mo, this looks great! I'll merge this once the CI passes.
As discussed offline, we should treat uvicorn
and starlette
as placeholders for the time being and not make any architectural decisions that tie us to them.
We should probably also run these tests in our CI, but that will require upgrading to 3.6 since starlette requires 3.6. That can be done in a follow up PR. |
Test FAILed. |
Can we rename ray.serve to ray.serving in a future PR? That seems more natural, what do you think? |
This PR proposes a new module name
ray.serve
ray.serve
is a module for publishing your actors to interact with outside world. It utilizes ray to horizontally scale your actors.Architecture
In the following illustration, call chain goes from top to bottom.
Each box is one or more replicated ray actors.
Frontend Tier
The frontend tier is repsonsible for interface with the world. Currently
ray.serve
will provideimplementation for HTTP Frontend and a zeromq high performance frontend.
Router Tier
The router tier receives calls from frontend and route them to the managed actors. Routers both route and queue incoming queries.
ray.serve
has native support for (micro-)batching queries.In addition, we implemented a deadline aware routers that will put high priority queries in the front
of the queue so they will be delivered first.
Managed Actor Tier
Managed actors will be managed by routers. These actors can contains arbitrary methods. Methods in the actors class are assumed to be able to take into a batch of input at a time. If this cannot be assumed, you can use the
@single_input
decorator,ray.serve
will run your method in a for loop working on the micro-batch.cc @atumanov @robertnishihara
P.S.
This is a re-implementation of an earlier prototype