forked from pytorch/serve
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add request envelope to support Multiserving frameworks (pytorch#749)
* - updated image classifier default handler - updated custom resnet and mnist handlers - update docs * documentation update - removed stale Transformer_readme.md * updated docs * Doc restructure and code fixes * Updated example as per fix in default handlers * Enhanced base and custom handler examples * Missing checking for manifest * Fixed some typos * Removed commented code * Refactor BaseHandler * Adding in unit tests * Fixed gitignore in this branch * Fix a bug with Image Segmenter * Updated Object Detector to reuse functionality; consistency * Fix pylint errors * Backwards compat for index_names.json * Fixed Image Segmenter again * Made the compat layer in text actually compat. * Removed batching from text classifier * Adding comments per review. * Fixing doc feedback. * Updating docs about batching. * Initial commit of envelopes. * Got the end-to-end working * Undoing a change for local stuff. * Fixing a few broken tests. * Fixed error introduced due to conflict resolution via web based merge tool * Corrected code comment * - Updated Object detection & text classification handlers - updated docs * fixed python linting errors * updated index to name json text classifier * fixed object detector handler for batch support * Fixed the batch inference output * update expected output as per new handler changes * updated text classification mar name in sanity suite * updated text classifier mar name and removed bert scripted models * updated model zoo with new text classification url * added model_name in while registering model in sanity suite * updated text classification model name * added upgrade option for installing python dependencies in install utils * added upgrade option for installing python dependencies and extra numpy package in regression suite * refectored pytests in regression suite for better performance and reporting * Merge upstream * Got the end-to-end working * Merge upstream (2) * Fixing a few broken tests. * Undoing a bad merge. * minor fix in torch-archiver command * reverted postprocess removal * updated mar files in model zoo to use updated handlers * updated regression suite to use updated mar files * suppressed pylint warning in UT * fixed resnet-152 mar name and expected output * updated inference tests data - added tolerence value for resent152 models * Added custom handler in vgg11 example (pytorch#559) * added custom handler for vgg11 * added readme for vgg11 example * fixed typo in readme * updated model zoo * reverted back changes for scripted vgg11 mar file * added vgg11 model to regression test suite * disabled pylint check in UT * updated expected response for vgg11 inference in regression suite * updated expected response for vgg11 inference in regression suite * updated expected for densenet scripted * Fixing bad file format * Fixed the 'no newman npm' issue in regression test suite, solution suggested in PR 757 * Fixed the metrics bug pytorch#772 for test_envelopes Co-authored-by: Shivam Shriwas <[email protected]> Co-authored-by: Harsh Bafna <[email protected]> Co-authored-by: dhaniram kshirsagar <[email protected]> Co-authored-by: dhaniram-kshirsagar <[email protected]> Co-authored-by: Henry Tappen <[email protected]> Co-authored-by: harshbafna <[email protected]> Co-authored-by: Aaqib <[email protected]> Co-authored-by: Henry Tappen <[email protected]> Co-authored-by: Geeta Chauhan <[email protected]>
- Loading branch information
1 parent
40f4258
commit abcaf1a
Showing
20 changed files
with
351 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ dist/ | |
*__pycache__* | ||
*.egg-info/ | ||
.idea | ||
*htmlcov* | ||
.coverage | ||
.github/actions/ | ||
.github/.DS_Store | ||
.DS_Store | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Introduction | ||
|
||
Many model serving systems provide a signature for request bodies. Examples include: | ||
|
||
- [Seldon](https://docs.seldon.io/projects/seldon-core/en/v1.1.0/graph/protocols.html) | ||
- [KFServing](https://github.com/kubeflow/kfserving/tree/master/docs) | ||
- [Google Cloud AI Platform](https://cloud.google.com/ai-platform/prediction/docs/online-predict) | ||
|
||
Data scientists use these multi-framework systems to manage deployments of many different models, possibly written in different languages and frameworks. The platforms offer additional analytics on top of model serving, including skew detection, explanations and A/B testing. These platforms need a well-structured signature in order to both standardize calls across different frameworks and to understand the input data. To simplify support for many frameworks, though, these platforms will simply pass the request body along to the underlying model server. | ||
|
||
Torchserve currently has no fixed request body signature. Envelopes allow you to automatically translate from the fixed signature required for your model orchestrator to a flat Python list. | ||
|
||
# Usage | ||
1. When you write a handler, always expect a plain Python list containing data ready to go into `preprocess`. Crucially, you should assume that your handler code looks the same locally or in your model orchestrator. | ||
1. When you deploy Torchserve behind a model orchestrator, make sure to set the corresponding `service_envelope` in your `config.properties` file. For example, if you're using Google Cloud AI Platform, which has a JSON format, you'd add `service_envelope=json` to your `config.properties` file. | ||
|
||
# Contributing | ||
Add new files under `ts/torch_handler/request_envelope`. Only include one class per file. The key used in `config.properties` will be the name of the .py file you write your class in. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,4 @@ | |
}, | ||
"tolerance":5 | ||
} | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.