Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Utility][Relax] Implemented InjectDebugCallback transform #17282

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Lunderberg
Copy link
Contributor

In general, intermediate values produced while evaluating Relax functions are not visible to an end user. While this provides stronger guarantees to the compiler, it can make debugging difficult. For example, if an end-to-end model is producing incorrect results, it can be difficult to determine which step of the model first introduced an error.

This commit implements relax.transform.InjectDebugCallback, which adds a debug_callback parameter to each externally-exposed function of an IRModule. This callback is called with the name and value of each variable binding within the function bodies, allowing error-checking to be added. For example, a binding of B = R.add(A,A) would be followed by debug_callback("B", B).

In general, intermediate values produced while evaluating Relax
functions are not visible to an end user.  While this provides
stronger guarantees to the compiler, it can make debugging difficult.
For example, if an end-to-end model is producing incorrect results, it
can be difficult to determine which step of the model first introduced
an error.

This commit implements `relax.transform.InjectDebugCallback`, which
adds a `debug_callback` parameter to each externally-exposed function
of an `IRModule`.  This callback is called with the name and value of
each variable binding within the function bodies, allowing
error-checking to be added.  For example, a binding of `B =
R.add(A,A)` would be followed by `debug_callback("B", B)`.
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.

1 participant