POCL: cheaper host kernel launches #941
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 226 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.325
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #941"
general
weight: 0.35
vchuravy
The KernelInterface size-check optimization is in #938, which bumps KernelInterface to 0.4.4.
Reduce PoCL host-kernel launch overhead: return the session by reference, avoid 64-bit divisions in launch geometry, tune work-group sizes once, and sample short-launch timings. Unsplit launches on the calling thread call PoCL directly, avoiding launch materialization. Sharing argument generation and conversion between queue and host-kernel paths reduces first-launch compilation.
Inline launches (
icount.jl): median ns over 6 runs, #906 → this PR with #938 (Julia 1.12.7, ThreadTeams 1.3.0):| Workload | Xeon E3-1245 v6,
-t 1| Xeon E3-1245 v6,-t 4,0| Ryzen 9 5950X,-t 1| Ryzen 9 5950X,-t 16,0|| --- | ---: | ---: | ---: | ---: |
| 1 element | 155.8 → 112.4 | 156.1 → 112.8 | 100.4 → 72.2 | 96.1 → 72.5 |
| 64 elements | 175.0 → 115.2 | 220.8 → 136.4 | 101.7 → 74.3 | 116.6 → 80.8 |
| store 4356 | 402.8 → 354.9 | 450.1 → 374.5 | 250.9 → 226.1 | 268.6 → 248.1 |
| axpy 1e3 | 215.9 → 161.8 | 340.6 → 265.4 | 136.3 → 112.2 | 216.7 → 182.8 |
| 2-d 30² | 342.1 → 272.5 | 456.9 → 366.6 | 203.4 → 175.9 | 285.8 → 248.2 |
Trivial launch on the Xeon: 1706 → 1401 instructions, 633 → 459 cycles.
Without #938, a launch on the Xeon is ~31 instructions, ~24 cycles (4–6 ns) slower (e.g. trivial launch: 1432 instructions, 486 cycles, 119.4 ns).
First launches in a fresh process (Ryzen 9950X,
-t 4, median of 3, ms): inline 667 → 573, stencil 795 → 617, axpy 237 → 161. Subsequent new kernels are unchanged (65–70 ms each).Trade-off: after a sample below 1 µs, time one in 16 launches. Detecting longer work within a grid can lag by 16 launches; work varying with that period can evade sampling entirely. Always time grids with no estimate or a changed work-group count.