Skip to content

Better error handling when graph execution fails#331

Merged
hugary1995 merged 1 commit intomainfrom
interp_error
Mar 4, 2026
Merged

Better error handling when graph execution fails#331
hugary1995 merged 1 commit intomainfrom
interp_error

Conversation

@hugary1995
Copy link
Collaborator

Generally better error handling when graph execution fails. This also includes better error messages for Interpolations.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 clearer NEMLException that 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.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@hugary1995 hugary1995 merged commit 75d54ed into main Mar 4, 2026
31 checks passed
@hugary1995 hugary1995 deleted the interp_error branch March 4, 2026 23:55
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Documentation preview removed.
To view the documentation, please visit the main documentation page.

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.

2 participants