Skip to content

Fix localized DirectML adapter errors in Python - #32543

Open
Aziz Muminov (AzizMuminov) wants to merge 1 commit into
microsoft:mainfrom
AzizMuminov:fix/dml-adapter-error-32082
Open

Aziz Muminov (AzizMuminov) wants to merge 1 commit into
microsoft:mainfrom
AzizMuminov:fix/dml-adapter-error-32082

Conversation

@AzizMuminov

Copy link
Copy Markdown

Summary

  • Report invalid DirectML adapter requests with a stable ASCII message before the error crosses the Python boundary.
  • Add a Windows + DirectML regression test for an invalid device ID.

Fixes #32082

Testing

  • python3 -m py_compile onnxruntime/test/python/onnxruntime_test_python.py
  • git diff --check
  • Not run: the regression test requires Windows with DirectML; pytest is unavailable in this environment.

Copilot AI balanced review requested due to automatic review settings September 10, 2026 15:33
@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.

🟢 Approval recommended

The focused fix addresses the reported failure and includes appropriate regression coverage.

Pull request overview

Adds a stable ASCII error for invalid DirectML adapter IDs crossing into Python.

Changes:

  • Replaces localized DXGI adapter-enumeration exceptions with an ASCII message.
  • Adds a Windows DirectML regression test.
File summaries
File Description
onnxruntime/core/providers/dml/dml_provider_factory.cc Produces a locale-independent adapter error.
onnxruntime/test/python/onnxruntime_test_python.py Verifies Python receives the readable error.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@AzizMuminov

Copy link
Copy Markdown
Author

/azp run Linux Android Emulator QNN CI Pipeline

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 32543 in repo microsoft/onnxruntime

@AzizMuminov

Copy link
Copy Markdown
Author

adrastogi Hisham Chowdhury (@hisham-hchowdhu) Could you please review this focused DirectML error-handling fix when you have a moment? It adds regression coverage for the localized Windows Python error path. The automated review found no issues; CI is awaiting maintainer authorization.

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.

UnicodeDecodeError instead of actual error message when DlirectML fails on non-English Windows

2 participants