Skip to content

Benchmarks: run parallel mode with a Julia thread per worker - #942

Merged
maleadt merged 1 commit into
mainfrom
tb/bench-julia-threads
Oct 28, 2026
Merged

maleadt merged 1 commit into
mainfrom
tb/bench-julia-threads

Conversation

@maleadt

@maleadt maleadt commented Oct 28, 2026

Copy link
Copy Markdown
Member

The benchmark harness runs every process with one Julia thread, and only sets PoCL's worker count per mode. A backend that runs work-groups on Julia's threads therefore runs the parallel benchmarks on one thread. That is why #906's benchmark comment shows 3–8× slowdowns: the CI machine has 8 cores, and main used 8 PoCL workers.

This gives each process as many Julia threads as it has workers, with no interactive thread (JULIA_NUM_THREADS="$threads,0"). Serial and latency processes still get one thread, as before.

Minimum times on a 9950X (8 cores via taskset, JULIA_KA_CPU_THREADS=8):

main -t1 main -t8,0 #906 -t1 #906 -t8,0
groupreduce/add-f64 642 µs 656 µs 5.07 ms 666 µs
groupscan/add-i32 1.18 ms 811 µs 6.13 ms 795 µs
indexing/ntuple4d 134 µs 119 µs 653 µs 84 µs
transpose-naive 370 µs 338 µs 2.55 ms 331 µs
private/across-barrier 78 µs 53 µs 373 µs 51 µs
scheduling/default 112 µs 110 µs 404 µs 53 µs

Main also changes with the extra threads (groupscan and across-barrier get faster), so this should merge before #906 is compared again.

Every benchmark process ran with one Julia thread, and only PoCL's worker count followed
the mode. A backend that runs work-groups on Julia's threads, as in #906, then ran the
parallel benchmarks on one thread, against main's 8 PoCL workers on the benchmark machine.
Give each process as many Julia threads as it has workers (and no interactive thread);
serial and latency processes keep one.

[only benchmarks]
@github-actions

Copy link
Copy Markdown
Contributor

Benchmark results

Compared with 14002d752, the merge base.
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 −1.1% 0 0 13
Applications −14.3% 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 383 µs 291 µs −23.9% noise unknown
julia/serial/narrow/masked-reference 678 µs 702 µs +3.6% noise unknown
pocl/parallel/atomics/histogram 5.14 ms 5.13 ms −0.2% noise unknown
pocl/parallel/groupreduce/add-f64 1.65 ms 1.65 ms −0.1% noise unknown
pocl/parallel/groupreduce/fallback 18.1 ms 18.9 ms +4.0% noise unknown
pocl/parallel/groupscan/add-i32 2.53 ms 2.52 ms −0.1% noise unknown
pocl/parallel/indexing/cartesian3d 84.3 µs 80.5 µs −4.5% noise unknown
pocl/parallel/indexing/linear3d 80.8 µs 77.9 µs −3.5% noise unknown
pocl/parallel/indexing/ntuple3d 84.2 µs 80.4 µs −4.5% noise unknown
pocl/parallel/indexing/ntuple4d 161 µs 164 µs +1.6% noise unknown
pocl/parallel/localmem/transpose-naive 456 µs 460 µs +0.9% noise unknown
pocl/parallel/localmem/transpose-tiled 108 µs 105 µs −2.7% noise unknown
pocl/parallel/private/across-barrier 165 µs 164 µs −0.2% noise unknown
pocl/parallel/scheduling/default 182 µs 182 µs +0.1% noise unknown
pocl/parallel/scheduling/explicit 182 µs 182 µs −0.0% noise unknown
pocl/parallel/stream/copy/cache 682 ns 688 ns +0.9% noise unknown
pocl/parallel/stream/copy/dram 6.00 ms 6.32 ms +5.4% noise unknown
pocl/parallel/stream/triad/cache 6.99 µs 7.19 µs +2.9% noise unknown
pocl/parallel/stream/triad/dram 9.37 ms 9.31 ms −0.5% noise unknown
pocl/parallel/util/copyto-small 23.0 ns 26.0 ns +13.0% noise unknown
pocl/parallel/util/zeros-large 999 µs 1.00 ms +0.2% noise unknown
pocl/parallel/util/zeros-small 606 ns 626 ns +3.3% noise unknown
pocl/serial/arithmetic/contract 1.90 ms 1.91 ms +0.5% noise unknown
pocl/serial/arithmetic/muladd 768 µs 770 µs +0.2% noise unknown
pocl/serial/const/marked 732 µs 712 µs −2.7% noise unknown
pocl/serial/const/unmarked 914 µs 924 µs +1.1% noise unknown
pocl/serial/math/exp-f64 138 µs 138 µs −0.0% noise unknown
pocl/serial/math/sin-f64 190 µs 192 µs +1.0% noise unknown
pocl/serial/narrow/masked 828 µs 846 µs +2.2% noise unknown
pocl/serial/narrow/unmasked 812 µs 825 µs +1.6% noise unknown
pocl/serial/stream/triad/dram 8.59 ms 8.66 ms +0.8% noise unknown
Latency
host/import/ka 504 ms 510 ms +1.1% noise unknown
host/precompile/ka 44.7 s 44.9 s +0.5% noise unknown
host/startup 131 ms 129 ms −1.1% noise unknown
pocl/parallel/launch/dynamic-default 4.53 µs 4.41 µs −2.6% noise unknown
pocl/parallel/launch/groupreduce-f64 6.72 µs 6.70 µs −0.3% noise unknown
pocl/parallel/launch/many-args 12.7 µs 11.1 µs −12.9% noise unknown
pocl/parallel/launch/partial-workgroup 4.22 µs 4.13 µs −2.1% noise unknown
pocl/serial/compile/groupreduce 1.85 s 1.87 s +0.7% noise unknown
pocl/serial/compile/localmem-barrier 720 ms 724 ms +0.7% noise unknown
pocl/serial/compile/new-kernel 109 ms 111 ms +1.4% noise unknown
pocl/serial/compile/new-workgroupsize 13.7 ms 13.9 ms +1.2% noise unknown
pocl/serial/first-kernel/cold-cache 2.05 s 2.06 s +0.4% noise unknown
pocl/serial/first-kernel/warm-cache 386 ms 385 ms −0.2% noise unknown
Applications
pocl/parallel/dgsem/fluxdiff-node 447 µs 287 µs −35.9% noise unknown
pocl/parallel/dgsem/weak-element 212 µs 159 µs −24.9% noise unknown
pocl/parallel/dgsem/weak-node-localmem 147 µs 146 µs −0.8% noise unknown
pocl/parallel/stencil/timestep 7.91 ms 7.78 ms −1.6% noise unknown
pocl/serial/stencil/timestep 11.4 ms 11.2 ms −1.6% noise unknown

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

@codecov

codecov Bot commented Oct 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.46%. Comparing base (14002d7) to head (d663fa1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #942      +/-   ##
==========================================
- Coverage   83.17%   82.46%   -0.72%     
==========================================
  Files          31       31              
  Lines        2567     2520      -47     
==========================================
- Hits         2135     2078      -57     
- Misses        432      442      +10     

☔ 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 7d2ea0f into main Oct 28, 2026
19 of 20 checks passed
@maleadt
maleadt deleted the tb/bench-julia-threads branch October 28, 2026 13:32
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