[AIMIGRAPHX-1054] Log debug symbols when exceptions are thrown#4978
Open
eddieliao wants to merge 8 commits into
Open
[AIMIGRAPHX-1054] Log debug symbols when exceptions are thrown#4978eddieliao wants to merge 8 commits into
eddieliao wants to merge 8 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds exception-path debug logging to help correlate thrown exceptions with MIGraphX debug symbols during evaluation, shape recomputation, instruction replacement, and ONNX parsing.
Changes:
- Introduces a small
on_scope_fail/scope_fail_guardutility (exception-only scope guard). - Adds
log_debug_symbols_on_exception(const instruction&) noexceptand wires it into core execution/shape paths. - Extends ONNX parsing to emit a debug log containing the node’s debug symbol when parsing throws.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
src/program.cpp |
Adds a scope-fail guard in generic_eval to log instruction debug symbols on thrown exceptions. |
src/onnx/onnx_parser.cpp |
Adds scope-fail logging for node parsing failures (manual debug symbol construction). |
src/module.cpp |
Adds scope-fail logging around multiple shape/replace codepaths. |
src/instruction.cpp |
Adds scope-fail logging during shape recomputation and introduces the log_debug_symbols_on_exception helper. |
src/include/migraphx/scope_guard.hpp |
New exception-only scope guard implementation. |
src/include/migraphx/instruction.hpp |
Exposes the new logging helper in the public instruction API. |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4978 +/- ##
===========================================
- Coverage 92.73% 92.71% -0.02%
===========================================
Files 592 593 +1
Lines 31289 31323 +34
===========================================
+ Hits 29015 29040 +25
- Misses 2274 2283 +9
🚀 New features to boost your workflow:
|
Regressions detected 🔴 * No develop baseline was found for this PR's branch point; compared against the latest available develop run instead. |
|
CharlieL7
requested changes
Jun 17, 2026
Collaborator
|
What is the output when an exception is thrown with debug symbols? |
Contributor
Author
|
CharlieL7
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
This PR logs debug symbols on the
debugseverity when an exception is thrown.Technical Details
Using a scope guard that tracks the number of uncaught exceptions, if the number exceeds the starting amount when the scope of the code section (usually for
computeorinsert), the associated debug symbols will be logged. The case inonnx_parserwill build the debug symbol manually as there is no instruction to refer back to yet.Changelog Category
Add a
CHANGELOG.mdentry for any option other thanNot Applicable