-
Notifications
You must be signed in to change notification settings - Fork 31
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
Fixes for Julia nightly #300
base: main
Are you sure you want to change the base?
Conversation
To highlight which are broken, should probably be fixed before merging
This will also need a proper Compiler versioning. I went with EDIT: this is discussed at JuliaLang/julia#57520 |
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.
Overall LGTM
The compiler versioning issue set aside, this is in a working state and can be merged. Perhaps best to get this in now so we may move forward with DAECompiler, even if it requires |
Makes Diffractor functional on nightly, ensuring that the test suite runs without errors.
Requires JuliaDiff/ChainRules.jl#819 merged and JuliaDebug/Cthulhu.jl#621 released to be fully functional.
Before merge (marking as draft until completed, but this is ready for review):
set_cthulhu_source!
introduced in adjust Cthulhu to JuliaLang/julia#56248 JuliaDebug/Cthulhu.jl#621 for convenience).Base.Compiler
(see Fixes for Julia nightly #300 (comment))A significant refactor of the overload of
CC.finishinfer!
/CC.finish!
/CC.transform_result_for_cache
was made to follow exactly the same logic as Cthulhu (these seem to have been copy-pasted from there into Diffractor, the changes simply sync them).The most notable change in this PR is that it works around IR changes, as described below.
GlobalRef changes
On nightly, what used to be a
GlobalRef
in lowered IR may now be agetproperty
instead, with a firstModule
SSA argument and a symbol. To illustrate this, instead of something likewe now have
As a possible fix, we may preserve the old semantics by associating the latter IR with the former. This is what I attempted to fix the failing tests, but as the IR transforms are performed within a generated function we cannot evaluate
GlobalRef
s for module arguments (as inMain.B
) to know whethergetproperty
is a global access or not (i.e. is the first argument a module), because we can't see past the world age of the generated function definition.Instead, we instrument the
getproperty
call for differentiation, and I added arrule
withNoTangent()
.