Earlier quoted context omitted.
I have quite limited experience with Cython and tried Numba just a couple of times, but I'm curious how much would it take to rewrite one of my Julia libraries to them. The library is for reverse-mode automatic differentiation, but let's put AD itself aside and talk about code generation. As an input to code generator, I have a computational graph (or "tape") - a list of functions connecting input and intermediate va…
> In Julia I follow the following steps: … does it fit with AST? I'm fairly certain the steps you've listed can be accomplished through AST manipulations, and would go something like def manip_ast(fn): import ast, inspect fn_ast = ast.parse(inspect.getsource(fn)) new_fn_ast = … return compile(new_fn_ast, …) def rewrite(fn): fn = manip_ast(fn) fn = numba.jit(fn) @rewrite def func(*args): … there's nothing in the langu…
I believe it's more complicated than most posters there realize, especially in the context of PyTorch (which uses a fork of autograd under the hood) with its dynamic graphs... Anyway, AD deserves its own discussion, that's I didn't want to concentrate on it.
> I'd be interested in a side by side comparison as well, and I was thinking that the main difficulty would be that I couldn't write good Julia code, but maybe we can pair up, if that'd be interesting, to address several common topics that come up (fusion, broadcasting, generics but specialization, etc).
Sounds good! Do you have a task at hand that would involve all the topics and could be implemented in limited time? Maybe some kind of Monte Carlo simulation or Gibbs sampling to get started?