Skip to content

Example showing how to run TorchServe's backend code only #2605

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 8 commits into from
Sep 21, 2023

Conversation

agunapal
Copy link
Collaborator

Description

Example showing how to run TorchServe's backend code only

  • This can be used with a debugger to find any issues in your handler code.

Fixes #(issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Feature/Issue validation/testing

python debugging_backend/test_handler.py --batch_size 2
Torch TensorRT not enabled
DEBUG:ts.torch_handler.base_handler:Model file /home/ubuntu/serve/examples/image_classifier/resnet_18/resnet-18.pt loaded successfully
INFO:__main__:Result is [{'tabby': 0.4096629023551941, 'tiger_cat': 0.34670525789260864, 'Egyptian_cat': 0.13002872467041016, 'lynx': 0.02391958236694336, 'bucket': 0.011532173492014408}, {'tabby': 0.4096629023551941, 'tiger_cat': 0.34670525789260864, 'Egyptian_cat': 0.13002872467041016, 'lynx': 0.02391958236694336, 'bucket': 0.011532173492014408}]

Checklist:

  • Did you have fun?
  • Have you added tests that prove your fix is effective or that this feature works?
  • Has code been commented, particularly in hard-to-understand areas?
  • Have you made corresponding changes to the documentation?

@agunapal agunapal requested review from msaroufim and mreso September 21, 2023 00:08
@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

Merging #2605 (d6998fb) into master (d0ae857) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head d6998fb differs from pull request most recent head 267e49d. Consider uploading reports for the commit 267e49d to get more accurate results

@@            Coverage Diff             @@
##           master    #2605      +/-   ##
==========================================
+ Coverage   70.36%   70.38%   +0.01%     
==========================================
  Files          84       84              
  Lines        3871     3873       +2     
  Branches       58       58              
==========================================
+ Hits         2724     2726       +2     
  Misses       1143     1143              
  Partials        4        4              
Files Changed Coverage Δ
...orch_handler/unit_tests/test_utils/mock_context.py 88.00% <100.00%> (+1.04%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@mreso mreso left a comment

Choose a reason for hiding this comment

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

Would love if we could convert this into a unit test example for handler (see comments). Otherwise LGTM

@agunapal agunapal enabled auto-merge September 21, 2023 19:46
@agunapal agunapal added this pull request to the merge queue Sep 21, 2023
Merged via the queue into master with commit ab69b69 Sep 21, 2023
@agunapal agunapal deleted the examples/run_ts_handler branch September 21, 2023 20:37
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants