Skip to content

Instantly share code, notes, and snippets.

View kamil-andrzejewski's full-sized avatar

Kamil Andrzejewski kamil-andrzejewski

View GitHub Profile
@kamil-andrzejewski
kamil-andrzejewski / client.py
Created October 13, 2022 13:07
Poplar Triton Backend blog post - client script content
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")
@kamil-andrzejewski
kamil-andrzejewski / container
Last active October 13, 2022 13:05
Poplar Triton Backend blog post - commands to create Triton Server ready container
# 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 \
@kamil-andrzejewski
kamil-andrzejewski / Dockerfile
Created October 13, 2022 12:57
Poplar Triton Backend blog post - Dockerfile
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 \
@kamil-andrzejewski
kamil-andrzejewski / name_map.json
Created October 13, 2022 12:53
Poplar Triton Backend blog post - input/output names remapping
{
"input": "digit_image",
"softmax/Softmax:0": "output_labels"
}
@kamil-andrzejewski
kamil-andrzejewski / config.pbtxt
Created October 13, 2022 12:48
Poplar Triton Backend blog post - configuration file
name: "mnist"
backend: "poplar"
max_batch_size: 1
input [
{
name: "digit_image"
data_type: TYPE_FP32
dims: [ 1, 28, 28 ]
}
]