fix(rocprim): remove unused architectures at build time instead of creating empty kernel #13311
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 180 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.311
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #13311"
general
weight: 0.35
umfranzw
Motivation
Currently we make all but one kernel empty if we know at compile time time what the architecture is. To improve build time, instead of making them empty we are not making them at all.
JIRA ID : EXSWSTRHPC-338
Technical Details
We created the new scoring system for choosing the best config. This is done to put the logic in that one helper function, match_target, to ensure the same policy is used at runtime as at compile time.
We also moved the logic for emptying the kernel to the for_each function. This ensures that the kernels are not even created.
These changes should only change removing the empty kernels. This is good for reducing the amount of code in the assembly, but also could help with reducing the build time.
The generic arch and spirv logic that was in the trampoline before is no longer needed, since it will just give back an unknown arch with device_target_arch in that case it will build all kernels just as before.
Test Plan
Compile and runs some tests for spirv generic architectures and normal architectures.
Test Result
I have tested both build and runs with spirv and generic architectures, these did not change with the changes. With normal architectures it compiled faster and reduced the assembly quite massively.
Submission Checklist