Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TensorRT EP] Update TRT10.0 deprecated api #20989

Merged
merged 14 commits into from
Jul 2, 2024
Merged

[TensorRT EP] Update TRT10.0 deprecated api #20989

merged 14 commits into from
Jul 2, 2024

Conversation

yf711
Copy link
Contributor

@yf711 yf711 commented Jun 10, 2024

Description

Note:

  • This PR would remove C4996 suppression in tensorrt_execution_provider.cc only (according to Nvidia, places with nvinfer.h included need C4996 suppression, when /Zc:__cplusplus is enabled in ORT win build)
  • A follow-up PR will be raised to update deprecated TRT Plugin api usage.

Here are deprecated apis to be updated in this PR:

deprecated api Update
kCUBLAS /
kCUBLAS_LT /
kCUDNN /
reallocateOutput Superseded by reallocateOutputAsync with cudaStream_t argument
createExecutionContextWithoutDeviceMemory Superseded by createExecutionContext() with parameter.
Check ExecutionContextAllocationStrategy::kUSER_MANAGED for more detail

Motivation and Context

TRT deprecated api list: https://docs.nvidia.com/deeplearning/tensorrt/api/c_api/deprecated.html

@yf711 yf711 requested a review from chilo-ms June 10, 2024 23:17
@tianleiwu
Copy link
Contributor

Please remove lines with 4996 from the following files.

  • onnxruntime/core/providers/tensorrt/nv_includes.h
  • onnxruntime/test/unittest_main/test_main.cc

@yf711
Copy link
Contributor Author

yf711 commented Jun 12, 2024

Please remove lines with 4996 from the following files.

  • onnxruntime/core/providers/tensorrt/nv_includes.h
  • onnxruntime/test/unittest_main/test_main.cc

Thanks for the context. These 4996 usage have been reverted

chilo-ms
chilo-ms previously approved these changes Jun 13, 2024
@jywu-msft
Copy link
Member

there are build errors?

D:\a_work_temp\TensorRT-10.0.1.6.Windows10.x86_64.cuda-11.8\include\NvInferRuntimeBase.h#L593
D:\a_work_temp\TensorRT-10.0.1.6.Windows10.x86_64.cuda-11.8\include\NvInferRuntimeBase.h(593,16): Error C4996: 'nvinfer1::v_1_0::IGpuAllocator::allocate': was declared deprecated

@yf711 yf711 changed the title [TensorRT EP] Update TRT10 deprecated api [TensorRT EP] Update TRT10.0 deprecated api Jun 17, 2024
@yf711
Copy link
Contributor Author

yf711 commented Jun 17, 2024

Including nvinfer.h would cause C4996 errors during Windows ORT build, when /Zc:__cplusplus is enabled:
nvinfer1::v_1_0::IGpuAllocator::allocate
nvinfer1::v_1_0::IGpuAllocator::deallocate
nvinfer1::IPluginV2
nvinfer1::IPluginV2Ext
It seems that there are indirect usage of these api by TRT internally. I'm adding C4996 suppression back temporarily and checking with Nvidia for better solution on that.

@jywu-msft
Copy link
Member

jywu-msft commented Jun 21, 2024

was the rellocateOutput->reallocateOutputAsync change tested on Faster-RCNN with oss parser?

@yf711
Copy link
Contributor Author

yf711 commented Jun 28, 2024

was the rellocateOutput->reallocateOutputAsync change tested on Faster-RCNN with oss parser?

That has been tested with no issue

@yf711 yf711 merged commit 7be1d4a into main Jul 2, 2024
96 of 100 checks passed
@yf711 yf711 deleted the yifanl/trt_api branch July 2, 2024 05:55
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.

None yet

4 participants