-
Notifications
You must be signed in to change notification settings - Fork 82
Add world to EnzymeContext #2643
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
base: main
Are you sure you want to change the base?
Changes from all commits
e8c07ba
0246aed
577957e
03feb2e
ae19b09
ee6caad
108da13
b623edf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -475,6 +475,8 @@ function julia_error( | |
| ) #=error=# | ||
| world = enzyme_extract_world(f) | ||
| end | ||
| # TODO: get world from TypeAnalyzer | ||
| # @assert world == enzyme_gutils_context(gutils).world | ||
| throw(IllegalTypeAnalysisException(msg, mi, world, sval, ir, bt)) | ||
|
Comment on lines
+478
to
480
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @wsmoses would you be okay with a change where
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Depending on the particular error thrown there may not be a gutils created. But we can for sure audit all the current error types and see what we can do |
||
| elseif errtype == API.ET_NoType | ||
| @assert B != C_NULL | ||
|
|
@@ -550,6 +552,7 @@ function julia_error( | |
| illegal = false | ||
| created = LLVM.Instruction[] | ||
| world = enzyme_extract_world(LLVM.parent(position(IRBuilder(B)))) | ||
| @assert world == enzyme_context(gutils).world | ||
| width = get_width(gutils) | ||
| function make_batched(@nospecialize(cur::LLVM.Value), B::LLVM.IRBuilder)::LLVM.Value | ||
| if width == 1 | ||
|
|
@@ -944,7 +947,7 @@ end | |
| end | ||
| end | ||
|
|
||
| mi = nothing | ||
| mi = nothing | ||
| world = nothing | ||
|
|
||
| if isa(val, LLVM.Instruction) | ||
|
|
@@ -962,6 +965,10 @@ end | |
| ) #=error=# | ||
| world = enzyme_extract_world(f) | ||
| end | ||
| # TODO(vchuravy) | ||
| # what is data? | ||
| # Can we get world here? | ||
| # @assert world == enzyme_context(gutils).world | ||
| mode = Enzyme.API.DEM_ReverseModeCombined | ||
|
|
||
| if mi !== nothing | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should already be accessible everywhere gutils is available per enzyme_extract_world(fn) or something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is meant as a proof of concept to demonstrate that yes we can get the world we are compiling from everywhere.
Using a string attribute is fine, but is also a blocker for caching the IR for later use, so I wanted to see if we can use this to avoid adding ephemeral data to potentially cacheable inputs.