-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add enable-debug-info flag in catalyst #1331
base: main
Are you sure you want to change the base?
Conversation
Added enable-debug-info option in compilerOptions Fix user function location in the generated mlir
@@ -52,7 +52,7 @@ | |||
|
|||
|
|||
@debug_logger | |||
def jaxpr_to_mlir(func_name, jaxpr): | |||
def jaxpr_to_mlir(func_name, jaxpr, func_loc=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add func_loc
to the list of Args in the docstring below?
@@ -553,7 +553,7 @@ def trace_to_jaxpr(func, static_argnums, abstracted_axes, args, kwargs): | |||
|
|||
|
|||
@debug_logger | |||
def lower_jaxpr_to_mlir(jaxpr, func_name): | |||
def lower_jaxpr_to_mlir(jaxpr, func_name, func_loc=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
@@ -244,6 +244,22 @@ def func(): | |||
|
|||
func.workspace.cleanup() | |||
|
|||
def test_debug_info(self, capsys): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change this to be a lit test?
Context:
Currently debug info is not propagated from JAX to LLVM making it.
Description of the Change:
This PR adds a qjit option "enable_debug_info" that adds the debug info to the intermediate IRs.
Benefits:
Intermediate IR files can now be created with debug info.
Possible Drawbacks:
the large number of MLIR passed that modify the IR may distort the debug info, so it may lose accuracy.
Related GitHub Issues:
[sc-73579]