-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Attribution for "insert_backedges" invalidations #41913
Conversation
Invalidations can be immediate (when an existing MethodInstance gets invalidated by a new method definition) or delayed. The latter occurs during deserialization: when a package was built, a particular call dispatches to Method 1, but when loaded (due to different loading orders and dependencies) it should instead dispatch to Method 2. These delayed invalidations are not particularly common, and perhaps because of this SnoopCompile has never supported them well: they have merely been dumped to the console during `invalidation_tree` construction. However, in larger software stacks they seem to become more common, and can dramatically affect precompilation success. This simple PR identifies "causes" for such delayed invalidations, allowing SnoopCompile to determine (in most cases) the particular definition or deletion that triggered the change in dispatch.
38e9b93
to
9708b66
Compare
Yeah, that doesn't look good... we'll need to chat about this one @chriselrod haha. Could that instead be |
Thanks for the review, @vtjnash |
Yeah, was kind of hoping people wouldn't pay too much attention to that. Roughly speaking, CPUSummary.jl and HostCPUFeatures.jl do this for a lot of attributes, but only the number of threads is likely to be wrong if you precompiled it on the same system that is running it. Also, if you don't want |
This seems like a case where we want different precompile caches depending on the number of threads. Or perhaps LV should compile the method for multiple threading options. EDIT: for the record, I don't think I was changing my number of threads. I'll have a SnoopCompile branch up shortly that might make it easier to investigate. Maybe the parallel precompilation is a factor? |
These were printed to the console but not otherwise stored. Storing them allows one to give them more emphasis and perform analysis. With JuliaLang/julia#41913, it becomes possible to attribute them to specific method definitions or deletions. (Of course there might be multiple reasons, but we need to identify at least one in order to make progress.)
These were printed to the console but not otherwise stored. Storing them allows one to give them more emphasis and perform analysis. With JuliaLang/julia#41913, it becomes possible to attribute them to specific method definitions or deletions. (Of course there might be multiple reasons, but we need to identify at least one in order to make progress.)
When precompiling, it should be set to I will switch Polyester away from
|
I propose we move the rest of the discussion to JuliaSIMD/CPUSummary.jl#3 |
Invalidations can be immediate (when an existing MethodInstance gets invalidated by a new method definition) or delayed. The latter occurs during deserialization: when a package was built, a particular call dispatches to Method 1, but when loaded (due to different loading orders and dependencies) it should instead dispatch to Method 2. These delayed invalidations are not particularly common, and perhaps because of this SnoopCompile has never supported them well: they have merely been dumped to the console during `invalidation_tree` construction. However, in larger software stacks they seem to become more common, and can dramatically affect precompilation success. This simple PR identifies "causes" for such delayed invalidations, allowing SnoopCompile to determine (in most cases) the particular definition or deletion that triggered the change in dispatch.
Invalidations can be immediate (when an existing MethodInstance gets invalidated by a new method definition) or delayed. The latter occurs during deserialization: when a package was built, a particular call dispatches to Method 1, but when loaded (due to different loading orders and dependencies) it should instead dispatch to Method 2. These delayed invalidations are not particularly common, and perhaps because of this SnoopCompile has never supported them well: they have merely been dumped to the console during `invalidation_tree` construction. However, in larger software stacks they seem to become more common, and can dramatically affect precompilation success. This simple PR identifies "causes" for such delayed invalidations, allowing SnoopCompile to determine (in most cases) the particular definition or deletion that triggered the change in dispatch.
Invalidations can be immediate (when an existing MethodInstance gets
invalidated by a new method definition) or delayed. The latter occurs
during deserialization: when a package was built, a particular call
dispatches to Method 1, but when loaded (due to different loading
orders and dependencies) it should instead dispatch to Method 2. These
delayed invalidations are not particularly common, and perhaps because
of this SnoopCompile has never supported them well: they have merely
been dumped to the console during
invalidation_tree
construction. However, in larger software stacks they seem to become
more common, and can dramatically affect precompilation success.
This simple PR identifies "causes" for such delayed invalidations,
allowing SnoopCompile to determine (in most cases) the particular
definition or deletion that triggered the change in dispatch.
Using this in conjunction with local changes to SnoopCompile (to be submitted once I get a
Base.VERSION
number for this change), here's a demonstration on OrdinaryDiffEq (as a screenshot to preserve color):That corresponds to this code block, which until this change had never drawn my attention but which turns out to contribute 19 separate invalidations, including some expensive-to-compile methods like
OrdinaryDiffEq.perform_step!
, seemingly dependent (in ways not yet fully elucidated) on package build & loading order.CC @chriselrod, @ChrisRackauckas.