Skip to content
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

Remove EnzymeInterpreter and instead reuse GPUInterpreter #1893

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

vchuravy
Copy link
Member

With the stack of changes in JuliaGPU/GPUCompiler.jl#582 JuliaGPU/GPUCompiler.jl#633 and JuliaGPU/GPUCompiler.jl#634 we can hopefully address several issues.

The primary goal is to make nested AD work better, primarily 2nd order on the GPU and higher than 3rd oder on the CPU.

GPUCompiler and Enzyme make more and more advanced use of AbstractInterpreter and we need to make sure that modifications from apply to the other. So here I drop EnzymeInterpreter and make GPUInterpreter extensible enough that inline blocking, deferred codgen and autodiff -> autodiff_deferred work...

Eventually I would like to simplify autodiff_deferred such that it only works within a GPUCompiler context,
and that it looks something like

fptr = gpuc.deferred(EnzymeMeta(Reverse), f, primal_args...) # Codegen primal function
ccall("__autodiff", llvmcall, (Any...), adjoint_args)

And then we use the plugin interface in JuliaGPU/GPUCompiler.jl#633 to be more like the Clang plugin and transform
code within there instead of the current pipeline. This ought to simplify the current pipeline even more since it will
be focused on CPU codegen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant