Skip to content

Commit

Permalink
Update EP Perf Pipeline (#10149)
Browse files Browse the repository at this point in the history
* migrate to 1ES Hosted Pool

* migrate to Kusto database

* refactor and organize ep names with ORT prefix

* standardize TRT benchmarking with save/load engine, input binding, and workspace

* Add TRT 8.2 to ep perf pipeline

* update model_list.json with full onnx zoo

* add anubis credentials

* add anubis credentials

* clarify trt variables

* get system info from docker image

* remove unwanted commenting
  • Loading branch information
oliviajain committed Jan 12, 2022
1 parent cb9b027 commit 4048ed3
Show file tree
Hide file tree
Showing 13 changed files with 643 additions and 239 deletions.
20 changes: 11 additions & 9 deletions dockerfiles/Dockerfile.tensorrt
Expand Up @@ -5,8 +5,9 @@
# Dockerfile to run ONNXRuntime with TensorRT integration

# nVidia TensorRT Base Image
ARG TRT_VERSION=21.07
FROM nvcr.io/nvidia/tensorrt:${TRT_VERSION}-py3
ARG TRT_CONTAINER_VERSION=21.12
ARG TRT_VERSION=8.2.1.8
FROM nvcr.io/nvidia/tensorrt:${TRT_CONTAINER_VERSION}-py3

ARG ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
ARG ONNXRUNTIME_BRANCH=master
Expand All @@ -21,11 +22,12 @@ ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:/code/cmake-3.21.0-linux-x86_

# Prepare onnxruntime repository & build onnxruntime with TensorRT
RUN git clone --single-branch --branch ${ONNXRUNTIME_BRANCH} --recursive ${ONNXRUNTIME_REPO} onnxruntime &&\
/bin/sh onnxruntime/dockerfiles/scripts/install_common_deps.sh &&\
cp onnxruntime/docs/Privacy.md /code/Privacy.md &&\
cp onnxruntime/dockerfiles/LICENSE-IMAGE.txt /code/LICENSE-IMAGE.txt &&\
cp onnxruntime/ThirdPartyNotices.txt /code/ThirdPartyNotices.txt &&\
cd onnxruntime &&\
/bin/sh ./build.sh --parallel --skip_submodule_sync --cuda_home /usr/local/cuda --cudnn_home /usr/lib/x86_64-linux-gnu/ --use_tensorrt --tensorrt_home /workspace/tensorrt --config Release --build_wheel --update --build --cmake_extra_defines ONNXRUNTIME_VERSION=$(cat ./VERSION_NUMBER) '"CMAKE_CUDA_ARCHITECTURES='${CMAKE_CUDA_ARCHITECTURES}'"' &&\
/bin/sh onnxruntime/dockerfiles/scripts/install_common_deps.sh

# Checkout appropriate TRT_VERSION and build
RUN cd onnxruntime &&\
trt_version=${TRT_VERSION%.*.*} &&\
./onnxruntime/python/tools/tensorrt/perf/build/checkout_trt.sh ${trt_version} &&\
/bin/sh build.sh --parallel --build_shared_lib --skip_submodule_sync --cuda_home /usr/local/cuda --cudnn_home /usr/lib/x86_64-linux-gnu/ --use_tensorrt --tensorrt_home /usr/lib/x86_64-linux-gnu/ --config Release --build_wheel --skip_tests --skip_submodule_sync --cmake_extra_defines '"CMAKE_CUDA_ARCHITECTURES='${CMAKE_CUDA_ARCHITECTURES}'"' &&\
pip install /code/onnxruntime/build/Linux/Release/dist/*.whl &&\
cd ..
cd ..
18 changes: 15 additions & 3 deletions onnxruntime/python/tools/tensorrt/perf/anubis/start_job.ps1
@@ -1,11 +1,23 @@
param([string]$file_folder, [string]$account_key, [string]$trt_container)
param([string]$file_folder, [string]$account_key, [string]$trt_container, [string]$csc)

Add-Type -AssemblyName System.Web
$wheel_file = [System.IO.Path]::GetFileName((Get-ChildItem $file_folder))
$ort_trt_ep_pkg_blob_path = 'ort-trt-ep/' + $env:BUILD_BUILDNUMBER + '/' + $wheel_file
$expiredays = New-TimeSpan -Days 1
$end = (Get-Date) + $expiredays

$body = @{grant_type='client_credentials'
client_id='bcb87687-5d9d-4c21-801e-317980c8b1d5'
client_secret=$csc
scope='api://2227e307-9325-4dbe-9894-5c3b25d62a2d/.default'}
$contentType = 'application/x-www-form-urlencoded'
$res = Invoke-WebRequest -Method POST -Uri https://login.microsoftonline.com/cc38825a-ff99-423f-bdde-dd14d00e33b8/oauth2/v2.0/token -body $body -ContentType $contentType | ConvertFrom-Json

Write-Host "Before send"
$token = $res.access_token

$headers = @{Authorization = "Bearer $token"}

$ort_trt_ep_pkg_sas_uri = az storage blob generate-sas -c upload -n $ort_trt_ep_pkg_blob_path --account-name anubiscustomerstorage --account-key $account_key --full-uri --permissions r --expiry $end.ToString("yyyy-MM-ddTHH:mmZ") --https-only

$ort_trt_ep_pkg_sas_uri = $ort_trt_ep_pkg_sas_uri.Substring(1, $ort_trt_ep_pkg_sas_uri.Length-2)
Expand All @@ -22,5 +34,5 @@ $anubissvctesturl = "https://anubistest.azurewebsites.net/api/mlperf/jobs"

Write-Host ($body_trt_perf_compare|ConvertTo-Json)

Invoke-RestMethod -Method 'Post' -Uri $anubissvctesturl -Body ($body_trt_perf_compare|ConvertTo-Json) -ContentType "application/json"
$body.Parameters
Invoke-RestMethod -Method 'Post' -Uri $anubissvctesturl -Body ($body_trt_perf_compare|ConvertTo-Json) -ContentType "application/json" -Headers $headers -UseBasicParsing
$body.Parameters

0 comments on commit 4048ed3

Please sign in to comment.