Skip to content

Fix TensorRT RTX EP name to match catalog JSON#624

Open
yeelam-gordon wants to merge 1 commit intomainfrom
fix/61791041-tensorrt-ep-name-mismatch
Open

Fix TensorRT RTX EP name to match catalog JSON#624
yeelam-gordon wants to merge 1 commit intomainfrom
fix/61791041-tensorrt-ep-name-mismatch

Conversation

@yeelam-gordon
Copy link
Copy Markdown
Contributor

Summary

The model catalog (\SqueezeNetModelCatalog.json) uses \NvTensorRTRTXExecutionProvider\ as the execution provider name for the \squeezenet-fp32\ model entry, but \PerformanceConfigurator.GetEpOptions()\ only matched the ORT runtime name \TensorRtRtxExecutionProvider.

This meant that when the catalog-supplied EP name was passed to the configurator, no performance options were applied.

Changes

  • Added \NVTENSORRTRTXEXECUTIONPROVIDER\ as an alternative match in the C# \PerformanceConfigurator\ switch expression
  • Added XML doc and inline comments explaining that EP name strings come from two sources:
    1. ORT runtime — \OrtEpDevice.EpName\ from \ExecutionProviderCatalog.FindAllProviders()\
    2. Model catalog JSON — \�xecutionProviders[].name\ in files like \Resources/SqueezeNetModelCatalog.json\

Validation

  • ✅ \CSharpConsoleDesktop\ builds cleanly
  • ✅ App launches and parses --ep_name NvTensorRTRTXExecutionProvider\ correctly
  • ❌ Cannot runtime-test the TensorRT RTX code path without NVIDIA GPU hardware

Fixes AB#61791041

The catalog uses NvTensorRTRTXExecutionProvider but the switch only
matched TensorRtRtxExecutionProvider. Added the Nv-prefixed form.
Fixes ADO #61791041

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a mismatch between the execution provider (EP) name used in the model catalog JSON and the EP name matched by the C# performance options lookup, ensuring TensorRT RTX performance options are applied when the catalog-supplied name is used.

Changes:

  • Adds NVTENSORRTRTXEXECUTIONPROVIDER as an alias for the TensorRT RTX EP in PerformanceConfigurator.GetEpOptions().
  • Adds XML doc and inline comments explaining that EP name strings may come from different sources (runtime vs model catalog).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +14 to +23
/// The string literals below come from two sources that may use different names
/// for the same provider:
/// 1. ORT runtime — OrtEpDevice.EpName returned by ExecutionProviderCatalog.FindAllProviders()
/// 2. Model catalog JSON — the "executionProviders[].name" field in files like
/// Resources/SqueezeNetModelCatalog.json
///
/// When a provider appears under different names in these two sources, both forms
/// must be listed here so the lookup succeeds regardless of which name is passed in.
/// If a new EP is added to the ORT runtime or the catalog introduces an alias,
/// a corresponding entry should be added below.
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

The XML doc comment misidentifies where the ORT EP name comes from. ExecutionProviderCatalog.FindAllProviders() returns ExecutionProvider objects whose name is provider.Name (WinRT catalog), whereas the ORT runtime EP name used by SessionOptions/OrtEpDevice comes from ORT enumeration (e.g., OrtEnv.GetEpDevices()OrtEpDevice.EpName). As written, the comment suggests OrtEpDevice.EpName is returned by FindAllProviders(), which is misleading—please update the doc to clearly distinguish WinRT catalog provider names vs ORT runtime EP names and point to the correct APIs for each source.

Suggested change
/// The string literals below come from two sources that may use different names
/// for the same provider:
/// 1. ORT runtime — OrtEpDevice.EpName returned by ExecutionProviderCatalog.FindAllProviders()
/// 2. Model catalog JSON — the "executionProviders[].name" field in files like
/// Resources/SqueezeNetModelCatalog.json
///
/// When a provider appears under different names in these two sources, both forms
/// must be listed here so the lookup succeeds regardless of which name is passed in.
/// If a new EP is added to the ORT runtime or the catalog introduces an alias,
/// a corresponding entry should be added below.
/// The string literals below may come from different sources that use different names
/// for the same provider:
/// 1. WinRT execution provider catalog names — returned by
/// ExecutionProviderCatalog.FindAllProviders() as ExecutionProvider.Name
/// 2. ORT runtime EP names — returned by ORT enumeration APIs such as
/// OrtEnv.GetEpDevices() as OrtEpDevice.EpName; these are the names used by
/// SessionOptions and OrtEpDevice
/// 3. Model catalog JSON — the "executionProviders[].name" field in files like
/// Resources/SqueezeNetModelCatalog.json
///
/// When a provider appears under different names in these sources, each relevant form
/// must be listed here so the lookup succeeds regardless of which name is passed in.
/// If a new EP is added to the ORT runtime, WinRT catalog, or model catalog introduces
/// an alias, a corresponding entry should be added below.

Copilot uses AI. Check for mistakes.
@yeelam-gordon yeelam-gordon requested a review from timkur April 14, 2026 23:00
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.

2 participants