Repository navigation
POCL: copy small arrays from the host in copyto! - #935
Conversation
Copying between two arrays always launched a kernel, which takes 2.5 µs for 64 elements that the host copies in 10 ns. Copy with a kernel only from the size at which `zeros` and `ones` fill with one (1 MiB), for the same reason: spreading the destination's pages over PoCL's threads. Overlapping arrays are copied from the host too, which handles the overlap, rather than throwing an error.
Benchmark resultsCompared with d2ada37c6, the latest measured ancestor of the merge base (1 commit before it). 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.
No unusual changes. All benchmarks
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #935 +/- ##
==========================================
+ Coverage 82.87% 83.27% +0.39%
==========================================
Files 31 31
Lines 2564 2565 +1
==========================================
+ Hits 2125 2136 +11
+ Misses 439 429 -10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
KI.copyto!between two arrays always launched a kernel, which takes 2.5 µs for 64Float32s that the host copies in 10 ns (theperformance/pocl/parallel/util/copyto-smallbenchmark).Like
zerosandonessince #927, this copies with a kernel only from 1 MiB, where it spreads the destination's pages over PoCL's threads (and their memory domains); smaller copies and copies of bits-union arrays useBase.copyto!. Overlapping arrays are copied from the host too, which handles the overlap, instead of throwing "Arrays may not alias".Measured on an M3 Pro only, where the host copy is faster at every size; the 1 MiB threshold is kept for the many-core and NUMA machines that #927 and #928 were about.