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

[better_errors] Improvements in propagation of debugging info #25916

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

gnecula
Copy link
Collaborator

@gnecula gnecula commented Jan 15, 2025

Added some documentation for TracingDebugInfo (docstring, comments
about arg_names, since it was not obvious to me that this would
flatten the non-static arguments).

Laying the ground for the unification of the old api_util.debug_info
and partial_eval.tracing_debug_info: we rename the former to
api_util.tracing_debug_info, we push inside the calls to
fun_sourceinfo and fun_signature (which were done by the callers
until now), and we rewrite the latter in terms
of the former. We leave for a future PR the actual replacing of the
latter with the former throughout.

In the process of above, cleaned up the one case when partial_eval.tracing_debug_info
received None for the in_tree and out_tracer_thunk. The function contained
catch-all exception clauses to handle those, but doing so it masked other places
where we fail to collect debug info due to programming mistakes. E.g., in
one place we passed a WrappedFun instead of a Callable, resulting in missing debugging info.

Added more type declarations.

Added a state_test with a failure to track debugging information, manifested
with a leaked tracer without function provenance. Fixing this in a subsequent PR.

@gnecula gnecula self-assigned this Jan 15, 2025
@gnecula gnecula added the pull ready Ready for copybara import and testing label Jan 15, 2025
@gnecula gnecula changed the title [better_errors] Ensure that arg_names is never None Improvements in propagation of debugging info Jan 16, 2025
@gnecula gnecula force-pushed the debug_info_4 branch 2 times, most recently from b9f29b9 to dfc7490 Compare January 16, 2025 09:23
@gnecula gnecula changed the title Improvements in propagation of debugging info [better_errors] Improvements in propagation of debugging info Jan 16, 2025
@gnecula gnecula force-pushed the debug_info_4 branch 7 times, most recently from 29a9f5d to 688051a Compare January 20, 2025 13:13
Added some documentation for `TracingDebugInfo` (docstring, comments
about `arg_names`, since it was not obvious to me that this would
flatten the non-static arguments).

Laying the ground for the unification of the old `api_util.debug_info`
and `partial_eval.tracing_debug_info`: we rename the former to
`api_util.tracing_debug_info`, we push inside the calls to
`fun_sourceinfo` and `fun_signature` (which were done by the callers
until now), and we rewrite the latter in terms
of the former. We leave for a future PR the actual replacing of the
latter with the former throughout.

In the process of above, cleaned up the one case when `partial_eval.tracing_debug_info`
received None for the `in_tree` and `out_tracer_thunk`. The function contained
catch-all exception clauses to handle those, but doing so it masked other places
where we fail to collect debug info due to programming mistakes. E.g., in
one place we passed a `WrappedFun` instead of a `Callable`, resulting in missing debugging info.

Added more type declarations.

Added a `state_test` with a failure to track debugging information, manifested
with a leaked tracer without function provenance. Fixing this in a subsequent PR.
@copybara-service copybara-service bot merged commit ce48f64 into jax-ml:main Jan 20, 2025
23 checks passed
@gnecula gnecula deleted the debug_info_4 branch January 20, 2025 14:50
copybara-service bot pushed a commit that referenced this pull request Jan 20, 2025
Following #25916 there were a few TODOs
left in the code to remove api_util.debug_info and replace the
one remaining use with api_util.tracing_debug_info.

PiperOrigin-RevId: 717523621
copybara-service bot pushed a commit that referenced this pull request Jan 20, 2025
Following #25916 there were a few TODOs
left in the code to remove api_util.debug_info and replace the
one remaining use with api_util.tracing_debug_info.

PiperOrigin-RevId: 717523621
copybara-service bot pushed a commit that referenced this pull request Jan 20, 2025
Following #25916 there were a few TODOs
left in the code to remove api_util.debug_info and replace the
one remaining use with api_util.tracing_debug_info.

PiperOrigin-RevId: 717523621
copybara-service bot pushed a commit that referenced this pull request Jan 20, 2025
Following #25916 there were a few TODOs
left in the code to remove api_util.debug_info and replace the
one remaining use with api_util.tracing_debug_info.

PiperOrigin-RevId: 717523621
copybara-service bot pushed a commit that referenced this pull request Jan 20, 2025
Following #25916 there were a few TODOs
left in the code to remove api_util.debug_info and replace the
one remaining use with api_util.tracing_debug_info.

PiperOrigin-RevId: 717523621
copybara-service bot pushed a commit that referenced this pull request Jan 20, 2025
Following #25916 there were a few TODOs
left in the code to remove api_util.debug_info and replace the
one remaining use with api_util.tracing_debug_info.

PiperOrigin-RevId: 717523621
copybara-service bot pushed a commit that referenced this pull request Jan 20, 2025
Following #25916 there were a few TODOs
left in the code to remove api_util.debug_info and replace the
one remaining use with api_util.tracing_debug_info.

PiperOrigin-RevId: 717523621
copybara-service bot pushed a commit that referenced this pull request Jan 20, 2025
Following #25916 there were a few TODOs
left in the code to remove api_util.debug_info and replace the
one remaining use with api_util.tracing_debug_info.

PiperOrigin-RevId: 717523621
copybara-service bot pushed a commit that referenced this pull request Jan 20, 2025
Following #25916 there were a few TODOs
left in the code to remove api_util.debug_info and replace the
one remaining use with api_util.tracing_debug_info.

PiperOrigin-RevId: 717583667
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pull ready Ready for copybara import and testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant