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

Large model inference #2215

Merged
merged 82 commits into from
Apr 20, 2023
Merged

Large model inference #2215

merged 82 commits into from
Apr 20, 2023

Conversation

HamidShojanazeri
Copy link
Collaborator

@HamidShojanazeri HamidShojanazeri commented Apr 2, 2023

Description

Adding PiPPy large model inference with HF example

Note waiting for PiPPY binaries later this week(04/10) to update the dev requirements.

Also this PR moves all our large model related examples, deepspeed, accelerate under example/ large_model folder

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)
  • [X ] New feature (non-breaking change which adds functionality)
  • [X ] This change requires a documentation update

Feature/Issue validation/testing

Please describe the Unit or Integration tests that you ran to verify your changes and relevant result summary. Provide instructions so it can be reproduced.
Please also list any relevant details for your test configuration.

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?

@codecov
Copy link

codecov bot commented Apr 2, 2023

Codecov Report

Merging #2215 (c9245b1) into master (044bbc1) will decrease coverage by 1.17%.
The diff coverage is 0.00%.

❗ Current head c9245b1 differs from pull request most recent head 6efa20c. Consider uploading reports for the commit 6efa20c to get more accurate results

@@            Coverage Diff             @@
##           master    #2215      +/-   ##
==========================================
- Coverage   71.47%   70.31%   -1.17%     
==========================================
  Files          73       75       +2     
  Lines        3341     3392      +51     
  Branches       57       57              
==========================================
- Hits         2388     2385       -3     
- Misses        950     1004      +54     
  Partials        3        3              
Impacted Files Coverage Δ
ts/handler_utils/distributed/pt_pippy.py 0.00% <0.00%> (ø)
ts/torch_handler/distributed/base_pippy_handler.py 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

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

@HamidShojanazeri HamidShojanazeri changed the title [WIP} Large model inference [WIP] Large model inference Apr 3, 2023
Copy link
Collaborator

@lxning lxning left a comment

Choose a reason for hiding this comment

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

I added comments for Huggingface_pippy. They can apply to the Hugingfac_accelerate and Deepspeed_mii

ts/torch_handler/distributed/base_pippy_handler.py Outdated Show resolved Hide resolved
ts/torch_handler/distributed/base_pippy_handler.py Outdated Show resolved Hide resolved
ts/handler_utils/distributed/pt_pippy.py Outdated Show resolved Hide resolved
ts/handler_utils/distributed/pt_pippy.py Outdated Show resolved Hide resolved
ts/handler_utils/distributed/pt_pippy.py Outdated Show resolved Hide resolved
examples/large_models/Huggingface_pippy/Readme.md Outdated Show resolved Hide resolved
examples/large_models/Huggingface_pippy/Readme.md Outdated Show resolved Hide resolved
examples/large_models/Huggingface_pippy/setup_config.json Outdated Show resolved Hide resolved
examples/large_models/Huggingface_pippy/requirements.txt Outdated Show resolved Hide resolved
examples/large_models/Huggingface_pippy/config.properties Outdated Show resolved Hide resolved
docs/large_model_inference.md Outdated Show resolved Hide resolved

This document explain how Torchserve supports large model serving, here large model refers to the models that are not able to fit into one gpu so they need be splitted in multiple partitions over multiple gpus.

## PiPPY (PyTorch Native solution for large model inference)
Copy link
Collaborator

Choose a reason for hiding this comment

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

could move this readme under dir Huggingface_pippy since this doc is about pippy?

Can we add common instruction/steps in this doc?


### Step 0: Install torchserve from src
```bash
python ts_scripts/install_from_src.py
Copy link
Collaborator

Choose a reason for hiding this comment

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

yes

examples/large_models/Huggingface_pippy/Readme.md Outdated Show resolved Hide resolved
test/pytest/test_distributed_inference_handler.py Outdated Show resolved Hide resolved
test/pytest/test_distributed_inference_handler.py Outdated Show resolved Hide resolved
@msaroufim
Copy link
Member

LGTM, please just make sure lint jobs are green and we can merge

@HamidShojanazeri
Copy link
Collaborator Author

Thanks @msaroufim , sure will address the failing spell checks and lints

@lxning lxning merged commit d23d2ab into master Apr 20, 2023
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.

3 participants