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

Reduce dependency install time and decrease docker image size #2364

Merged
merged 5 commits into from
May 26, 2023

Conversation

mreso
Copy link
Collaborator

@mreso mreso commented May 25, 2023

Description

This PR changes the order of the installation of torchserve dependencies from "requirements.txt -> torch" into "torch -> requirements.txt". This speeds up the installation of the dependencies and reduces the docker CPU image size from 4.98GB to 2GB and GPU from 11.1GB to 8.4GB.

Fixes #2358

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

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.

  • images size before:
    CPU:
    Screenshot 2023-05-24 at 9 06 24 PM
    GPU:
    Screenshot 2023-05-24 at 9 34 20 PM
    images size after:
    CPU:
    Screenshot 2023-05-24 at 9 21 37 PM
    GPU:
    Screenshot 2023-05-24 at 9 28 49 PM

  • docker run --rm -it -p 8080:8080 -p 8081:8081 -p 8082:8082 -p 7070:7070 -p 7071:7071 2db5237a38ea
    Screenshot 2023-05-24 at 9 45 48 PM

Screenshot 2023-05-24 at 9 46 01 PM

Checklist:

  • Did you have fun?
  • Have you added tests that prove your fix is effective or that this feature works?

@mreso mreso requested review from msaroufim and agunapal May 25, 2023 04:49
@codecov
Copy link

codecov bot commented May 25, 2023

Codecov Report

Merging #2364 (86a8f05) into master (4f85477) will decrease coverage by 0.11%.
The diff coverage is n/a.

❗ Current head 86a8f05 differs from pull request most recent head d248555. Consider uploading reports for the commit d248555 to get more accurate results

@@            Coverage Diff             @@
##           master    #2364      +/-   ##
==========================================
- Coverage   70.69%   70.58%   -0.11%     
==========================================
  Files          78       78              
  Lines        3638     3638              
  Branches       57       57              
==========================================
- Hits         2572     2568       -4     
- Misses       1063     1067       +4     
  Partials        3        3              

see 2 files with indirect coverage changes

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

@msaroufim
Copy link
Member

Well actually in this case we're not guaranteed to have the torch version that shows up in our requirements as the one that gets installed

@mreso
Copy link
Collaborator Author

mreso commented May 25, 2023

True. For this we need to freeze all version numbers of our dependencies which we should do in any case.

@mreso
Copy link
Collaborator Author

mreso commented May 25, 2023

@agunapal This fixes the nightly docker build: https://github.com/pytorch/serve/actions/runs/5085378605
Screenshot 2023-05-25 at 4 23 37 PM

@mreso mreso merged commit ffa6847 into master May 26, 2023
9 checks passed
@mreso mreso deleted the fix/reorder_dependency_install branch May 26, 2023 00:15
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.

Captum installation breaks torchserve dependency installation
3 participants