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" 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 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 not(eq(length(parameters.ModelGroups), 0)) }}: - script: 'mkdir $(Build.SourcesDirectory)/Artifact && cp -r $(Build.SourcesDirectory)/onnxruntime/python/tools/tensorrt/perf/result/ $(Build.SourcesDirectory)/Artifact' 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