Skip to content

Cache the kernel lookup of zefunction with GPUCompiler's cached_lookup - #743

Merged
maleadt merged 1 commit into
mainfrom
tb/cached-lookup
Oct 26, 2026
Merged

maleadt merged 1 commit into
mainfrom
tb/cached-lookup

Conversation

@maleadt

@maleadt maleadt commented Oct 26, 2026

Copy link
Copy Markdown
Member

Every launch takes a global lock, builds the compiler configuration and job and queries GPUCompiler's cache. This wraps that lookup in GPUCompiler.cached_lookup (JuliaGPU/GPUCompiler.jl#1061), keyed on the context, the device and the compiler options.

Arc A770, Julia 1.12:

before after
zefunction (hit) 210 ns, 3437 insns 29 ns, 390 insns
@oneapi 1.73 µs, 13264 insns 1.47 µs, 10220 insns
KernelAbstractions launch 2.08 µs, 18279 insns 1.84 µs, 15167 insns

…okup`

Every launch took a global lock, built the compiler configuration and job and
queried GPUCompiler's cache. Wrap that in `GPUCompiler.cached_lookup`, keyed on
the context, the device and the compiler options. A hit goes from 3437 to 390
instructions, and `@oneapi` from 1.73 to 1.47 µs on an Arc A770.
@maleadt maleadt added the performance Runtime performance. label Oct 26, 2026
@maleadt
maleadt merged commit 446f8ac into main Oct 26, 2026
5 of 6 checks passed
@maleadt
maleadt deleted the tb/cached-lookup branch October 26, 2026 12:48
@codecov

codecov Bot commented Oct 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.64%. Comparing base (3a02a1f) to head (714140b).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #743      +/-   ##
==========================================
- Coverage   87.17%   86.64%   -0.53%     
==========================================
  Files          56       55       -1     
  Lines        5131     4995     -136     
==========================================
- Hits         4473     4328     -145     
- Misses        658      667       +9     

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Runtime performance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant