Skip to content

Conversation

@vchuravy
Copy link
Member

With @lcw we discovered that Enzyme ignores GPUCompiler.optimization_params and GPUCompiler.inference_params thus stopping @cuda always_inline=true to work on the GPU kernels
in Raven.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 11, 2025

Your PR requires formatting changes to meet the project's style guidelines.
Please consider running Runic (git runic main) to apply these changes.

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,

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.

2 participants