Closed tshort closed 1 year ago
@tshort I really like this idea - this was something I tried early on, but I didn't understand the static compilation process very well.
Re -- @vchuravy: is it possible that we can chat about fixing the OrcV2 linking questions in the next few weeks?
Re -- @tshort: if StaticCompiler
is using GPUCompiler anyways (and doesn't intercept the native execution engine somehow), then the plugin interface won't necessarily offer anything over Mixtape.
The biggest issue with Mixtape is that it uses AbstractInterpreter -- which has the problem that composition is not easy. So e.g. running Mixtape passes and then doing an AD pass is something which there's not really an idiom for. I'd really like to alleviate this issue in general (but I've been busy doing other research).
Nice, this is a great idea.
The main holdup this Mixtape support is getting it to work with Julia v1.8. I haven't gotten far on that.
@vchuravy the hold up is likely an ABI thing, as well as maybe a "move to the new OrcJIT" thing
@MasonProtter, with this one tweak from your Orc v2 PR, the StaticCompiler tests progress much better. Only nightly fails immediately.
Okay, that’s promising!
I wonder if this could work on Nightly now after the update to GPUCompiler 0.16? Or is GPUCompiler working merely a necessary but not sufficient condition for Mixtape.jl working?
I wonder if this could work on Nightly now after the update to GPUCompiler 0.16? Or is GPUCompiler working merely a necessary but not sufficient condition for Mixtape.jl working?
I'm hopeful, too. I gave it a quick try, but it needed more work than I had time for.
Here are some updates on Mixtape support. This branch is caught up to master, and tests pass. I used the AbstractInterpreter straight out of GPUCompiler with minor tweaks. That should make it easier to keep up with GPUCompiler, and if it works, we may want to upstream it at some point.
Some things that still need work:
examples/mixtape-statictools/mixtape-fun.jl
fails when manipulating the CodeInfo (here). I think the Mixtape support is ready to merge. But, note that it is experimental and hasn't been tested much. Any other comments prior to merging? @brenhinkeller or @MasonProtter?
Looks like tests are all passing!
Great that you got this working. I think most of the functionality here is already covered by the new @device_override
stuff, but I think this is probably useful to have if anyone needs to do more complex IR transformations than just method replacement.
Great that you got this working. I think most of the functionality here is already covered by the new
@device_override
stuff, but I think this is probably useful to have if anyone needs to do more complex IR transformations than just method replacement.
Yeah, overriding methods is sure easier.
It'd be nice to be able to change functionality when statically compiling. This PR includes code from Mixtape to do that.
In the bigger picture, there are different options to support this feature:
Pinging @femtomc for opinions...
Notes:
optimize!
(post-inference) part of Mixtape.generate_obj
.There are lot's of possibilities to use this with StaticTools. This PR includes an example where Strings are replaced by StaticStrings.