From 548f449332847eea247d179cbdc27d4fe6fb7644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= <765740+giordano@users.noreply.github.com> Date: Fri, 5 Sep 2025 11:08:00 +0200 Subject: [PATCH 1/4] Allow for mistmatch between native target and params for IPU Co-authored-by: Valentin Churavy --- src/compiler.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/compiler.jl b/src/compiler.jl index bab631053a..a481668a75 100644 --- a/src/compiler.jl +++ b/src/compiler.jl @@ -4292,7 +4292,10 @@ function GPUCompiler.compile_unhooked(output::Symbol, job::CompilerJob{<:EnzymeT primal_target = (job.config.target::EnzymeTarget).target primal_params = (job.config.params::EnzymeCompilerParams).params if primal_target isa GPUCompiler.NativeCompilerTarget - @assert primal_params isa PrimalCompilerParams + if !(primal_params isa PrimalCompilerParams#) + # XXX: This means mode is not propagated and rules are not applied for GPU code. + @safe_debug "NativeCompilerTarget without primal compiler params" primal_job + emd else # XXX: This means mode is not propagated and rules are not applied for GPU code. end From 90522d1030ecc63c6885fbf619678a55cbe31ffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= <765740+giordano@users.noreply.github.com> Date: Fri, 5 Sep 2025 11:22:14 +0200 Subject: [PATCH 2/4] Fix syntax error in GPUCompiler target check --- src/compiler.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler.jl b/src/compiler.jl index a481668a75..acb42ca608 100644 --- a/src/compiler.jl +++ b/src/compiler.jl @@ -4295,7 +4295,7 @@ function GPUCompiler.compile_unhooked(output::Symbol, job::CompilerJob{<:EnzymeT if !(primal_params isa PrimalCompilerParams#) # XXX: This means mode is not propagated and rules are not applied for GPU code. @safe_debug "NativeCompilerTarget without primal compiler params" primal_job - emd + end else # XXX: This means mode is not propagated and rules are not applied for GPU code. end From 3343c98ec31418949eb80b6871b6eb01bdba7dd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= <765740+giordano@users.noreply.github.com> Date: Fri, 5 Sep 2025 11:24:25 +0200 Subject: [PATCH 3/4] Fix typo in compiler.jl --- src/compiler.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler.jl b/src/compiler.jl index acb42ca608..ca4d376560 100644 --- a/src/compiler.jl +++ b/src/compiler.jl @@ -4292,7 +4292,7 @@ function GPUCompiler.compile_unhooked(output::Symbol, job::CompilerJob{<:EnzymeT primal_target = (job.config.target::EnzymeTarget).target primal_params = (job.config.params::EnzymeCompilerParams).params if primal_target isa GPUCompiler.NativeCompilerTarget - if !(primal_params isa PrimalCompilerParams#) + if !(primal_params isa PrimalCompilerParams) # XXX: This means mode is not propagated and rules are not applied for GPU code. @safe_debug "NativeCompilerTarget without primal compiler params" primal_job end From 71b8084b7af96b7aa6ad6207e00d287ea7e82a71 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Thu, 11 Sep 2025 14:41:36 +0200 Subject: [PATCH 4/4] Update src/compiler.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mosè Giordano <765740+giordano@users.noreply.github.com> --- src/compiler.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler.jl b/src/compiler.jl index ca4d376560..f97e3c89f1 100644 --- a/src/compiler.jl +++ b/src/compiler.jl @@ -4294,7 +4294,7 @@ function GPUCompiler.compile_unhooked(output::Symbol, job::CompilerJob{<:EnzymeT if primal_target isa GPUCompiler.NativeCompilerTarget if !(primal_params isa PrimalCompilerParams) # XXX: This means mode is not propagated and rules are not applied for GPU code. - @safe_debug "NativeCompilerTarget without primal compiler params" primal_job + @safe_debug "NativeCompilerTarget without primal compiler params" primal_params end else # XXX: This means mode is not propagated and rules are not applied for GPU code.