Comments (3)
@zoran-hristov Did you find any resolution to the same issue? I am also facing the same problem.
Even after setting TS_DEFAULT_WORKERS_PER_MODEL=2 in config.properties it is not getting reflected in cloudwatchlogs.
In cloudwatch logs, it is clearly showing Number of CPUs: 1. I used the same example as in the repo.
from sagemaker-pytorch-inference-toolkit.
Yes, I found the solution. One part is noted in subsequent Deep Learning containers release notes, but there is no fix in the images(see Known issues). it is related with with OMP_NUM_THREADS parameter. I suggest to assign value to it numberOfCPUs/2 or less. It is regulate environment variables like OMP_NUM_THREADS.
The other part is to make the enable the container support for cpu detection, especially for the JVM.
So, we re-build the image with fix to override.
We are setting this in the code, as the config.properties is not used in the image. I have no explanation why they abandoned the use of config.properties
Here is a way to do it, with overwriting in Dockerfile:
FROM 763104351884.dkr.ecr.eu-west-1.amazonaws.com/pytorch-inference:1.7.1-cpu-py36-ubuntu18.04
# In case standard path is not used, patch with next lines
RUN echo "vmargs=-XX:-UseContainerSupport" >> /opt/conda/lib/python3.6/site-packages/sagemaker_inference/etc/default-mms.properties
RUN echo "vmargs=-XX:-UseContainerSupport" >> /opt/conda/lib/python3.6/site-packages/sagemaker_pytorch_serving_container/etc/default-ts.properties
RUN echo "vmargs=-XX:-UseContainerSupport" >> /opt/conda/lib/python3.6/site-packages/sagemaker_pytorch_serving_container/etc/mme-ts.properties
from sagemaker-pytorch-inference-toolkit.
Thanks @zoran-hristov it helped me to resolve the issue.
from sagemaker-pytorch-inference-toolkit.
Related Issues (20)
- Serving a model using custom container, instance run of disk HOT 4
- Need for a minimum reproducible example in readme.md
- No model logs from PyTorch 1.10 SageMaker endpoint HOT 2
- Launch TorchServe without repackaging model contents HOT 5
- Batch Inference does not work when using the default handler
- add environment variable "OMP_NUM_THREADS"
- Document how to locally run the container HOT 2
- using cuda enabled pytorch image
- how to use gpu in sagemaker instance HOT 1
- Is this Dockerfile compatible with sagemaker elastic inference
- MMS mode in inference does not support in GPU instance
- [Question] Using model.mar with built-in handler script
- Specify batch size for MME
- Prepend `code_dir` to `sys.path` rather than `append`
- Incorrect reporting of memory utilisation
- Documentation for inference.py `transform_fn`
- Reuse the requirements.txt installation logic from sagemaker-inference-toolkit
- ModuleNotFoundError: Sagemaker only copies entry_point file to /opt/ml/code/ instead of the holy-cloned source code
- Improve debuggability during model load and inference failures
- Zombie process exception HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sagemaker-pytorch-inference-toolkit.