-
Notifications
You must be signed in to change notification settings - Fork 637
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dorckerfile and implement TFLite and Torchscript as model-backends (
#64) * add tf and torch backeneds * add torch backend * add tqdm to requirements * avoid installation of compilers when NO_COMPILER_INSTALLATION is set * fix error with onnx installation * fix error with onnx installation * fix error with onnx installation * fix error with onnx installation * Added Dockerfile & bugfix (#63) * add dockerfile * fix tvm configs issue in the tvm installer * fix tvm issue * fix tvm * fix dockerfile & created build script for the docker images * removed redundant spaces Co-authored-by: Valerio Sofi <[email protected]> * add tflite to tf api * fix logging * fix error with half precision in torch * fix minor bugs * fix bugs * fix import * fix bug with tf * fix error with DeviceArrays in polygraphy * fix another bug * upgrade version Co-authored-by: morgoth95 <[email protected]> Co-authored-by: Valerio Sofi <[email protected]>
- Loading branch information
1 parent
362cfb1
commit 06fc486
Showing
32 changed files
with
1,019 additions
and
159 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,3 +128,6 @@ dmypy.json | |
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# MacOS DS_Store | ||
.DS_Store |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
ARG STARTING_IMAGE=nvidia/cuda:11.2.0-runtime-ubuntu20.04 | ||
FROM ${STARTING_IMAGE} | ||
|
||
# Set frontend as non-interactive | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update | ||
|
||
# Install python and pip | ||
RUN apt-get install -y python3-opencv python3-pip && \ | ||
python3 -m pip install --upgrade pip && \ | ||
apt-get -y install git | ||
|
||
# Install nebullvm | ||
ARG NEBULLVM_VERSION=latest | ||
RUN if [ "$NEBULLVM_VERSION" = "latest" ] ; then \ | ||
# pip install nebullvm ; \ | ||
git clone https://github.com/nebuly-ai/nebullvm.git ; \ | ||
cd nebullvm ; \ | ||
pip install . ;\ | ||
else \ | ||
pip install nebullvm==${NEBULLVM_VERSION} ; \ | ||
fi | ||
|
||
# Install required python modules | ||
RUN pip install scipy==1.5.4 && \ | ||
pip install cmake | ||
|
||
# Install default deep learning compilers | ||
ARG COMPILER=all | ||
ENV NO_COMPILER_INSTALLATION=1 | ||
RUN if [ "$COMPILER" = "all" ] ; then \ | ||
python3 -c "import os; os.environ['NO_COMPILER_INSTALLATION'] = '0'; import nebullvm" ; \ | ||
elif [ "$COMPILER" = "tensorrt" ] ; then \ | ||
python3 -c "from nebullvm.installers.installers import install_tensor_rt; install_tensor_rt()" ; \ | ||
elif [ "$COMPILER" = "openvino" ] ; then \ | ||
python3 -c "from nebullvm.installers.installers import install_openvino; install_openvino()" ; \ | ||
elif [ "$COMPILER" = "onnxruntime" ] ; then \ | ||
python3 -c "from nebullvm.installers.installers import install_onnxruntime; install_onnxruntime()" ; \ | ||
fi | ||
|
||
# Install TVM | ||
RUN if [ "$COMPILER" = "all" ] || [ "$COMPILER" = "tvm" ] ; then \ | ||
python3 -c "from nebullvm.installers.installers import install_tvm; install_tvm()" ; \ | ||
python3 -c "from tvm.runtime import Module" ; \ | ||
fi |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Create image with all compilers installed | ||
docker build -t nebullvm-all . | ||
|
||
# Create an image for each compiler installed | ||
docker build -t nebullvm-onnxruntime . --build-arg COMPILER="onnxruntime" | ||
docker build -t nebullvm-openvino . --build-arg COMPILER="openvino" | ||
docker build -t nebullvm-tvm . --build-arg COMPILER="tvm" | ||
docker build -t nebullvm-tensorrt . --build-arg COMPILER="tensorrt" |
This file contains 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
This file contains 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
Oops, something went wrong.