Skip to content

Port isbits support to CPU backend - #943

Open
christiangnrd wants to merge 2 commits into
mainfrom
isbits
Open

christiangnrd wants to merge 2 commits into
mainfrom
isbits

Conversation

@christiangnrd

Copy link
Copy Markdown
Member

Does this need tests or are the GPUArrays tests (that don't run here) sufficient?

christiangnrd and others added 2 commits October 31, 2026 14:14
Port of JuliaGPU/OpenCL.jl#583: elements are strided by `Base.aligned_sizeof`, and only
isbits unions keep their selector bytes past the data (a struct with a union field carries
its selector inline). Arrays passed to kernels locate their selector bytes from the
`Array`'s memory, which can be longer than the array or start before it. Requires
SPIRVIntrinsics 1.5.1, which sizes local memory of unions correctly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@christiangnrd
christiangnrd requested a review from maleadt October 31, 2026 17:30
@github-actions

Copy link
Copy Markdown
Contributor

Benchmark results

Compared with 7d2ea0f46, the merge base.
The environment differs from the baseline's: JSON 1.13.0 → 1.13.4, Parsers 3.0.3 → 3.0.5, SPIRVIntrinsics 1.5.1 → 1.6.0, StructUtils 2.11.2 → 2.12.0, StructUtilsStaticArraysCoreExt 2.11.2 → 2.12.0.

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.1% 0 0 32
Latency +0.1% 0 0 13
Applications +1.6% 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 290 µs 284 µs −1.9% noise unknown
julia/serial/narrow/masked-reference 711 µs 700 µs −1.5% noise unknown
pocl/parallel/atomics/histogram 5.16 ms 5.15 ms −0.2% noise unknown
pocl/parallel/groupreduce/add-f64 1.66 ms 1.65 ms −0.3% noise unknown
pocl/parallel/groupreduce/fallback 18.1 ms 18.1 ms −0.0% noise unknown
pocl/parallel/groupscan/add-i32 2.53 ms 2.52 ms −0.5% noise unknown
pocl/parallel/indexing/cartesian3d 77.8 µs 80.4 µs +3.4% noise unknown
pocl/parallel/indexing/linear3d 78.4 µs 81.3 µs +3.7% noise unknown
pocl/parallel/indexing/ntuple3d 79.5 µs 77.4 µs −2.6% noise unknown
pocl/parallel/indexing/ntuple4d 165 µs 163 µs −1.2% noise unknown
pocl/parallel/localmem/transpose-naive 457 µs 460 µs +0.6% noise unknown
pocl/parallel/localmem/transpose-tiled 104 µs 105 µs +1.1% noise unknown
pocl/parallel/private/across-barrier 165 µs 161 µs −2.4% noise unknown
pocl/parallel/scheduling/default 182 µs 181 µs −0.2% noise unknown
pocl/parallel/scheduling/explicit 181 µs 181 µs −0.3% noise unknown
pocl/parallel/stream/copy/cache 784 ns 684 ns −12.8% noise unknown
pocl/parallel/stream/copy/dram 6.25 ms 6.52 ms +4.2% noise unknown
pocl/parallel/stream/triad/cache 7.54 µs 7.32 µs −2.9% noise unknown
pocl/parallel/stream/triad/dram 8.73 ms 9.35 ms +7.2% noise unknown
pocl/parallel/util/copyto-small 24.0 ns 26.0 ns +8.3% noise unknown
pocl/parallel/util/zeros-large 999 µs 1.02 ms +1.7% noise unknown
pocl/parallel/util/zeros-small 632 ns 629 ns −0.5% noise unknown
pocl/serial/arithmetic/contract 1.91 ms 1.91 ms −0.2% noise unknown
pocl/serial/arithmetic/muladd 765 µs 761 µs −0.5% noise unknown
pocl/serial/const/marked 727 µs 718 µs −1.2% noise unknown
pocl/serial/const/unmarked 914 µs 923 µs +1.0% noise unknown
pocl/serial/math/exp-f64 146 µs 147 µs +0.6% noise unknown
pocl/serial/math/sin-f64 191 µs 195 µs +2.1% noise unknown
pocl/serial/narrow/masked 815 µs 831 µs +2.0% noise unknown
pocl/serial/narrow/unmasked 788 µs 777 µs −1.5% noise unknown
pocl/serial/stream/triad/dram 8.61 ms 8.66 ms +0.6% noise unknown
Latency
host/import/ka 509 ms 502 ms −1.3% noise unknown
host/precompile/ka 44.8 s 44.7 s −0.3% noise unknown
host/startup 131 ms 131 ms −0.1% noise unknown
pocl/parallel/launch/dynamic-default 4.36 µs 4.34 µs −0.3% noise unknown
pocl/parallel/launch/groupreduce-f64 6.59 µs 6.60 µs +0.2% noise unknown
pocl/parallel/launch/many-args 12.1 µs 12.1 µs −0.1% noise unknown
pocl/parallel/launch/partial-workgroup 4.25 µs 4.26 µs +0.4% noise unknown
pocl/serial/compile/groupreduce 1.86 s 1.89 s +1.4% noise unknown
pocl/serial/compile/localmem-barrier 718 ms 710 ms −1.0% noise unknown
pocl/serial/compile/new-kernel 109 ms 110 ms +0.4% noise unknown
pocl/serial/compile/new-workgroupsize 13.6 ms 13.8 ms +1.4% noise unknown
pocl/serial/first-kernel/cold-cache 2.05 s 2.06 s +0.5% noise unknown
pocl/serial/first-kernel/warm-cache 386 ms 385 ms −0.4% noise unknown
Applications
pocl/parallel/dgsem/fluxdiff-node 295 µs 291 µs −1.2% noise unknown
pocl/parallel/dgsem/weak-element 160 µs 159 µs −0.5% noise unknown
pocl/parallel/dgsem/weak-node-localmem 119 µs 117 µs −1.4% noise unknown
pocl/parallel/stencil/timestep 7.65 ms 8.75 ms +14.3% noise unknown
pocl/serial/stencil/timestep 11.5 ms 11.2 ms −2.2% noise unknown

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

@christiangnrd
christiangnrd added this pull request to stack #945 October 31, 2026 17:56
@codecov

codecov Bot commented Nov 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.85%. Comparing base (7d2ea0f) to head (81aca7d).

Files with missing lines Patch % Lines
src/pocl/pocl.jl 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #943      +/-   ##
==========================================
+ Coverage   83.17%   83.85%   +0.68%     
==========================================
  Files          31       31              
  Lines        2567     2533      -34     
==========================================
- Hits         2135     2124      -11     
+ Misses        432      409      -23     

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

This branch has not been deployed

No deployments
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