Creating custom python backend environment
See original GitHub issueAfter creating a the triton custom environment using the steps listed below we get:
triton_python_backend_stub: ../nptl/pthread_mutex_lock.c:81: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed.
Steps we took to create custom triton environment
- First we installed
conda
and created and environment called python-3-8 - We then installed numpy as required in the documentation along with our custom packages listed below:
apt-get update
apt-get -y install libgl1
apt-get install -yq libgtk2.0-dev
pip3 install torch==1.9.1+cpu torchvision==0.10.1+cpu torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html
pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.9/index.html
pip install opencv-python==4.5.2.52
We also set the PYTHONNOUSERSITE environment variables as requested:
export PYTHONNOUSERSITE=True
- We installed CMAKE and cuda-toolkit-11
install cmake and cuda
apt-get update
apt-get install -y apt-transport-https ca-certificates gnupg software-properties-common wget
wget -O -https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add -
apt-add-repository 'debhttps://apt.kitware.com/ubuntu/ bionic main'
apt-get update
apt-get install -y cmake
##install rapidjson and libarchive
apt-get install -y rapidjson-dev libarchive-dev
apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
bash -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/cuda.list'
apt update
apt install cuda-toolkit-11-0
-
We set the CUDA directory on our environment to the correct path:
cmake -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-11.0 ..
-
we make the directory and create the custom backend stub
git clone https://github.com/triton-inference-server/python_backend -b r21.09
cd r21.09
mkdir build && cd build
cmake -DTRITON_ENABLE_GPU=ON -DCMAKE_INSTALL_PREFIX:PATH=pwd/install ..
make triton-python-backend-stub
- We then uploaded the triton_backend_stub file to the model directory on our GCS bucket.
- after this we used conda-pack to pack out environment and then uploaded it to our detectron2 model directory on our GCS bucket
Triton Information Triton Version 21.09 Model: Detectron2
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Development Environment Setup - Backend Python 3 - YouTube
Development Environment Setup - Backend Python 3 ; Get the course here! - https://www.codebreakthrough.com/back... ; Course notes - https://calcur ...
Read more >How to Set up a Local Python Development Environment - Twilio
We share the fastest way to get started with web development (and Twilio) in Python with the Flask framework, pip package manager, and...
Read more >Packaging Python Projects
pyproject.toml tells “frontend” build tools like pip and build what “backend” tool to use to create distribution packages for your project.
Read more >GitHub - triton-inference-server/python_backend
Model Config File; Managing Python Runtime and Libraries. Building Custom Python Backend Stub; Creating Custom Execution Environments; Important Notes.
Read more >How to Set Up a Virtual Environment in Python – And Why It's ...
When developing software with Python, a basic approach is to install Python on your machine, install all your required libraries via the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Tabrizian This is the complete steps we took to create out environment
Closing due to in-activity. Feel free to re-open if the issue persists.