Skip to content

session: deduplicate AutoEP custom-op domains - #32711

Merged
mirounga merged 2 commits into
microsoft:mainfrom
CodeLinaro:dev/kuanyul-qti/fix-customop-domain-duplicate
Sep 24, 2026
Merged

mirounga merged 2 commits into
microsoft:mainfrom
CodeLinaro:dev/kuanyul-qti/fix-customop-domain-duplicate

Conversation

@kuanyul-qti

Copy link
Copy Markdown
Contributor

Motivation and Context

AutoEP can select and expose multiple OrtEpDevice instances for a single session. Some of those devices may be backed by the same EP factory, so querying each device for custom-op domains can return repeated domains.

ORT gathers all EP-provided custom-op domains into one session-local collection and registers them with the session's custom registry before model load. That registry expects each domain to be unique. If the same domain is registered twice, registration fails with "Domain already set in registry", even though the duplicate came from equivalent AutoEP devices rather than user configuration.

This mainly affects multi-device AutoEP sessions. Single-device AutoEP sessions do not hit the issue because only one copy of the domain is collected.

Description

Deduplicate custom-op domains collected from AutoEP devices before registering them with the session-local custom registry.

The change keeps only one copy of each EP-provided custom-op domain while still skipping domains already supplied through session options.

This ports the AutoEP custom-op domain deduplication from onnxruntime/onnxruntime-qnn#608.

Copilot AI balanced review requested due to automatic review settings September 21, 2026 09:45
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

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.

Copilot review overview

🟑 Changes recommended

Expected AutoEP duplicates currently emit a misleading session-options warning.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Deduplicates AutoEP-provided custom-op domains before session registry creation.

Changes:

  • Filters duplicate domains across AutoEP devices.
  • Preserves session-option conflict handling across both model-loading paths.
File Description
onnxruntime/​core/​session/​utils.cc Deduplicates collected AutoEP custom-op domains.

πŸ’‘ Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread onnxruntime/core/session/utils.cc Resolved
Skip EP-provided custom-op domains that were already collected from another
AutoEP device before registering the session-local custom registry.

Copilot AI left a comment

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.

Copilot review overview

🟑 Changes recommended

The multi-device failure and both modified loading paths need regression coverage.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
Resolved since last review (1)

Comment thread onnxruntime/core/session/utils.cc Resolved
@kuanyul-qti

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree company="Qualcomm"

Copilot AI left a comment

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.

Copilot review overview

🟒 Approval recommended

The deduplication is correctly applied to both implementation paths and is covered by targeted multi-device regression tests.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)

@kuanyul-qti

Copy link
Copy Markdown
Contributor Author

Hi Xavier DuprΓ© (@xadupre) , Could you help trigger the CI workflow? Thanks.

@mirounga
mirounga self-requested a review September 24, 2026 16:08
This was referenced Nov 2, 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.

3 participants