Last active
April 15, 2022 18:35
-
-
Save nwstephens/f172910e35c4bf350de0a95b81cda001 to your computer and use it in GitHub Desktop.
This script is adapted from https://github.com/nwstephens/triton-xgboost. It demonstrates an error when using the perf_analyzer between two containers in a docker network. The workaround is to use `--network host` instead of `--network=tritonnet`. For more information on the implications using the host network, see: https://docs.docker.com/netwo…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Create docker network | |
| sudo docker network create tritonnet | |
| # Create shared volume for model_repository | |
| sudo docker volume create volume1 | |
| # Pull and run Triton container | |
| sudo docker pull nvcr.io/nvidia/tritonserver:22.03-py3 | |
| sudo docker run --gpus=all -d -p 8000:8000 -p 8001:8001 -p 8002:8002 --network=tritonnet \ | |
| -v /var/lib/docker/volumes/volume1/_data/model_repository:/models \ | |
| --name tritonserver nvcr.io/nvidia/tritonserver:22.03-py3 tritonserver --model-repository=/models | |
| # Pull and run PyTorch container | |
| sudo docker pull nvcr.io/nvidia/pytorch:22.03-py3 | |
| sudo docker run --gpus=all -t -d -p 8888:8888 --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 --network=tritonnet \ | |
| --mount source=volume1,destination=/workspace/volume1 --name pytorch nvcr.io/nvidia/pytorch:22.03-py3 | |
| # Performance analyzer throws an error from inside the PyTorch container | |
| sudo docker exec -it pytorch /bin/bash | |
| git clone https://github.com/nwstephens/triton-xgboost.git | |
| cp -R triton-xgboost/data/pre-built/ volume1/model_repository/. | |
| pip install tritonclient[all] | |
| apt update | |
| apt install libb64-0d | |
| perf_analyzer -m pre-built --percentile=95 #error: failed to get model metadata: HTTP client failed: Couldn't connect to server | |
| exit | |
| # Performance analyzer should be successful from the host machine | |
| perf_analyzer -m pre-built --percentile=95 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment