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

What to do about large models that won't fit into a layer? #9

Open
rbunn80110 opened this issue Oct 17, 2020 · 2 comments
Open

What to do about large models that won't fit into a layer? #9

rbunn80110 opened this issue Oct 17, 2020 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@rbunn80110
Copy link

Is it possible to use an S3 bucket when the model won't fit directly into a lambda layer? Resnet18 is quite small and not typical of DL models these days.

@szymonmaszke
Copy link
Owner

Yes, S3 is possible but you would have to build your own torchlambda Docker image (see torchlambda build command documentation, specifically --aws-components "s3" should be passed during building).

Also you would have to modify example C++ template source code to use Aws::S3::S3Client. C++ template can be created using torchlambda template which generates human readable C++ code for further extensions. Example of using Aws::S3::S3Client can be seen here, admittedly this code can be a lot of trouble.

Currently there is no .yml option to do so and I am open for pull requests, especially addition of this part would be great. If you are up for it I will guide you and help if needed. Also remember you might be blocked by VRAM memory provided by Lambda instances which is 3GB IIRC.

Another option would be to split your model into 4 parts, each of around 50Mb and call each on the output of the previous. This would also require custom C++ code, I would be more than happy with such PR as well (and this approach should be easier to code). This would allow users to use multiple Lambda layers for single model which would up the maximum model size to around ~200Mb.

@szymonmaszke szymonmaszke added enhancement New feature or request help wanted Extra attention is needed labels Oct 18, 2020
@szymonmaszke szymonmaszke pinned this issue Oct 18, 2020
@rbunn80110
Copy link
Author

Awesome! Let me look into what you have mentioned and see what I can do. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants