Skip to content

Hash compiler configuration kwargs without boxing them - #699

Merged
maleadt merged 1 commit into
mainfrom
tb/compiler-config-hash
Oct 15, 2026
Merged

maleadt merged 1 commit into
mainfrom
tb/compiler-config-hash

Conversation

@maleadt

@maleadt maleadt commented Oct 15, 2026

Copy link
Copy Markdown
Member

compiler_config runs on every zefunction call, so on every launch of a KernelAbstractions kernel, which passes name, always_inline and sub_group_size. Hashing them as a Base.Pairs boxes each value. Hashing the NamedTuple (values(kwargs)) is fully typed, and its hash includes the field names, so distinct settings still get distinct configurations.

Measured on an Iris Xe (Julia 1.12), calling compiler_config through a kwargs-forwarding function like zefunction_link:

before after
KernelInterface launch kwargs (name, always_inline, sub_group_size) 237 ns, 4 allocations 85 ns, 0 allocations
plain @oneapi (no kwargs) 66 ns, 0 allocations 63 ns, 0 allocations
@oneapi name="foo" 87 ns, 0 allocations 77 ns, 0 allocations

Same as JuliaGPU/CUDA.jl#3400.

compiler_config runs on every zefunction call, so on every launch of a
KernelAbstractions kernel, which passes name, always_inline and
sub_group_size. Hashing them as a Base.Pairs boxes each value. Hash the
NamedTuple instead, which is fully typed and whose hash includes the
field names, so distinct settings still get distinct configurations.

With the kwargs of a KernelInterface launch, compiler_config goes from
237 ns and 4 allocations to 85 ns and none (Iris Xe, Julia 1.12).
@maleadt
maleadt merged commit f644589 into main Oct 15, 2026
3 of 5 checks passed
@maleadt
maleadt deleted the tb/compiler-config-hash branch October 15, 2026 20:50
@codecov

codecov Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.63%. Comparing base (94aa6f2) to head (17d34b2).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #699      +/-   ##
==========================================
- Coverage   81.32%   80.63%   -0.70%     
==========================================
  Files          52       51       -1     
  Lines        4092     3971     -121     
==========================================
- Hits         3328     3202     -126     
- Misses        764      769       +5     

☔ 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant