Better error handling when graph execution fails#331
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves diagnostics when model execution fails under Torch JIT tracing, and adds coverage to ensure the improved error messaging is surfaced to users (including a new test input that triggers an interpolation out-of-bounds during a driver run).
Changes:
- Wrap traced graph execution failures (
GraphFunction::run) with a clearerNEMLExceptionthat includes a hint to disable JIT for more detailed errors. - Add debug/release checks in interpolation coordinate selection to detect out-of-bounds interpolation inputs earlier.
- Add a unit test + input file that intentionally triggers a traced execution failure and asserts the new hint is present.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/models/test_graph_execution_exception.i | New test input that drives an interpolation out-of-range during execution. |
| tests/unit/models/test_Model.cxx | Adds a unit test asserting the JIT-disable hint appears on traced execution failure. |
| src/neml2/models/Model.cxx | Catches traced graph execution exceptions and rethrows with an actionable hint. |
| src/neml2/models/Interpolation.cxx | Adds bounds checks around masked interval selection for interpolation. |
| include/neml2/models/Model.h | Declares a virtual hook for adding graph-execution failure hints. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Documentation preview: https://applied-material-modeling.github.io/neml2/pr-preview/331 |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Documentation preview removed. |
Generally better error handling when graph execution fails. This also includes better error messages for Interpolations.