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
import os | |
import numpy | |
from torchvision import transforms | |
from PIL import Image | |
import tritonclient.grpc | |
# Prepare tritonclient object needed to send a request to the server. | |
infer_client = tritonclient.grpc.InferenceServerClient("localhost:8001") |
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
# Build a container from the downloaded Dockerfile | |
docker build -t graphcore_triton - < ./Dockerfile | |
# Start a configured container | |
gc-docker -- \ | |
--shm-size=1g \ | |
--ulimit memlock=-1 \ | |
-p 8000:8000 \ | |
-p 8001:8001 \ | |
-p 8002:8002 \ |
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
FROM ubuntu:20.04 | |
LABEL Graphcore Ltd | |
#Install the build dependencies | |
RUN apt-get update && \ | |
DEBIAN_FRONTEND=noninteractive apt install -y \ | |
git \ | |
python3 \ | |
python3-pip \ | |
python3-distutils \ |
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
{ | |
"input": "digit_image", | |
"softmax/Softmax:0": "output_labels" | |
} |
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
name: "mnist" | |
backend: "poplar" | |
max_batch_size: 1 | |
input [ | |
{ | |
name: "digit_image" | |
data_type: TYPE_FP32 | |
dims: [ 1, 28, 28 ] | |
} | |
] |