Skip to content

Conversation

@andersendsa
Copy link

Motivation
Currently, developers using torch.compile with the OpenVINO backend lack visibility into whether the model is running on OpenVINO or falling back to native PyTorch. Even with debug logging enabled, the backend suppresses logs by overriding the log level, making debugging difficult. This PR addresses Issue #33116.

Changes
Allow User-Configured Logging: Removed logger.setLevel(logging.WARNING) in src/bindings/python/src/openvino/frontend/pytorch/torchdynamo/backend.py. This ensures that the logger respects the logging level set by the user (e.g., via logging.basicConfig(level=logging.DEBUG)), allowing verbose logs to appear.
Visibility of Subgraphs: Added logger.info to print the subgraph being compiled ("OpenVINO backend is called with subgraph: ..."). This helps users identify exactly what is being offloaded to OpenVINO.
Success Confirmation: Added a log message "Subgraph successfully compiled with OpenVINO" to confirm successful compilation.
Explicit Fallback Warning: Upgraded the compilation failure log from DEBUG to WARNING. If OpenVINO fails to compile a subgraph, the user is now explicitly warned that execution is falling back to the default backend (Native PyTorch).
Verification
Verified that enabling debug logging now correctly outputs the added INFO logs showing the subgraph.
Verified that exceptions during compilation trigger a visible WARNING log indicating the fallback.
Ensured that standard execution flows remain unaffected.*
Closes #33116

Removed the hardcoded log level setting to allow user configuration.
Added INFO logs to indicate when OpenVINO backend is used and when subgraphs are successfully compiled.
Upgraded the fallback log message from DEBUG to WARNING to make it visible when the model falls back to native PyTorch.
@andersendsa andersendsa requested a review from a team as a code owner January 6, 2026 00:58
@github-actions github-actions bot added category: Python API OpenVINO Python bindings category: PyTorch FE OpenVINO PyTorch Frontend labels Jan 6, 2026
@sys-openvino-ci sys-openvino-ci added the ExternalPR External contributor label Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: Python API OpenVINO Python bindings category: PyTorch FE OpenVINO PyTorch Frontend ExternalPR External contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Good First Issue]: Improve logging for OpenVINO torch.compile feature

2 participants