-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[release 1.8] backport of precompile: serialize the full edges graph (#46920) #47741
[release 1.8] backport of precompile: serialize the full edges graph (#46920) #47741
Commits on Nov 29, 2022
-
invoke
d calls: record invoke signature in backedges (#46010)This includes only the changes to `dump.c` for this change, but excludes the functional part of the change (except for the additional bugfixes mentioned below). ORIGINAL COMMIT TEXT: This fixes a long-standing issue with how we've handled `invoke` calls with respect to method invalidation. When we load a package, we need to ask whether a given MethodInstance would be compiled in the same way now (aka, in the user's running session) as when the package was precompiled; in practice, the way we do that is to test whether the dispatches would be to the same methods in the current world-age. `invoke` presents special challenges because it allows the coder to deliberately select a different method than the one that would be chosen by ordinary dispatch; if there is no record of how this choice was made, it can look like it resolves to the wrong method and this can trigger invalidation. This allows a MethodInstance to store dispatch tuples as well as other MethodInstances among their backedges. Additionally: - provide backedge-iterators for both C and Julia that abstracts the specific storage mechanism. - fix a bug in the CodeInstance `relocatability` field, where methods that only return a constant (and hence store `nothing` for `inferred`) were deemed non-relocatable. - fix a bug in which #43990 should have checked that the method had not been deleted. Tests passed formerly simply because we weren't caching external CodeInstances that inferred down to a `Const`; fixing that exposed the bug. This bug has been exposed since merging #43990 for non-`Const` inference, and would affect Revise etc. Co-authored-by: Jameson Nash <vtjnash@gmail.com> (cherry picked from commits dd375e1, cb0721b, 9e39fe9)
Configuration menu - View commit details
-
Copy full SHA for 6fbd2ea - Browse repository at this point
Copy the full SHA 6fbd2eaView commit details -
dump: implement cycle handling in has_backedge_to_worklist (#46749)
(cherry picked from commit d4f0567)
Configuration menu - View commit details
-
Copy full SHA for af333c9 - Browse repository at this point
Copy the full SHA af333c9View commit details -
Improve attribution of backedge-triggered invalidation (#46756)
SnoopCompile attempts to attribute invalidations to specific causes, but until now it has not generally been able to handle what it called "delayed" invalidations, which arose when a MethodInstance backedge wasn't valid anymore. This dumps more data to the reporting stream and should allow SnoopCompile to assemble the full chain of causes. This also adds invalidation of the backedges of methods that fail to validate their external edges. (cherry picked from commit b43bc62)
Configuration menu - View commit details
-
Copy full SHA for 10288cc - Browse repository at this point
Copy the full SHA 10288ccView commit details -
Precompile correct invoke-targets (#46907)
This fixes backedge-based invalidation when a precompiled `invoke` is followed by loading a package that adds new specializations for the `invoke`d method. An example is LowRankApprox.jl, where FillArrays adds a specialization to `unique`. (cherry picked from commit 698beed)
Configuration menu - View commit details
-
Copy full SHA for 8d2e0f3 - Browse repository at this point
Copy the full SHA 8d2e0f3View commit details -
precompile: serialize the full edges graph (#46920)
Previously, we would flatten the edges graph during serialization, to simplify the deserialization codes, but that now was adding complexity and confusion and uncertainty to the code paths. Clean that all up, so that we do not do that. Validation is performed while they are represented as forward edges, so avoids needing to interact with backedges at all. This uses the same algorithm now as #46749 for cycle convergence. (cherry picked from commit fbd5a72)
Configuration menu - View commit details
-
Copy full SHA for b595038 - Browse repository at this point
Copy the full SHA b595038View commit details -
dump: make serialization gc-safe (#47086)
(cherry picked from commit e304cd5)
Configuration menu - View commit details
-
Copy full SHA for 9fabd15 - Browse repository at this point
Copy the full SHA 9fabd15View commit details -
Fix loading of AMDGPU and CUDA (#47334)
Co-authored-by: Jameson Nash <vtjnash@gmail.com> Co-authored-by: Valentin Churavy <vchuravy@users.noreply.github.com> (cherry picked from commit 0daab8a)
Configuration menu - View commit details
-
Copy full SHA for 35b2ab6 - Browse repository at this point
Copy the full SHA 35b2ab6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 09c6f18 - Browse repository at this point
Copy the full SHA 09c6f18View commit details