fix(basic_statistics): skip GPU block-merge writes to unallocated results #4092
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.42) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 325 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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.346
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #4092"
general
weight: 0.35
napetrov
Description
On GPU, a dense basic statistics compute with only
meanand/orvariancerequested writes through a null pointer once the input has 5000+ rows, and the device is lost.At that size the rows are split into blocks and combined by
merge_blocks_kernel, which wrotersumandrsum2centfor any mean or variance request. Outside SPMD those arrays are allocated only whensum/sum_squares_centeredare requested (local_result::empty), so the kernel wrote to address 0. The SPMD allocation conditions already covered these writes.User-visible impact: scikit-learn-intelex
KMeans.fiton GPU computes its tolerance withresult_options="variance", so every GPU fit with the defaulttoland 5000+ rows crashed the process or lost the device. After a device loss, later GPU calls in the same process fail too.Changes:
local_result::emptyuses to allocate. Behaviour is unchanged in SPMD mode and for any request that includessum/sum_squares_centered.mean | variancecase in the dense batch test. It was commented out as "fails for large datasets"; that failure was this crash.Testing on an Intel GPU:
//cpp/oneapi/dal/algo/basic_statistics:test_batch_dpcaborts without the kernel change (Segmentation fault from GPU at 0x0 ... access: 1 (Write)) and passes with it.//cpp/oneapi/dal/algo/basic_statistics:test_online_dpcpasses.No performance change expected: the change removes stores to buffers that are never read.
---
<details>
<summary>Checklist:</summary>
Completeness and readability
Testing
Performance
</details>
🤖 Generated with Claude Code