Skip to content

Final round cherry-picks to 1.9.0#9133

Merged
wangyems merged 10 commits intorel-1.9.0from
wangye/cp3
Sep 21, 2021
Merged

Final round cherry-picks to 1.9.0#9133
wangyems merged 10 commits intorel-1.9.0from
wangye/cp3

Conversation

@wangyems
Copy link
Copy Markdown
Contributor

@wangyems wangyems commented Sep 21, 2021

Description: Describe your changes.
image

Motivation and Context

  • Why is this change required? What problem does it solve?
  • If it fixes an open issue, please link to the issue here.

austinpagan and others added 6 commits September 21, 2021 04:03
* Globally enable ms-experimental ops

* change meaning of ms_experimental to mean *all* ms_experimental ops. Some experimental ops will still be enabled globally without this flag like audio ops.

* add cmath

* add cmath to signal_defs.cc

* move audio back into experimental, verify on mac

* remove experimental from mac builds

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
* fix default initialization value in C API header

* Fix conflicts

* Nits
@wangyems wangyems requested a review from a team as a code owner September 21, 2021 04:24
wangyems and others added 2 commits September 21, 2021 04:44
…1 wheels (#9101)

* make work for both rocm 4.2 and rocm 4.3.1

* fix rocm 4.3.1 docker image reference

* fix CUDA_VERSION to ROCM_VERSION

* fix ReduceConsts conflict def

* add ifdef to miopen_common.h as well

* trailing ws
faxu
faxu previously approved these changes Sep 21, 2021
snnn
snnn previously approved these changes Sep 21, 2021
@wangyems wangyems dismissed stale reviews from snnn and faxu via b1020a2 September 21, 2021 05:53
nullptr}; // TODO: Support arena configuration for users of test runner
OrtCUDAProviderOptions cuda_options;
cuda_options.device_id=device_id;
cuda_options.do_copy_in_default_stream=true;
Copy link
Copy Markdown
Member

@hariharans29 hariharans29 Sep 21, 2021

Choose a reason for hiding this comment

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

nit: Do we need this line now that it is set to this value by default ? (Same comment for all similar lines in the remaining files)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I just saw #9064. Have you ever seen the same code generates different behavior in C and C++? Super rarely. Because it is very confusing. We shouldn't add the struct in onnxruntime_c_api.h at first. Then because we fear of making breaking changes, we replicate the error and make it worse and worse. And at the same time, we didn't provide backward compatibility either.

Copy link
Copy Markdown
Member

@hariharans29 hariharans29 Sep 21, 2021

Choose a reason for hiding this comment

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

Agreed. I think it is better to cherry pick Ryan’s change as well..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I just saw #9064. Have you ever seen the same code generates different behavior in C and C++? Super rarely. Because it is very confusing. We shouldn't add the struct in onnxruntime_c_api.h at first. Then because we fear of making breaking changes, we replicate the error and make it worse and worse. And at the same time, we didn't provide backward compatibility either.

What's the suggest change in this case?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

OrtCUDAProviderOptions is a C struct. It shouldn't have constructors. When needed, we should either add an init function for it, like InitOrtCUDAProviderOptions, or add a c++ wrapper in onnxruntime_cxx_api.h. The c++ wrapper class should have a different name, like Ort::CUDAProviderOptions. Or we do both. Adding a C API is needed, otherwise C# can't use it.

Copy link
Copy Markdown
Contributor

@pranavsharma pranavsharma Sep 21, 2021

Choose a reason for hiding this comment

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

OrtCUDAProviderOptions is broken currently. It shouldn't have been defined in the C header file to begin with. But we're stuck with it. And yes C# cannot use it. Tensorrt has the same issue. But for tensorrt we introduced a V2 where the struct is not defined in the header; you request an instance from the API. Hence my suggestion is that in the next release we should introduce a similar v2 and deprecate its usage like we do for tensorrt. The addition of _cpluscplus is just a convenience measure, not a solution.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Our code should demonstrate good usage of onnxruntime C/C++ API. If someone saw this code and copies it to his C source file, then it crashed. He might not know why the same code works here but not there. For example, let's the author in #9136 were using the new API: OrtCUDAProviderOptions. If you just look the code, you won't know if OrtCUDAProviderOptions will be initialized or not unless the author tells you if he saved the code in a file ends with .c or .cpp.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@snnn are you suggesting that we keep the old way of initializing OrtCUDAProviderOptions in this file? If yes, let's do it and move ahead. Obviously this won't fix the issue of this struct taking on different values in .c and .cc files. Fixing it requires removing the cpluscplus macro introduced in #9064.

Copy link
Copy Markdown
Contributor

@pranavsharma pranavsharma Sep 21, 2021

Choose a reason for hiding this comment

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

Let's fix this the right way in the next release where we'll deprecate this struct altogether.

@wangyems wangyems requested a review from faxu September 21, 2021 19:17
@wangyems wangyems merged commit 66b3c31 into rel-1.9.0 Sep 21, 2021
@wangyems wangyems deleted the wangye/cp3 branch September 21, 2021 19:18
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.

8 participants