/orion-benchmark

Model benchmarking using Orion

Primary LanguageJupyter Notebook

Orion Model Benchmarking

In this repository you can find a set of benchmarkings with different model architectures from the ONNX Hub Models repository.

Results

Development

  1. Clone ONNX Hub Models repository:
git clone https://github.com/onnx/models.git
  1. Install Git LFS
brew install git-lfs
  1. Setup Git LFS
git lfs install
  1. Fetch models:
git lfs fetch
  1. Checkout models:
git lfs checkout

Setup

  1. Install dependencies:
poetry install
poetry run pip install keyring
poetry run pip install keyrings.google-artifactregistry-auth
  1. Get smartonnx repository configuration:
gcloud artifacts print-settings python --project=giza-platform \
    --repository=smartonnx \
    --location=europe-west1
  1. Install smartonnx:
pip install --index-url https://europe-west1-python.pkg.dev/giza-platform/smartonnx/simple/ smartonnx

Usage

  1. Get ONNX operator usage by frequency:
python orion_benchmark/operator_analytics.py
  1. Get ONNX operator usage by frequency for quantized models:
python orion_benchmark/quant_operator_analytics.py
  1. Get model percentage of compatibility with Orion Operators:
python orion_benchmark/operator_coverage.py >> orion_benchmark/operator_coverage.md
  1. Get model percentage of compatibility with Quant Orion Operators:
python orion_benchmark/quant_operator_coverage.py >> orion_benchmark/quant_operator_coverage.md
  1. Get transpilation time of supported ONNX Hub models with Orion:
python orion_benchmark/transpile_models.py