Add TensorRT basic unit tests#12
Merged
Merged
Conversation
Port tests from onnxruntime/test/providers/tensorrt/tensorrt_basic_test.cc to work with the plugin EP library registration approach. Tests include: - FunctionTest: basic Add+Add model inference - RemoveCycleTest: boolean logic ops graph partitioning - TestSessionOutputs: model output count verification - DDSOutputTest: data-dependent shape output - MnistModelTest: real model load and inference - EngineCacheTest: engine caching verification - MultiThreadInference: concurrent inference stability - SequentialRuns: repeated inference stability - DynamicInputShapes: varying input dimensions - EPContext source attribution tests (foreign/no source) Also adds testdata models from onnxruntime repo and CMake post-build copy rule to make testdata available to tests. Custom op tests excluded (will be in separate branch). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Use unique dim_param names per dynamic dimension to avoid TRT constraint conflicts when dims share the same symbolic name. - Add explicit profile shapes (min/max/opt) for dynamic shape test. - Disable DDSOutputTest: TRT EP doesn't support output allocator for data-dependent shape outputs yet. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Enable ORTTensorRTEp_BUILD_TESTS=ON in build-trtep job - Copy trt_ep_tests binary to artifact upload directory - Add 'Run CUDA graph tests' step in run-tests job - Copy onnxruntime runtime library for test execution - Include CUDA graph test XML results in artifact upload - Apply changes to both Windows and Linux workflows Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
# Conflicts: # CMakeLists.txt
- Rename 'Run CUDA graph tests' step to 'Run unit tests' since the binary now includes both CUDA graph and TensorRT basic tests. - Copy testdata directory alongside test binary in build artifacts. - Set TESTDATA_DIR env var so tests can find model files. - Update artifact upload to use new XML result filename. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
|
When the TRT execution context is recreated (due to engine rebuild from shape changes), the DDS output allocator map retained entries from the old context. On subsequent runs, the code saw known_DDS=true and skipped calling setOutputAllocator on the new context, causing enqueueV3 to fail with 'Neither address or allocator is set for output tensor'. Fix: clear dds_output_allocator_map when context_update recreates the execution context, so allocators are re-registered on the new context. Also re-enables DDSOutputTest which now passes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add unit tests adapted from onnxruntime/test/providers/tensorrt/tensorrt_basic_test.cc to the plugin EP repo, using the C++ gtest infrastructure. Also includes a bug fix for DDS (data-dependent shape) output support.
Tests Added (11 tests, all passing)
Bug Fix: DDS Output Allocator
When the TRT execution context is recreated (due to engine rebuild from shape changes), the \dds_output_allocator_map\ retained entries from the old context. On subsequent runs, the code saw \known_DDS=true\ and skipped calling \setOutputAllocator()\ on the new context, causing \�nqueueV3\ to fail with "Neither address or allocator is set for output tensor".
Fix: Clear \dds_output_allocator_map\ when \context_update\ recreates the execution context, so allocators are re-registered on the new context.
Other Changes
Notes