effects: allow override of :nonoverlayed
effect bit (and rename it to :native_executable
)
#51080
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.
Certain external
AbstractInterpreters
, such as GPUCompiler.jl, havelong sought the ability to allow concrete evaluation for specific
overlay-ed methods to achieve optimal inference accuracy. This is
currently not permitted, although it should be safe when an overlay-ed
method has the same semantics as the original method, and its result can
be safely replaced with the result of the original method. Refer to
JuliaGPU/GPUCompiler.jl#384 for more examples.
To address this issue, this commit introduces the capability to override
the
:nonoverlayed
effect bit using@assume_effects
. With theenhancements in PR #51078, this override behaves similarly to other
effect bits.
However, it now seems awkward to annotate a method with
Base.@assume_effects :nonoverlayed
when it is actually marked with
@overlay
. Thus the second commitreplaces
:nonoverlayed
with (hopefully) more appropriate terminology,:native_executable
. This terminology is intended to indicate that themethod is concrete-evaluable. More specifically, it means that
(quoting from the new
Base.@assume_effects
docstring):Consequently, external
AbstractInterpreters
can utilizethis feature to permit concrete evaluation for annotated overlay-ed
methods, e.g.