Repository navigation
[Serve] Implement Default DAGDriver - #23301
Conversation
jiaodong
left a comment
There was a problem hiding this comment.
code lgtm for making progress before branch cut, some high level questions only, only extension of existing test suggested.
| handle = serve.run(Driver.bind(serve_dag)) | ||
| assert ray.get(handle.remote(2)) == 6 # 2 + 2*2 | ||
| handle = serve.run(DAGDriver.bind(serve_dag)) | ||
| assert ray.get(handle.predict.remote(2)) == 6 # 2 + 2*2 |
There was a problem hiding this comment.
for each test case that we're calling the python app handle, can we also make a http call ?
|
|
||
| def _load_input_schema( | ||
| input_schema: Optional[Union[str, InputSchemaFn]] | ||
| ) -> InputSchemaFn: |
There was a problem hiding this comment.
this type signature is wrong, right? It can return Any (e.g., starlette req)
| async def predict(self, inp): | ||
| """Performing inference directly without HTTP.""" |
There was a problem hiding this comment.
| async def predict(self, inp): | |
| """Performing inference directly without HTTP.""" | |
| async def predict(self, inp): | |
| """Perform inference directly without HTTP.""" |
| input_schema(str, InputSchemaFn, None): The FastAPI input conversion | ||
| function. By default, Serve will use the `NdArray` schema and convert to | ||
| numpy array. You can pass in any FastAPI dependency resolver that returns | ||
| an array. When you pass in a string, Serve will import it. | ||
| Please refer to Serve HTTP adatper documentation to learn more. |
There was a problem hiding this comment.
isn't this starlette by default?
| @@ -0,0 +1,76 @@ | |||
| import inspect | |||
There was a problem hiding this comment.
This file should be called drivers if we expect it to be imported by users to match ray.serve.http_adapters
jiaodong
left a comment
There was a problem hiding this comment.
http test on test_pipeline_dag.py looks good to me, feel free to proceed after addressing ed's comments.
This reverts commit 91a1c34.
|
The new |
…" (ray-project#23358)" This reverts commit e507aa5.
Why are these changes needed?
This PR implements the
DAGDriverclass that takes input schema conversation from http. This part is reusing functionality from model wrapper. So I also moved the shared functionality into a base classSimpleSchemaIngressto avoid duplication and also the component unit testable.Related issue number
Closes #23237
Checks
scripts/format.shto lint the changes in this PR.