-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Remove show
for Type{<:Pullback}
#1356
Conversation
Some previous discussions about |
BTW this addresses one part of #877. |
This would be nice if it were merged! |
After seeing enough outputs like https://github.com/FluxML/Metalhead.jl/actions/runs/3800957452/jobs/6466762142#step:7:127, I'm afraid I have to agree with @willtebbutt's first point in #1354 (comment). Note that Zygote would have it even worse because |
I'm still not sure what's the main problem with verbose stacktraces - is it that it is incomprehensible for users? I assume for "regular" users actually it might not matter since I guess neither compact nor verbose stacktraces involving Zygote are easy to decipher. We could even point users to https://github.com/BioTurboNick/AbbreviatedStackTraces.jl. Or just load it in the CI if the main problem are long logs? However, for debugging purposes and bug reporting it could even be an advantage if the output is more verbose. |
They're large enough that they go beyond useful for debugging and around the other end—namely that the signal-to-noise ratio is so low that they often hinder debugging. That and they're more liable to blow past any line limits set by terminals, CI providers, etc, so there's also the risk of losing important output before the stacktrace. RE configurability, that's what I was getting at with using Preferences.jl. AbbreviatedStacktraces doesn't really help IIUC because it eliminates entire stack frames instead of abbreviating types? |
I agree that probably in many cases the full types are more verbose than needed for debugging - but it definitely happened to me multiple times in the past when debugging AD issues in DistributionsAD that - due to the From the README of AbbreviatedStacktraces:
So to me it seems the problem would be fixed for end users since, unless they work on Zygote directly, they would not see the part of the stacktraces that's caused by Zygote internals and hence the |
Were load latency not a problem, that would be my suggestion. Basically prototype that Julia issue by hiding the uninformative second type parameter, which happens to cause the vast majority of the output bloat.
I would really recommend taking some nested Turing model or similar and seeing how the stacktraces look with these show methods removed. It's pretty clear from the Flux side that such sizes are untenable. Also, we ought not to treat this as the only way to reduce load latency for Zygote. Surely there are other avenues which do not come with such a large tradeoff.
But this falls apart the moment they want to ask for help or report an issue. Likewise we want to see those stack frames on CI, just not the whole type along with them. I couldn't find any mention of an option in AbbreviatedStackTraces to just summarize types without removing frames, so it doesn't seem all that useful here. |
Regarding invalidations at least, this |
I guess if the stacktraces are a blocker for the invalidation fixes, we have to wait for JuliaLang/julia#48444. |
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.
I'm approving and merging this now because it turns out the custom type show method is causing the last failure on nightly CI (i.e. actual bugs). However, this just reinforces the idea that Base should either provide a more robust, extensible API for type printing or mechanisms to cut down on type parameter explosion in show
/display
.
Alternative to #1354 by removing a
show
method forType{<:Pullback}
. I see an even more drastic improvement than reported in #1354:master branch
this PR