Skip to content

Use GPUCompiler's workaround for nested insertvalues - #646

Merged
maleadt merged 1 commit into
mainfrom
tb/gpucompiler-intel-driver
Sep 26, 2026
Merged

maleadt merged 1 commit into
mainfrom
tb/gpucompiler-intel-driver

Conversation

@maleadt

@maleadt maleadt commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

JuliaGPU/GPUCompiler.jl#953 moves the nested-insertvalue workaround from #548 into GPUCompiler. It is enabled with SPIRVCompilerTarget(; driver=:intel), so this PR passes that and drops our own copy of the pass. The #259 test stays.

The root cause is now known: IGC's TypesLegalizationPass silently drops the store of a field when an aggregate is built by nested insertvalues (intel/intel-graphics-compiler#378, JuliaGPU/OpenCL.jl#502). GPUCompiler runs the pass from within its SPIR-V finish_ir!, before the kernel state and byval rewrites, rather than after them as here.

Requires GPUCompiler 2.9, which includes JuliaGPU/GPUCompiler.jl#953.

GPUCompiler now flattens nested insertvalues when targeting Intel's driver, so
identify the driver and drop our copy of that pass.
@maleadt
maleadt force-pushed the tb/gpucompiler-intel-driver branch from 1737c7c to c339a3e Compare September 26, 2026 06:28
@maleadt
maleadt marked this pull request as ready for review September 26, 2026 06:29
@github-actions

Copy link
Copy Markdown
Contributor

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/compilation.jl b/src/compiler/compilation.jl
index 8f46310..4e6073c 100644
--- a/src/compiler/compilation.jl
+++ b/src/compiler/compilation.jl
@@ -309,8 +309,10 @@ end
     extensions_str = join(map(ext -> "+$ext", extensions), ",")
 
     # create GPUCompiler objects
-    target = SPIRVCompilerTarget(; backend, extensions = extensions_str, supports_fp16, supports_fp64, supports_bfloat16,
-                                   driver = :intel, kwargs...)
+    target = SPIRVCompilerTarget(;
+        backend, extensions = extensions_str, supports_fp16, supports_fp64, supports_bfloat16,
+        driver = :intel, kwargs...
+    )
     params = oneAPICompilerParams()
     CompilerConfig(target, params; kernel, name, always_inline)
 end

@codecov

codecov Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.61%. Comparing base (82be34e) to head (c339a3e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #646      +/-   ##
==========================================
- Coverage   80.79%   80.61%   -0.18%     
==========================================
  Files          55       55              
  Lines        4087     4034      -53     
==========================================
- Hits         3302     3252      -50     
+ Misses        785      782       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maleadt
maleadt merged commit 75237a5 into main Sep 26, 2026
6 checks passed
@maleadt
maleadt deleted the tb/gpucompiler-intel-driver branch September 26, 2026 13:05
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.

1 participant