Tapir's Internal Design - Novice Questions #136
-
Hi. I've been trying to read the Tapir source since it is a successful case study on using non-standard code generation in Julia. I'm hoping the code can help provide some instruction for a future non-AD project I have in mind. I'm a novice for anything related to Julia compiler plugins, so unfortunately the code is a bit opaque for my head. A couple of questions.
Amazing work and good luck with future progress! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Glad to hear that someone has been looking through the internals! To answer your questions:
The Enzyme + Diffractor do indeed take a similar approach. The point is that all three packages have a slightly different set of primitives at any given point in time (i.e. a different set of hand-written rules), so they need to choose different things to not inline. We could probably abstract this out at some point.
This is a little bit complicated. Morally speaking, I'm working with However, in practice, I'm actually making use of a parallel data structure called I'm not using something like The way that I produce code which can actually run is by converting this At a high-level, we derive
There's only a very weak connection --
Alas, I do not yet. This is very high up my todo list!
Thanks :) I hope you find it helpful! |
Beta Was this translation helpful? Give feedback.
Glad to hear that someone has been looking through the internals! To answer your questions:
The
TapirInterpreter
is really only made use of inlookup_ir
. The point is that its inlining policy prevents things that I don't want to be inlined from getting inlined (things for which I have hand-written rules).Enzyme + Diffractor do indeed take a similar approach. The point is that all three packages have a slightly different set of primitives at any given point in time (i.e.…