Skip to content

Avoid boxing compiler jobs during kernel resolution - #482

Merged
maleadt merged 1 commit into
mainfrom
tb/compiler-job-allocations
Sep 14, 2026
Merged

maleadt merged 1 commit into
mainfrom
tb/compiler-job-allocations

Conversation

@maleadt

@maleadt maleadt commented Sep 14, 2026

Copy link
Copy Markdown
Member

Kernel resolution constructs a CompilerJob immediately before passing it through an unspecialized compile_or_lookup boundary, which can force the job onto the heap. Allow specialization on the job's target and compiler-parameter types, and keep the method @noinline so its body is not duplicated into callers specialized per kernel. Kernel identity remains a field of the job, so this does not introduce per-kernel specialization or another cache.

Applies the approach from KernelAbstractions.jl#769.

On Julia 1.13 / GPUCompiler 2.5.2 with the Intel CPU OpenCL runtime, warm clfunction resolution dropped from 192 to 32 bytes per call. Kernel launch and all eight existing compilation-cache tests passed, including reflection and redefinition. Two kernels produced one compile_or_lookup specialization.

Specialize compile_or_lookup on the backend target and parameter types. Keep it out of line to avoid duplicating the body in callers specialized per kernel, while preserving the existing GPUCompiler cache path.
@codecov

codecov Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.43%. Comparing base (9d5a395) to head (4cd4c06).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #482   +/-   ##
=======================================
  Coverage   84.43%   84.43%           
=======================================
  Files          14       14           
  Lines        1086     1086           
=======================================
  Hits          917      917           
  Misses        169      169           

☔ 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 8372b1e into main Sep 14, 2026
15 checks passed
@maleadt
maleadt deleted the tb/compiler-job-allocations branch September 14, 2026 18:51
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