Enzyme respect GPUCompiler.optimization_params#2769
Open
Conversation
Contributor
|
Your PR requires formatting changes to meet the project's style guidelines. Click here to view the suggested changes.diff --git a/src/compiler.jl b/src/compiler.jl
index 05022a6d..74e4dd2c 100644
--- a/src/compiler.jl
+++ b/src/compiler.jl
@@ -185,8 +185,8 @@ if VERSION >= v"1.11.0-DEV.1552"
Interpreter.EnzymeInterpreter(
GPUCompiler.ci_cache_token(job),
GPUCompiler.method_table(job),
- GPUCompiler.inference_params(job),
- GPUCompiler.optimization_params(job),
+ GPUCompiler.inference_params(job),
+ GPUCompiler.optimization_params(job),
job.world,
job.config.params.mode,
true
@@ -213,8 +213,8 @@ else
Interpreter.EnzymeInterpreter(
enzyme_ci_cache(job),
GPUCompiler.method_table(job),
- GPUCompiler.inference_params(job),
- GPUCompiler.optimization_params(job),
+ GPUCompiler.inference_params(job),
+ GPUCompiler.optimization_params(job),
job.world,
job.config.params.mode,
true
diff --git a/src/compiler/interpreter.jl b/src/compiler/interpreter.jl
index a4dc6595..0c523656 100644
--- a/src/compiler/interpreter.jl
+++ b/src/compiler/interpreter.jl
@@ -124,8 +124,8 @@ function EnzymeInterpreter(
cache_or_token,
mt::Union{Nothing,Core.MethodTable},
world::UInt,
- inf_params::InferenceParams,
- opt_params::OptimizationParams,
+ inf_params::InferenceParams,
+ opt_params::OptimizationParams,
forward_rules::Bool,
reverse_rules::Bool,
inactive_rules::Bool,
@@ -173,11 +173,11 @@ function EnzymeInterpreter(
Base.empty!(cache_or_token)
end
end
- method_table = mt == nothing ? Core.Compiler.InternalMethodTable(world) : Core.Compiler.OverlayMethodTable(world, mt),
+ return method_table = mt == nothing ? Core.Compiler.InternalMethodTable(world) : Core.Compiler.OverlayMethodTable(world, mt),
return EnzymeInterpreter(
cache_or_token,
- method_table,
+ method_table,
# Initially empty cache
Vector{InferenceResult}(),
@@ -186,8 +186,8 @@ function EnzymeInterpreter(
world,
# parameters for inference and optimization
- inf_params,
- opt_params,
+ inf_params,
+ opt_params,
forward_rules::Bool,
reverse_rules::Bool,
inactive_rules::Bool, |
This file contains hidden or 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
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.
With @lcw we discovered that Enzyme ignores
GPUCompiler.optimization_paramsandGPUCompiler.inference_paramsthus stopping@cuda always_inline=trueto work on the GPU kernelsin Raven.