-
Notifications
You must be signed in to change notification settings - Fork 52
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
[Experiment] Add deferred_with #599
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## vc/rework_deferred_codegen #599 +/- ##
==========================================================
Coverage 0.00% 0.00%
==========================================================
Files 24 24
Lines 3415 3423 +8
==========================================================
- Misses 3415 3423 +8 ☔ View full report in Codecov by Sentry. |
maleadt
force-pushed
the
vc/rework_deferred_codegen
branch
from
July 24, 2024 08:23
d2d7a73
to
e532812
Compare
vchuravy
force-pushed
the
vc/rework_deferred_codegen
branch
from
August 9, 2024 13:59
927fc30
to
b54b5e4
Compare
This was referenced Aug 26, 2024
vchuravy
force-pushed
the
vc/rework_deferred_codegen
branch
2 times, most recently
from
September 26, 2024 07:16
4f14a5e
to
a018c17
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently the pattern to embedd Enzyme into a GPU kernel looks something like this:
Internally this would create a job for Enzyme to later process using the deferred compilation
mechanism originally built for CUDA.jl
In #582 I am reworking this to embedd the necessary information into the IR,
instead of relying on a runtime dictionary inside GPUCompiler.
For deferred compilation ala CUDA.jl we have it relativly easy. We just need to process the discovered method-instance
and link it into the output module.
For the Enzyme use-case it becomes more tricky. We can't embed a CompilerJob since that captures a lot of superflous information,
yet we do need to capture enough information to construct an approprate CompilerJob.
Taking a note from JuliaLang/julia#52964 I propose that we add something like
@wsmoses essentially everything that the
NonGenABI
requires.And essentially rename
Enzyme.thunk
toGPUCompiler.var"gpuc.deferred.with"(EnzymeContext(#=...=#), f, args...)
(actually
lookup.with
) since that will have themi
. An issue might be ReverseModePrimal/ReverseModeGradient since thatreturns more than a single return value.
The question arises, why not just have
gpuc.deferred.with
and removegpuc.deferred
?I am not sure, how the worklist integration will look like, but I for me there is a symmetry to
invoke_within
andinvoke
in the Compiler plugins proposal. (I should probably call this
gpuc.deferred.within
xD )Opening this up so that I can unload my brain for now and have it percolate a bit.