Skip to content

Instantly share code, notes, and snippets.

Last active October 29, 2021 00:48
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mwakaba2/5054d8c67fad1cf62e53e4eff55d5c7c to your computer and use it in GitHub Desktop.
Dockerfile for benchmarking Bert Base Uncased Model in GCP (multiple threads execution + openmp disabled for onnxruntime)
# Install TF entreprise
WORKDIR /workspace
# onnxruntime version >= 1.8 replaced OMP with thread pool:
RUN pip install --no-cache-dir --upgrade pip && \
pip install --upgrade torch==1.8.1+cpu -f && \
pip install coloredlogs sympy onnx tf2onnx onnxruntime==1.8.1 transformers==4.6.0 py-cpuinfo py3nvml
# Service account credentials are required to store benchmark results in a GCS bucket.
# Requirements before building this image.
# 1. Create a gcs bucket named gs://bert-inference-results
# 2. Create a service account and grant it access to the GCS bucket.
RUN gcloud auth activate-service-account --key-file=/workspace/<SERVICE_ACCOUNT_KEY_FILE>.json
COPY ./ /workspace/
COPY ./bert-base-uncased /workspace/bert-base-uncased
# Zip the onnxruntime customized benchmark scripts from
# Add the zipped file to workspace
ADD onnxruntime_benchmark.tar.gz /workspace
CMD [ "./" ]
Copy link
Author can be found here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment