[CIR][CUDA][offload-merge] Implement Launch Bound propagation #21
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 · 199 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.317
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #21"
general
weight: 0.35
RiverDave
In short, this infers the
__launch_bounds__the user never wrote, from the launches this TU actually records. Host <<<grid, block>>> and the device kernel live in the same cir.offload.container, so we can stamp cir.nvvm.maxntid on the NVPTX kernel.Same visibility as const-prop: the stub is internal, and every use outside its own body is a recorded launch. On top of that, every site has to have a fully constant block dim. If any site is opaque or runtime, we leave the kernel alone as under-shooting maxntid is a launch failure, not a slowdown. The number we write is the max of xyz across those sites, never the min. An existing bound (user __launch_bounds__) is only tightened, never widened.
consider:
Device, before:
Device after:
Note that initially this is CUDA only, launch bounds behave differently for HIP (the upper bounds). The analogous for the latter is apparently
amdgpu-flat-work-group-sizeif the attribute is not explicit by the user codegen assigns 1024. see:https://github.com/RiverDave/llvm-project/blob/323d3f82f82449e89687368c51ea0cdc65d05efe/clang/lib/CIR/CodeGen/Targets/AMDGPU.cpp#L84
Lastly, this is not wired end to end, I will defer that for another PR as I found some issues with ABI handling in https://github.com/RiverDave/llvm-project/pull/17 -- follow up PR on that soon.