Repository navigation
POCL: cache the device's Float16 and Float64 support - #934
Conversation
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.
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 #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. 🚀 New features to boost your workflow:
|
Every launch of a kernel with work-group collectives (
@groupreduceetc.) asks the back-end whether it can shuffleFloat16andFloat64values, also for kernels on other types. On PoCL,supports_shuffle(andsupports_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@groupreduceon an M3 Pro goes from 9 µs and 18 KB to 3.1 µs and 64 bytes (thelatency/pocl/parallel/launch/groupreduce-f64benchmark). The remaining 64 bytes are from the dynamic dispatch on the sub-group capabilities inlaunch_kernel.