onnxruntime/tools/ci_build/github/azure-pipelines
Julius Tischbein 1391354265
Adding CUDNN Frontend and use for CUDA NN Convolution (#19470)
### Description
Added CUDNN Frontend and used it for NHWC convolutions, and optionally
fuse activation.

#### Backward compatible 
- For model existed with FusedConv, model can still run. 
- If ORT is built with cuDNN 8, cuDNN frontend will not be built into
binary. Old kernels (using cudnn backend APIs) are used.

#### Major Changes
- For cuDNN 9, we will enable cudnn frontend to fuse convolution and
bias when a provider option `fuse_conv_bias=1`.
- Remove the fusion of FusedConv from graph transformer for CUDA
provider, so there will not be FusedConv be added to graph for CUDA EP
in the future.
- Update cmake files regarding to cudnn settings. The search order of
CUDNN installation in build are like the following:
  * environment variable `CUDNN_PATH`
* `onnxruntime_CUDNN_HOME` cmake extra defines. If a build starts from
build.py/build.sh, user can pass it through `--cudnn_home` parameter, or
by environment variable `CUDNN_HOME` if `--cudnn_home` not used.
* cudnn python package installation directory like
python3.xx/site-packages/nvidia/cudnn
  * CUDA installation path

#### Potential Issues

- If ORT is built with cuDNN 8, FusedConv fusion is no longer done
automatically, so some model might have performance regression. If user
still wants FusedConv operator for performance reason, they can still
have multiple ways to walkaround: like use older version of onnxruntime;
or use older version of ORT to save optimized onnx, then run with latest
version of ORT. We believe that majority users have moved to cudnn 9
when 1.20 release (since the default in ORT and PyTorch is cudnn 9 for 3
months when 1.20 release), so the impact is small.
- cuDNN graph uses TF32 by default, and user cannot disable TF32 through
the use_tf32 cuda provider option. If user encounters accuracy issue
(like in testing), user has to set environment variable
`NVIDIA_TF32_OVERRIDE=0` to disable TF32. Need update the document of
use_tf32 later.

#### Follow ups
This is one of PRs that target to enable NHWC convolution in CUDA EP by
default if device supports it. There are other changes will follow up to
make it possible.
(1) Enable `prefer_nhwc` by default for device with sm >= 70. 
(2) Change `fuse_conv_bias=1` by default after more testing.
(3) Add other NHWC operators (like Resize or UpSample).

### Motivation and Context

The new CUDNN Frontend library provides the functionality to fuse
operations and provides new heuristics for kernel selection. Here it
fuses the convolution with the pointwise bias operation. On the [NVIDIA
ResNet50](https://pytorch.org/hub/nvidia_deeplearningexamples_resnet50/)
we get a performance boost from 49.1144 ms to 42.4643 ms per inference
on a 2560x1440 input (`onnxruntime_perf_test -e cuda -I -q -r 100-d 1 -i
'prefer_nhwc|1' resnet50.onnx`).

---------

Co-authored-by: Tianlei Wu <tlwu@microsoft.com>
Co-authored-by: Maximilian Mueller <maximilianm@nvidia.com>
2024-08-02 15:16:42 -07:00
..
nodejs/templates Adding Job names to jobs without a name (#20961) 2024-06-06 19:09:21 -07:00
nuget/templates [TensorRT EP] support TensorRT 10.2-GA (#21395) 2024-07-18 12:11:52 -07:00
stages Set CUDA12 as default in GPU packages (#21438) 2024-07-25 10:17:16 -07:00
templates Adding CUDNN Frontend and use for CUDA NN Convolution (#19470) 2024-08-02 15:16:42 -07:00
triggers
android-arm64-v8a-QNN-crosscompile-ci-pipeline.yml Update QNN pipeline pool (#21482) 2024-07-29 10:00:21 -07:00
android-x86_64-crosscompile-ci-pipeline.yml Fix Android CI Pipeline code coverage failure (#21504) 2024-07-26 07:36:23 +10:00
bigmodels-ci-pipeline.yml [TensorRT EP] support TensorRT 10.2-GA (#21395) 2024-07-18 12:11:52 -07:00
binary-size-checks-pipeline.yml
build-perf-test-binaries-pipeline.yml
c-api-noopenmp-packaging-pipelines.yml Split ondevice training cpu packaging pipeline to a separated pipeline (#21485) 2024-07-25 10:58:34 -07:00
c-api-training-packaging-pipelines.yml Move on-device training packages publish step (#21539) 2024-07-29 09:59:46 -07:00
clean-build-docker-image-cache-pipeline.yml
cuda-packaging-pipeline.yml [TensorRT EP] support TensorRT 10.2-GA (#21395) 2024-07-18 12:11:52 -07:00
linux-ci-pipeline.yml Update training packaging pipeline's docker files (#20853) 2024-05-30 23:48:42 -07:00
linux-cpu-aten-pipeline.yml Update Aten pipeline's docker file to use UBI8 (#20856) 2024-05-30 07:38:15 -07:00
linux-cpu-eager-pipeline.yml Update Aten pipeline's docker file to use UBI8 (#20856) 2024-05-30 07:38:15 -07:00
linux-cpu-minimal-build-ci-pipeline.yml Update training packaging pipeline's docker files (#20853) 2024-05-30 23:48:42 -07:00
linux-dnnl-ci-pipeline.yml Update training packaging pipeline's docker files (#20853) 2024-05-30 23:48:42 -07:00
linux-gpu-ci-pipeline.yml Set CUDA12 as default in GPU packages (#21438) 2024-07-25 10:17:16 -07:00
linux-gpu-tensorrt-ci-pipeline.yml Set CUDA12 as default in GPU packages (#21438) 2024-07-25 10:17:16 -07:00
linux-gpu-tensorrt-daily-perf-pipeline.yml Set CUDA12 as default in GPU packages (#21438) 2024-07-25 10:17:16 -07:00
linux-migraphx-ci-pipeline.yml change ci docker image to rocm6.1 (#21296) 2024-07-18 14:50:01 +08:00
linux-openvino-ci-pipeline.yml Update OpenVino CI Ubuntu to 22.04 (#21127) 2024-07-09 09:56:44 -07:00
linux-qnn-ci-pipeline.yml [QNN EP] Update to QNN SDK 2.24.0 (#21463) 2024-07-24 10:17:12 -07:00
mac-ci-pipeline.yml Delete pyop (#21094) 2024-06-19 16:21:33 -07:00
mac-coreml-ci-pipeline.yml Switch a portion of CI/packaging jobs to MacOS12 (#19908) 2024-03-19 14:54:58 -07:00
mac-ios-ci-pipeline.yml Upgrade min ios version to 13.0 (#20773) 2024-06-04 10:15:20 -07:00
mac-ios-packaging-pipeline.yml Upgrade min ios version to 13.0 (#20773) 2024-06-04 10:15:20 -07:00
mac-react-native-ci-pipeline.yml Address React Native pipeline component detection timeout (#20871) 2024-05-30 16:37:03 -07:00
npm-packaging-pipeline.yml Increase NPM ComponentDetection.Timeout: 1200 (#20681) 2024-05-15 13:41:59 -07:00
nuget-cuda-publishing-pipeline.yml Set CUDA12 as default in GPU packages (#21438) 2024-07-25 10:17:16 -07:00
orttraining-linux-ci-pipeline.yml Remove manylinux build scripts from python packaging pipeline (#20786) 2024-05-24 08:18:22 -07:00
orttraining-linux-gpu-ci-pipeline.yml
orttraining-linux-gpu-ortmodule-distributed-test-ci-pipeline.yml custom allreduce cuda kernel (#20703) 2024-06-13 11:09:49 -07:00
orttraining-linux-nightly-ortmodule-test-pipeline.yml
orttraining-mac-ci-pipeline.yml
orttraining-pai-ci-pipeline.yml Replace inline pip install with pip install from requirements*.txt (#21106) 2024-07-22 12:39:10 -07:00
orttraining-py-packaging-pipeline-cpu.yml disables qnn in ort training cpu pipeline (#21510) 2024-07-26 17:23:35 +08:00
orttraining-py-packaging-pipeline-cuda.yml Update training packaging pipeline's docker files (#20853) 2024-05-30 23:48:42 -07:00
orttraining-py-packaging-pipeline-cuda12.yml Update training packaging pipeline's docker files (#20853) 2024-05-30 23:48:42 -07:00
orttraining-py-packaging-pipeline-rocm.yml [ROCm] Update ck to use ck_tile (#21030) 2024-06-19 14:06:10 +08:00
post-merge-jobs.yml [TensorRT EP] support TensorRT 10.2-GA (#21395) 2024-07-18 12:11:52 -07:00
publish-nuget.yml Move on-device training packages publish step (#21539) 2024-07-29 09:59:46 -07:00
py-cuda-package-test-pipeline.yml
py-cuda-packaging-pipeline.yml Remove manylinux build scripts from python packaging pipeline (#20786) 2024-05-24 08:18:22 -07:00
py-cuda-publishing-pipeline.yml Set CUDA12 as default in GPU packages (#21438) 2024-07-25 10:17:16 -07:00
py-package-build-pipeline.yml OpenVINO EP Rel 1.18 Changes (#20337) 2024-04-19 00:31:38 -07:00
py-package-test-pipeline.yml [TensorRT EP] support TensorRT 10.2-GA (#21395) 2024-07-18 12:11:52 -07:00
py-packaging-pipeline.yml [QNN EP] Update to QNN SDK 2.24.0 (#21463) 2024-07-24 10:17:12 -07:00
qnn-ep-nuget-packaging-pipeline.yml [QNN EP] Update to QNN SDK 2.24.0 (#21463) 2024-07-24 10:17:12 -07:00
rocm-nuget-packaging-pipeline.yml Make ROCm packaging stages to a single workflow (#21235) 2024-07-04 11:07:04 +08:00
web-ci-pipeline.yml Fix typos according to reviewdog report. (#21335) 2024-07-22 13:37:32 -07:00
win-ci-fuzz-testing.yml Uppdate nuget to Use Nuget 6.10.x (#21209) 2024-06-28 19:49:54 -07:00
win-ci-pipeline.yml add vitisai ep build stage to Windows CPU Pipeline (#21361) 2024-07-15 19:34:08 -07:00
win-gpu-cuda-ci-pipeline.yml Separating all GPU stages into different Pipelines (#21521) 2024-07-26 14:54:45 -07:00
win-gpu-dml-ci-pipeline.yml Separating all GPU stages into different Pipelines (#21521) 2024-07-26 14:54:45 -07:00
win-gpu-doc-gen-ci-pipeline.yml Separating all GPU stages into different Pipelines (#21521) 2024-07-26 14:54:45 -07:00
win-gpu-reduce-op-ci-pipeline.yml Move jobs in onnxruntime-Win2022-GPU-T4 machine pool to onnxruntime-Win2022-GPU-A10 (#21023) 2024-06-12 22:04:40 -07:00
win-gpu-tensorrt-ci-pipeline.yml Set CUDA12 as default in GPU packages (#21438) 2024-07-25 10:17:16 -07:00
win-gpu-training-ci-pipeline.yml Separating all GPU stages into different Pipelines (#21521) 2024-07-26 14:54:45 -07:00
win-qnn-arm64-ci-pipeline.yml [QNN EP] Update to QNN SDK 2.24.0 (#21463) 2024-07-24 10:17:12 -07:00
win-qnn-ci-pipeline.yml [QNN EP] Update to QNN SDK 2.24.0 (#21463) 2024-07-24 10:17:12 -07:00