The following tutorial provides steps needed to add an ONNX backend named new_backend to the Scoreboard.
Use the dockerfile template from examples to create Dockerfile for a new runtime.
- Set
ONNX_BACKENDvariable to the Python dotted path of the ONNX backend module which provides an implementation of theonnx.backend.base.Backendinterface class. - Write commands required to install all dependencies.
- If you use a release version of the backend, place your Dockerfile in
runtimes/{new-backend}/stable. - You an also track a development version of the backend. In this case store the file in
runtimes/{new-backend}/development.
############## ONNX Backend dependencies ###########
ENV ONNX_BACKEND="{new_backend.backend}"
# Install dependencies
RUN pip install onnx
RUN pip install {new_backend}
####################################################
- Add your backend to the
config.jsonfile. Use thestableordevelopmentsection as appropriate.
For stable version:
"new_backend": {
"name": "New Backend",
"results_dir": "./results/new_backend/stable",
"core_packages": ["new-backend"]
}For development version the core_packages list is optional:
"new_backend": {
"name": "New Backend",
"results_dir": "./results/new-backend/development",
}- Edit benchmark-backends.yml file.
- Copy and paste this job template to the end of file.
- Fill
new_backendwith the new backend unique name. - Change the
docker buildanddocker runcommands to match your backend. - Add your job name to
collect_and_deploy.needsand add a matchingdownload-artifactstep there.
jobs:
... # other jobs
new_backend:
runs-on: ubuntu-latest
timeout-minutes: 90
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Build docker image
run: docker build -t scoreboard/new_backend -f runtimes/new_backend/stable/Dockerfile .
- name: Run docker container
run: docker run --name new_backend --env-file setup/env.list -v ${{ github.workspace }}/results/new_backend/stable:/root/results scoreboard/new_backend || true
- name: Upload results
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
uses: actions/upload-artifact@v4
with:
name: results-new_backend-stable
path: results/new_backend/stable/