Skip to content
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

Add micro-batching support to ImageHandler #717

Merged
merged 2 commits into from
May 27, 2020
Merged

Conversation

bojiang
Copy link
Member

@bojiang bojiang commented May 26, 2020

Description

Motivation and Context

How Has This Been Tested?

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Documentation
  • Test, CI, or build
  • None

Components (if applicable)

  • BentoService (model packaging, dependency management, handler definition)
  • Model Artifact (model serialization, multi-framework support)
  • Model Server (mico-batching, logging, metrics, tracing, benchmark, OpenAPI)
  • YataiService (model management, deployment automation)
  • Documentation

Checklist:

  • My code follows the bentoml code style, both ./dev/format.sh and
    ./dev/lint.sh script have passed
    (instructions).
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • My change requires a change in bentoml/gallery example notebooks
  • I have sent a pull request to bentoml/gallery to make that change

@pep8speaks
Copy link

pep8speaks commented May 26, 2020

Hello @bojiang, Thanks for updating this PR.

There are currently no PEP 8 issues detected in this PR. Cheers! 🍻

Comment last updated at 2020-05-27 09:32:20 UTC

@bojiang bojiang force-pushed the handler branch 3 times, most recently from 6c86252 to 0732698 Compare May 27, 2020 07:08
@bojiang bojiang linked an issue May 27, 2020 that may be closed by this pull request
@bojiang bojiang force-pushed the handler branch 5 times, most recently from b6a5b65 to cde08cc Compare May 27, 2020 09:05
@bojiang
Copy link
Member Author

bojiang commented May 27, 2020

bentoml/gallery#32

@bojiang bojiang changed the title [WIP]ImageHandlers Add micro-batching support to ImageHandler May 27, 2020
@codecov-commenter
Copy link

codecov-commenter commented May 27, 2020

Codecov Report

Merging #717 into master will increase coverage by 0.57%.
The diff coverage is 90.76%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #717      +/-   ##
==========================================
+ Coverage   53.84%   54.41%   +0.57%     
==========================================
  Files         104      105       +1     
  Lines        8277     8385     +108     
==========================================
+ Hits         4457     4563     +106     
- Misses       3820     3822       +2     
Impacted Files Coverage Δ
bentoml/artifact/pytorch_model_artifact.py 45.45% <ø> (ø)
bentoml/handlers/image_handler.py 89.71% <89.13%> (-1.85%) ⬇️
bentoml/handlers/legacy_image_handler.py 91.56% <91.56%> (ø)
bentoml/handlers/__init__.py 100.00% <100.00%> (ø)
bentoml/configuration/__init__.py 77.46% <0.00%> (+1.40%) ⬆️
bentoml/_version.py 46.59% <0.00%> (+1.79%) ⬆️
bentoml/bundler/config.py 94.73% <0.00%> (+3.15%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9b0e45c...8538e6f. Read the comment docs.

return ['imageio']
return ["imageio"]

def _load_image_data(self, request: Request):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -19,6 +19,10 @@ ImageHandler
++++++++++++
.. autoclass:: bentoml.handlers.ImageHandler

LegacyImageHandler
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍



class LegacyImageHandler(BentoHandler):
"""Transform incoming image data from http request, cli or lambda event into numpy
Copy link
Member

@parano parano May 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add a deprecation note here?

This LegacyImageHandler is identical to the ImageHandler prior to BentoML version 0.8.0, it was
kept here to make it easier for users to upgrade. If you are starting a new model serving project,
use the ImageHandler instead. LegacyImageHandler will be deprecated in release 1.0.0.

@parano
Copy link
Member

parano commented May 27, 2020

LGTM and merging now!

There's one minor comment, feel free to address in future PRs since you are actively working on this code path.

@parano parano merged commit 42b6d55 into bentoml:master May 27, 2020
@parano parano added the LGTM label May 27, 2020
aarnphm pushed a commit to aarnphm/BentoML that referenced this pull request Jul 29, 2022
* [Batching] implement batching for image_handler

* Clean code & tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Model Server] Add micro-batching support in ImageHandler
4 participants