-
Notifications
You must be signed in to change notification settings - Fork 9
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
Switch from IRTools to CodeInfo #126
Conversation
It turns out |
Let's focus on Julia |
Take function
Its
Under 1.7
Under 1.8:
Conclusion:
|
Good to know, probably due to the major compiler refactoring in 1.7.
Maybe raise an issue on the |
Maybe we can remove the dependency of |
We will likely need to update I took a quick look at the 1.8 error, and it appears that Julia has a simple function signature change between 1.7 and 1.8. It should be possible to fix that quickly. |
CC @femtomc |
Re — open issue in CodeInfoTools with stacktrace for failure on > 1.8. |
I opened 2 related issues: |
All tests passed with JuliaCompilerPlugins/CodeInfoTools.jl#14. |
Re — inlining transforms should likely not live in CodeInfoTools. Ideally, the plugin (speculative) interface should be used to do this. It’s still WIP tho. also, tracking types and things that are required to do inlining is possible in CodeInfoTools (just like IRTools) but there’s no really code to do that yet |
The tests currently fail on the Turing test suite with the following errors (maybe more)
and
|
Hope 2e96940 fixes them. PS: Why our IntegrationTest doesn't show the errors? |
Many thanks, @femtomc would you like to make a release of |
Because Turing is not compatible with Libtask 0.7 or 0.8, and hence it is not possible to run them: |
We could add a bit of logic to the CI which removes the compat entry from Turing for these integration tests? Would require only a few lines of code. Ping me if I need to open a PR for this on this repo. |
Seconded - that would be nice! @rikhuijzer |
I think we shouldn't do this. The point of breaking releases is to mark that there are breaking changes - so one can't expect downstream packages to work. And if downstream packages are broken it's not an issue since they explicitly state that they might not be compatible with this breaking release and also the package manager will never install them before the compat bound is updated. |
And if you are about to make a breaking release you can already now only bump the version in the final commit before the PR is merged - then the downstream packages will be tested and you will see test errors. In this PR the issue is that Turing is not even compatible with Libtask 0.7 though. |
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 added some comments and suggestions. Overall it looks good, I can't comment too much on CodeInfoTools/IRTools specifics but I think it makes sense to move to the more stable and more lightweight alternative since it does not seem to increase complexity here.
Three more general comments:
- We should remember to bump the version to 0.8 (or add it as the final commit in this PR once all tests, including Turing, pass)
- We should try to add support for Julia 1.6 in a follow-up PR since it's the LTS version and supported by CodeInfoTools and all downstream packages
- I think the extraction of the hardcoded
isa
statements in functions could be improved (in principle, it makes sense IMO): there is some code duplication and I think theVal
argument should be removed (instead one could use branches in a (single!) function forExpr
, possible calling other internal functions such as_expr_new
...).
I think it's not a good idea to support Julia v1.6 with the new compiler facilities, it will be a great cost, I took a glance at the CodeInfo in v1.6, it's much more complicated (I'm not sure if this word is precise). How about letting Libtask v0.7.x (an LTS version as well?) keep using |
I think it’s a massive technical burden to maintain two versions in parallel |
Yes, and in particular versions that are so different. E.g., in SpecialFunctions we backport all bug fixes to SpecialFunctions 1 to ensure that they also reach packages that have not updated their compat entry (since SpecialFunctions is such a core package and so many other packages depend on it), and that's easy since the breaking change in SpecialFunctions 2.0.0 was only the removal of the type piracy |
Is there a specific reason why it is difficult to support 1.6 but 1.8 works fine even though the CodeInfo is different from the one in 1.7 in both cases? In any case, I think it's fine to add support for 1.6 in a follow-up PR - but I also think it would be good to properly support, and hence also publish updates for, the LTS version. |
There is a major compiler refactoring between 1.6 and 1.7. The
The old |
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 think we should not even use Val
for the Expr
case. Unrelated of the Expr
case, I think it is more natural to pass ir
, taped
, and boxes
(not _box
) as arguments to a function instead of constructing a callable. It seems there are also some undefined variables, so it seems not all functions are tested?
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.
Thanks, @KDr2 - excellent work. I have some minor comments below, mostly about clarity.
In addition, the function names arg_boxer
and args_initializer
are a bit misleading. These two functions both refer to args
but mean different things. The former refers to args
for each instruction, while the latter refers to the args
to a TapedFunction
. Maybe we should make the distinction clearer.
I renamed |
4a0af2f
to
a95702e
Compare
Fix #117