Improving startup time for AWS Lambda with Spacy Transformer models #12046
Replies: 2 comments
-
Hi @dandiep , One optimization may be to call |
Beta Was this translation helpful? Give feedback.
-
Reporting back with the findings of the last 2 days:
Ultimately, I couldn't find a way to do a cold start in less than 20-30 seconds. Perhaps if AWS releases something like SnapStart for Python in the future, it will work. Otherwise, I wouldn't waste your time with this. If anyone else has experiences with other services that provide a serverless way to serve Spacy with a reasonable start time, would love to hear it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am doing some work where I am using Spacy transformers for a bunch of different languages. Because they take up a lot of memory, I am trying to deploy them on Lambda so that I don't need to have a giant server with a ton of memory constantly.
The approach I adopted is to deploy all the models on Amazon EFS so I don't have a giant docket image or a new image for every language. Then when the Lambda starts it loads them from there.
The problem I am running into is that it takes a long time to load these models from a cold start. More than 30 seconds a lot of times.
This can be somewhat worked around by setting up provisioned concurrency. But not perfect since anticipating demand is hard.
Does anyone have any tips for ways to improve startup time? I am happy make patches too if there are ideas on where to look that could help.
Thanks
Dan
Beta Was this translation helpful? Give feedback.
All reactions