Comments (2)
Currently, in our docker container, we create a virtual environment and install torchserve inside it as follows:
Lines 54 to 58 in 33d87e3
The feature to use virtual environment to install custom model dependencies creates a separate virtual environment and attempts to start the model worker and load the model in the new virtual environment. This fails at the following point:
2024-02-12T21:54:23,630 [INFO ] epollEventLoopGroup-3-1 org.pytorch.serve.wlm.ModelManager - Model mnist_custom_dependencies loaded.
2024-02-12T21:54:23,631 [DEBUG] epollEventLoopGroup-3-1 org.pytorch.serve.wlm.ModelManager - updateModel: mnist_custom_dependencies, count: 1
2024-02-12T21:54:23,638 [DEBUG] W-9000-mnist_custom_dependencies_1.0 org.pytorch.serve.wlm.WorkerLifeCycle - Worker cmdline: [/home/model-server/tmp/models/0f78acce5ed84427a9e427e3ea7d9394/venv/bin/python, /home/venv/lib/python3.9/site-packages/ts/model_service_worker.py, --sock-type, unix, --sock-name, /home/model-server/tmp/.ts.sock.9000, --metrics-config, /home/venv/lib/python3.9/site-packages/ts/configs/metrics.yaml]
2024-02-12T21:54:23,690 [WARN ] W-9000-mnist_custom_dependencies_1.0-stderr MODEL_LOG - Traceback (most recent call last):
2024-02-12T21:54:23,691 [WARN ] W-9000-mnist_custom_dependencies_1.0-stderr MODEL_LOG - File "/home/venv/lib/python3.9/site-packages/ts/model_service_worker.py", line 15, in <module>
2024-02-12T21:54:23,692 [WARN ] W-9000-mnist_custom_dependencies_1.0-stderr MODEL_LOG - from ts.arg_parser import ArgParser
2024-02-12T21:54:23,693 [WARN ] W-9000-mnist_custom_dependencies_1.0-stderr MODEL_LOG - ModuleNotFoundError: No module named 'ts'
Root cause of the issue is that venv created during the container build contains torchserve
installed to its site-packages. The new venv that is created to load the model inherits the system site packages but not site-packages of the existing venv in which torchserve is installed, hence from ts.arg_parser import ArgParser
fails.
Potential options to fix this:
- Document that the
useVenv
option is not supported whentorchserve
is installed and already started from a virtual environment and disable theuseVenv
related tests for Docker. - Find a way to inherit site-packages from one venv in another.
from serve.
Currently, in our docker container, we create a virtual environment and install torchserve inside it as follows:
Lines 54 to 58 in 33d87e3
The feature to use virtual environment to install custom model dependencies creates a separate virtual environment and attempts to start the model worker and load the model in the new virtual environment. This fails at the following point:
2024-02-12T21:54:23,630 [INFO ] epollEventLoopGroup-3-1 org.pytorch.serve.wlm.ModelManager - Model mnist_custom_dependencies loaded. 2024-02-12T21:54:23,631 [DEBUG] epollEventLoopGroup-3-1 org.pytorch.serve.wlm.ModelManager - updateModel: mnist_custom_dependencies, count: 1 2024-02-12T21:54:23,638 [DEBUG] W-9000-mnist_custom_dependencies_1.0 org.pytorch.serve.wlm.WorkerLifeCycle - Worker cmdline: [/home/model-server/tmp/models/0f78acce5ed84427a9e427e3ea7d9394/venv/bin/python, /home/venv/lib/python3.9/site-packages/ts/model_service_worker.py, --sock-type, unix, --sock-name, /home/model-server/tmp/.ts.sock.9000, --metrics-config, /home/venv/lib/python3.9/site-packages/ts/configs/metrics.yaml] 2024-02-12T21:54:23,690 [WARN ] W-9000-mnist_custom_dependencies_1.0-stderr MODEL_LOG - Traceback (most recent call last): 2024-02-12T21:54:23,691 [WARN ] W-9000-mnist_custom_dependencies_1.0-stderr MODEL_LOG - File "/home/venv/lib/python3.9/site-packages/ts/model_service_worker.py", line 15, in <module> 2024-02-12T21:54:23,692 [WARN ] W-9000-mnist_custom_dependencies_1.0-stderr MODEL_LOG - from ts.arg_parser import ArgParser 2024-02-12T21:54:23,693 [WARN ] W-9000-mnist_custom_dependencies_1.0-stderr MODEL_LOG - ModuleNotFoundError: No module named 'ts'
Root cause of the issue is that venv created during the container build contains
torchserve
installed to its site-packages. The new venv that is created to load the model inherits the system site packages but not site-packages of the existing venv in which torchserve is installed, hencefrom ts.arg_parser import ArgParser
fails.Potential options to fix this:
- Document that the
useVenv
option is not supported whentorchserve
is installed and already started from a virtual environment and disable theuseVenv
related tests for Docker.- Find a way to inherit site-packages from one venv in another.
How this is different compared to creating a venv, installing TorchServe standalone and then using useVenv
from serve.
Related Issues (20)
- Update documentation on deprecating mac x86 support
- It seems like `metrics.yaml` doesn't apply HOT 1
- Config to disable gpu system metrics collection HOT 1
- torch.compile benchmark nightlies failing because of dependency of simpy
- '503 Service Unavailable' for url 'http://0.0.0.0:8085/v1/models/mnist:predict' HOT 2
- Update token authentication doc with maven link for downloading prebuilt plugin HOT 1
- KServe nightly tests are failing
- Incomplete example about emitting metrics HOT 3
- Broken example for a custom Counter metrics HOT 3
- Metrics REST API doesn't return custom metric HOT 3
- Model results are inconsistent between preheating and after preheating HOT 1
- Model with name <name> is not ready. HOT 22
- Improve configuration handling with KServe
- Broken Link to the debug-torchserve-backend page HOT 1
- Setup custom metric with Kubernetes dimensions HOT 1
- Configuration of gRPC MAX_CONNECTION_AGE and MAX_CONNECTION_AGE_GRACE HOT 1
- Clean up metrics documentation
- How to 'Create model archive pod and run model archive file generation script' in the โUser Guideโ HOT 3
- [RFC]: Deprecation notice for TorchServe macOS x86 builds, binaries & testing
- very high QueueTime
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 serve.