Skip to content

Conversation

@nimdrak
Copy link

@nimdrak nimdrak commented Jan 15, 2026

Description

This PR fixes a bug regarding how _fallback_providers is set. With this change, when setting providers to ["TensorrtExecutionProvider", "CUDAExecutionProvider"], _fallback_providers will correctly resolve to ["CUDAExecutionProvider", "CPUExecutionProvider"].

Motivation and Context

Fixes #27006

When setting providers to ["TensorrtExecutionProvider", "CUDAExecutionProvider"], _fallback_providers is expected to be ["CUDAExecutionProvider", "CPUExecutionProvider"]. However, currently it results in ["CPUExecutionProvider"].

This issue originates from the else statement logic within NvTensorRTRTXExecutionProvider. It appears the original intention was to prioritize NvTensorRTRTXExecutionProvider, but it inadvertently caused this bug.

This PR fixes the issue while preserving the original design intention.

@nimdrak nimdrak changed the title Fix the bug in setting _fallback_providers Fix the bug in setting _fallback_providers Jan 15, 2026
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.

[Bug] _fallback_providers can be incorrectly overwritten to CPUExecutionProvider when using TensorrtExecutionProvider and CUDAExecutionProvider

1 participant