-
Notifications
You must be signed in to change notification settings - Fork 3.2k
docs: Add note about computation perturbation in debug.print/breakpoint #26682
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
base: main
Are you sure you want to change the base?
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Thanks! Can you fill out the CLA as requested by the bot? |
@dfm Thank you! I signed. |
Thanks! Although, it looks like there might be a mismatch between the email address you have configured for git, and the one you used to sign the form. Can you click through to that failing workflow for more info, and try to get it green? |
1ec3ecb
to
60a7a8b
Compare
Thank you! I think it is ok now. |
docs/debugging/print_breakpoint.md
Outdated
|
||
#### Computation perturbation | ||
|
||
Adding `jax.debug.print` or `jax.debug.breakpoint` statements will change the computation that XLA is asked to compile. This can potentially result in numeric discrepancies compared to the same code without debug statements. Keep this in mind when debugging numerical issues, as the act of adding debug statements might affect the behavior you're trying to investigate. |
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.
It might be worth explicitly noting that the reason for this change is that XLA might perform different fusions when compiling.
Thanks! I left a small comment, but this otherwise looks good to me. |
@alhridoy — Sorry, I didn't see that you had pushed a change because I only get notified for comments. Looks good now. Can you squash and rebase your commits onto the current main branch? Once you've done that, please ping me and I'll get this merged. Thanks!! |
0fef626
to
55ae0ef
Compare
This commit adds documentation about how using jax.debug.print and jax.debug.breakpoint can perturb the computation that XLA compiles, potentially leading to numeric discrepancies. This happens because XLA might perform different fusions when compiling with debug statements. Fixes jax-ml#26370
55ae0ef
to
06e0356
Compare
This commit adds documentation about how using jax.debug.print and jax.debug.breakpoint can perturb the computation that XLA compiles, potentially leading to numeric discrepancies.
Fixes #26370