← Back to Pull requests

POCL: cheaper host kernel launches #941

Closed
unknown closed this pull request without merging on Nov 08, 2026 15:46 UTC
View on GitHub
unknown unknown commented on Oct 28, 2026 08:36 UTC
Author

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.

Diff: 226 lines (+169 / -57) across 2 files Reviewer: vchuravy Review duration: 16269m
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
0.37
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 36.9% (MEDIUM) · Higher = larger blast radius
36.9%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 14.6% · Safe to merge
14.6%