Skip to content

POCL: cache the device's Float16 and Float64 support - #934

Merged
maleadt merged 1 commit into
mainfrom
tb/pocl-cache-fp-support
Oct 27, 2026
Merged

maleadt merged 1 commit into
mainfrom
tb/pocl-cache-fp-support

Conversation

@maleadt

@maleadt maleadt commented Oct 27, 2026

Copy link
Copy Markdown
Member

Every launch of a kernel with work-group collectives (@groupreduce etc.) asks the back-end whether it can shuffle Float16 and Float64 values, also for kernels on other types. On PoCL, supports_shuffle (and supports_float64) answered that by querying the device's extensions and splitting them into strings each time: about 2.2 µs and 9 KB per query.

This checks the extensions once, when creating the session, next to the other device limits that launches need.

Launching a 64-element Float64 @groupreduce on an M3 Pro goes from 9 µs and 18 KB to 3.1 µs and 64 bytes (the latency/pocl/parallel/launch/groupreduce-f64 benchmark). The remaining 64 bytes are from the dynamic dispatch on the sub-group capabilities in launch_kernel.

Every launch of a kernel with work-group collectives asks the back-end
whether it can shuffle Float16 and Float64 values, which queried the
device's extensions and split them into strings each time: about 2 µs and
9 KB per query, so two thirds of the time to launch a small reduction.
Check the extensions once, with the other limits cached in the session.
@maleadt maleadt added the pocl The PoCL-based CPU back-end. label Oct 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Benchmark results

Compared with d2ada37c6, the latest measured ancestor of the merge base (1 commit before it).
The environment differs from the baseline's: Parsers 3.0.1 → 3.0.2.

Times are the minimum time of every benchmark. A change is unusual when it exceeds both three times the benchmark's typical change between consecutive runs on the default branch and a minimum per category (performance 3%, latency 5%, applications 3%, other 3%). A benchmark that starts or stops allocating is listed however few the allocations. A single run can still be a fluke, so rerun before drawing conclusions.

Geometric mean Unusual: slower Unusual: faster Compared
Performance −0.7% 0 0 32
Latency −7.8% 0 0 13
Applications +5.7% 0 0 5

No unusual changes.

All benchmarks
Benchmark Baseline This PR Change
Performance
julia/serial/arithmetic/muladd-reference 655 µs 655 µs −0.0% noise unknown
julia/serial/math/exp-f64-reference 284 µs 284 µs −0.0% noise unknown
julia/serial/narrow/masked-reference 702 µs 700 µs −0.3% noise unknown
pocl/parallel/atomics/histogram 5.16 ms 5.15 ms −0.1% noise unknown
pocl/parallel/groupreduce/add-f64 1.66 ms 1.64 ms −1.3% noise unknown
pocl/parallel/groupreduce/fallback 18.1 ms 18.1 ms −0.1% noise unknown
pocl/parallel/groupscan/add-i32 2.53 ms 2.52 ms −0.5% noise unknown
pocl/parallel/indexing/cartesian3d 84.8 µs 79.3 µs −6.5% noise unknown
pocl/parallel/indexing/linear3d 84.4 µs 77.8 µs −7.8% noise unknown
pocl/parallel/indexing/ntuple3d 81.4 µs 80.1 µs −1.6% noise unknown
pocl/parallel/indexing/ntuple4d 164 µs 163 µs −0.6% noise unknown
pocl/parallel/localmem/transpose-naive 459 µs 454 µs −1.1% noise unknown
pocl/parallel/localmem/transpose-tiled 101 µs 104 µs +3.3% noise unknown
pocl/parallel/private/across-barrier 164 µs 167 µs +2.2% noise unknown
pocl/parallel/scheduling/default 181 µs 181 µs −0.0% noise unknown
pocl/parallel/scheduling/explicit 181 µs 181 µs −0.0% noise unknown
pocl/parallel/stream/copy/cache 6.06 µs 5.68 µs −6.3% noise unknown
pocl/parallel/stream/copy/dram 6.32 ms 6.55 ms +3.6% noise unknown
pocl/parallel/stream/triad/cache 6.90 µs 6.60 µs −4.4% noise unknown
pocl/parallel/stream/triad/dram 8.94 ms 9.56 ms +7.0% noise unknown
pocl/parallel/util/copyto-small 4.59 µs 4.60 µs +0.4% noise unknown
pocl/parallel/util/zeros-large 998 µs 1.01 ms +1.4% noise unknown
pocl/parallel/util/zeros-small 665 ns 633 ns −4.8% noise unknown
pocl/serial/arithmetic/contract 1.91 ms 1.91 ms −0.1% noise unknown
pocl/serial/arithmetic/muladd 759 µs 766 µs +1.0% noise unknown
pocl/serial/const/marked 728 µs 730 µs +0.3% noise unknown
pocl/serial/const/unmarked 915 µs 918 µs +0.4% noise unknown
pocl/serial/math/exp-f64 147 µs 146 µs −0.6% noise unknown
pocl/serial/math/sin-f64 202 µs 193 µs −4.4% noise unknown
pocl/serial/narrow/masked 854 µs 829 µs −2.9% noise unknown
pocl/serial/narrow/unmasked 765 µs 782 µs +2.3% noise unknown
pocl/serial/stream/triad/dram 8.63 ms 8.67 ms +0.4% noise unknown
Latency
host/import/ka 506 ms 503 ms −0.6% noise unknown
host/precompile/ka 44.9 s 44.8 s −0.2% noise unknown
host/startup 133 ms 131 ms −2.0% noise unknown
pocl/parallel/launch/dynamic-default 4.39 µs 4.39 µs +0.0% noise unknown
pocl/parallel/launch/groupreduce-f64 18.5 µs 6.72 µs −63.6% noise unknown
pocl/parallel/launch/many-args 12.0 µs 12.4 µs +2.8% noise unknown
pocl/parallel/launch/partial-workgroup 4.18 µs 4.03 µs −3.6% noise unknown
pocl/serial/compile/groupreduce 2.06 s 2.02 s −2.0% noise unknown
pocl/serial/compile/localmem-barrier 808 ms 805 ms −0.5% noise unknown
pocl/serial/compile/new-kernel 118 ms 118 ms −0.5% noise unknown
pocl/serial/compile/new-workgroupsize 13.6 ms 13.5 ms −0.5% noise unknown
pocl/serial/first-kernel/cold-cache 2.02 s 2.03 s +0.4% noise unknown
pocl/serial/first-kernel/warm-cache 360 ms 366 ms +1.8% noise unknown
Applications
pocl/parallel/dgsem/fluxdiff-node 291 µs 293 µs +0.7% noise unknown
pocl/parallel/dgsem/weak-element 160 µs 212 µs +32.9% noise unknown
pocl/parallel/dgsem/weak-node-localmem 118 µs 118 µs −0.1% noise unknown
pocl/parallel/stencil/timestep 7.91 ms 7.74 ms −2.1% noise unknown
pocl/serial/stencil/timestep 11.3 ms 11.3 ms +0.6% noise unknown

History: https://juliagpu.org/perf/?pkg=kernelabstractions

@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.18%. Comparing base (d2ada37) to head (13660f6).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #934      +/-   ##
==========================================
+ Coverage   82.87%   83.18%   +0.30%     
==========================================
  Files          31       31              
  Lines        2564     2569       +5     
==========================================
+ Hits         2125     2137      +12     
+ Misses        439      432       -7     

☔ 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 21b3454 into main Oct 27, 2026
69 checks passed
@maleadt
maleadt deleted the tb/pocl-cache-fp-support branch October 27, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pocl The PoCL-based CPU back-end.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant