Skip to content

Conversation

@hariharans29
Copy link
Member

@hariharans29 hariharans29 commented Jan 4, 2022

Description:

This is the CUDA EP equivalent of the PR #7808 (All the design choices have already been discussed there).

This change makes the OrtCUDAProviderOptions struct opaque and supports setting options that can be converted to a string. Just like the TensorRT PR, an API to set options that can't be strings (user_compute_stream and default_memory_arena_cfg) is not yet supported and will be added incrementally. Since these are not very commonly used, it is okay to leave them unsupported for now. For users who still need them, they can still use the legacy struct and its corresponding ORT APIs.

Motivation and Context

  1. Enables basic configuration of the CUDA EP via C# (Resolves C# adding option for cudnn_conv_algo_search : DEFAULT #9730 and How to apply "gpu_mem_limit" to CUDA Execution Provider in C#? #8995)

  2. Introduces a new C API CUDA EP configuration - cudnn_conv_use_max_workspace. This was already available via Python but not available for C API users. This configuration is particularly important for fp16 Conv heavy models. See Resnet - converted Onnx model is 2.9X slower than pyTorch model in V100 gpu #9162 and [Doc] Performance tuning of convolution heavy models with the CUDA EP #9916 for details as to why. By this reasoning, this PR should resolve this perf complaint - Why Float16 model takes twice as long as Float under GPU #9420.

  3. Addresses a backlog item to make the OrtCUDAProviderOptions opaque

@hariharans29 hariharans29 changed the title Enable CUDA provider option configuration for C# WIP: Enable CUDA provider option configuration for C# Jan 4, 2022
@hariharans29 hariharans29 changed the title WIP: Enable CUDA provider option configuration for C# Enable CUDA provider option configuration for C# Jan 5, 2022
Copy link
Contributor

@pranavsharma pranavsharma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

pranavsharma
pranavsharma previously approved these changes Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

C# adding option for cudnn_conv_algo_search : DEFAULT

6 participants