aws / aws/amazon-sagemaker-examples
Model loading at every inference
- Dominant language
- Jupyter Notebook
- Stars
- 11k
- Forks
- 7k
- Avg merge
- 8h 29m
- Merged PRs (30d)
- 8
Description
Hi,
I deployed an MXNet gluon model by creating a custom docker container.
While making inferences, model is getting loaded at almost every inference which is making cpu to utilize more memory for every inference.
With that I am getting “CPU out of memory” error while making 2 or more inferences at a time.
My question is: model should be loaded at the time of deploying and the loaded model will be used for inferences. But here why it’s loading at every inference?
I am following the “scikit bring your own container “ example. https://github.com/awslabs/amazon-sagemaker-examples/tree/master/advanced_functionality/scikit_bring_your_own
Can anyone please suggest why this happens and how to resolve this cpu memory issue.
I tried with both ml.m4.4xlarge and ml.c4.4xlarge instances. Model weights file size is 537MB. And input image size is 1920 x 1472.
Thanks in Advance,
Harathi
Contributor guide
Assessment
This issue has not been assessed yet.