-
Notifications
You must be signed in to change notification settings - Fork 90
fix: jax backend tolist for tracers in logging #2580
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
fix: jax backend tolist for tracers in logging #2580
Conversation
this likely needs #2566 in |
a2f3bc8
to
44ef21e
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2580 +/- ##
=======================================
Coverage 98.23% 98.23%
=======================================
Files 65 65
Lines 4193 4198 +5
Branches 591 592 +1
=======================================
+ Hits 4119 4124 +5
Misses 45 45
Partials 29 29
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
As the coverage dips with this addition, can we also get a very small test added for it?
I've addressed your comments @matthewfeickert, hope this test is what you were looking for. |
Peter, Can you also add the
part in the PR body? (Sorry, missed that till now.) |
Thanks @pfackeldey! This will go into |
Also thanks for your first (PR) contribution to pyhf! 😄 |
Description
Resolves #1422
This failure is encountered during tracing time. JAX can not convert a tracer during
.tolist
(because it has no data to put in a list) which is why it fails with a different error. This PR checks if we're currently in tracing time and instead returns the tracer (or rather its abstract value for a little nicer representation).The new error looks as expected like this now:
The logging will print:
"Eval failed for data ShapedArray(float64[1]) pars: ShapedArray(float64[2])"
This is the most information available during tracing time (shape and dtype), there's not much more to give to the user.
Checklist Before Requesting Reviewer
Before Merging
For the PR Assignees:
Commit message summary: