onnxruntime/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-ci-perf-pipeline.yml
Chi Lo 31f291f0af
Add TRT EP memory leak test into trt perf script (#8155)
* Add memory check for TRT perf

* Revise test app

* Add memory check for TRT perf

* Revise test app

* add test cases

* Modify script and add pipeline YAML

* remove redundant code

* temporarily change

* Change YAML

* revise test app

* fix minor bug

* code refactor

* small fix

* temporarily change for test

* prepare result log

* rm container when it exits

* code refactor
2021-07-13 09:39:08 -07:00

99 lines
4.4 KiB
YAML

parameters:
- name: BuildORT
displayName: Build ORT
type: boolean
default: true
- name: PostToDashboard
displayName: Post to Dashboard
type: boolean
default: true
- name: RunDocker
displayName: Run in Docker (CUDA 11.0)
type: boolean
default: false
- name: ConfigureEPs
displayName: Configure EPs (set epList variable - separate by spaces)
type: boolean
default: false
- name: ModelGroups
type: object
default:
- "onnx-zoo-models"
- "many-models"
- "partner-models"
- name: MemTest
displayName: Run memory test
type: boolean
default: true
jobs:
- job: Linux_CI_GPU_TENSORRT_PERF
pool: Linux-GPU-TensorRT-Perf
variables:
- name: environment
${{ if eq(parameters.RunDocker, true) }}:
value: docker.sh -d ort-$(branch) -p $(Build.SourcesDirectory)/onnxruntime/python/tools/tensorrt/perf
${{ if ne(parameters.RunDocker, true) }}:
value: machine.sh
- name: with_arguments
value: $(environment) -e "$(epList)"
- name: run_conda
value: eval "$(command conda 'shell.bash' 'hook' 2> /dev/null)" && conda activate perf3.8
- name: mem_test_docker_image
value: "trt-ep-mem-test"
timeoutInMinutes: 3000
steps:
- ${{ if eq(parameters.BuildORT, true) }}:
- ${{ if eq(parameters.RunDocker, true) }}:
- script: '$(Build.SourcesDirectory)/onnxruntime/python/tools/tensorrt/perf/build/build_image.sh -p $(Build.SourcesDirectory)/onnxruntime/python/tools/tensorrt/perf/build/Dockerfile.tensorrt-perf -b $(branch) -i ort-$(branch)'
displayName: 'Build latest ORT Images'
workingDirectory: '$(Build.SourcesDirectory)/onnxruntime/python/tools/tensorrt/perf/build'
- ${{ if eq(parameters.RunDocker, false) }}:
- script: '$(run_conda) && python3 $(Build.SourcesDirectory)/onnxruntime/python/tools/tensorrt/perf/build/ort_build_latest.py -b $(branch) -c /usr/local/cuda -o ~/repos/onnxruntime/ -t ~/TensorRT-7.2.2.3'
displayName: 'Build latest ORT'
workingDirectory: '$(Build.SourcesDirectory)/onnxruntime/python/tools/tensorrt/perf/build'
- ${{ each option in parameters.ModelGroups }}:
- script: '$(run_conda) && $(Build.SourcesDirectory)/onnxruntime/python/tools/tensorrt/perf/run_perf_$(with_arguments) -o ${{option}} -m $(${{option}})'
displayName: '${{option}} perf'
workingDirectory: '$(Build.SourcesDirectory)/onnxruntime/python/tools/tensorrt/perf/'
env:
LD_LIBRARY_PATH : "/home/hcsuser/TensorRT-7.2.2.3/lib"
- ${{ if eq(parameters.MemTest, true) }}:
- script: '$(run_conda) && $(Build.SourcesDirectory)/onnxruntime/python/tools/tensorrt/perf/mem_test/run_mem_test_docker.sh -d $(mem_test_docker_image) -p $(Build.SourcesDirectory)/onnxruntime/python/tools/tensorrt/perf/mem_test/'
displayName: 'Run memory test'
workingDirectory: '$(Build.SourcesDirectory)/onnxruntime/python/tools/tensorrt/perf/mem_test/'
- ${{ if not(eq(length(parameters.ModelGroups), 0)) }}:
- script: 'mkdir $(Build.SourcesDirectory)/Artifact && cp -r $(Build.SourcesDirectory)/onnxruntime/python/tools/tensorrt/perf/result/ $(Build.SourcesDirectory)/Artifact && cp -r $(Build.SourcesDirectory)/onnxruntime/python/tools/tensorrt/perf/mem_test/result $(Build.SourcesDirectory)/Artifact/result_mem_test'
displayName: 'Prepare Artifacts'
workingDirectory: '$(Build.SourcesDirectory)/onnxruntime/python/tools/tensorrt/perf/'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.SourcesDirectory)/Artifact'
artifactName: 'result'
- ${{ if eq(parameters.PostToDashboard, true) }}:
- script: '$(run_conda) && python3 $(Build.SourcesDirectory)/onnxruntime/python/tools/tensorrt/perf/post.py -r $(Build.SourcesDirectory)/onnxruntime/python/tools/tensorrt/perf/result -c $(Build.SourceVersion) -u "https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=$(Build.BuildId)" '
displayName: 'Post to Dashboard'
workingDirectory: '$(Build.SourcesDirectory)/onnxruntime/python/tools/tensorrt/perf/'
env:
DASHBOARD_MYSQL_ORT_PASSWORD: $(dashboard-mysql-ort-password)
- script: sudo rm -rf $(Agent.BuildDirectory)
displayName: Clean build files (POSIX)
condition: not(eq(variables['Agent.OS'], 'Windows_NT')) # and always()
continueOnError: true # continuing on error for this step, since linux build folder is somehow getting permission issue