[AffineIR] Check strided shard destinations without pairwise comparisons #9039
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.45) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 274 lines diff across 3 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.336
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #9039"
general
weight: 0.35
delock
Rebased on master (PRs #9010 and #9011 have merged; this branch is rebased on master at
5dc44e8, so the diff contains only this PR's changes).ParamAffineMap._validate_destinations(added in #8922) checks the box-shaped pieces of a column split by comparing every box of a rank with every other one.validate()runs whenever a ZeRO, AutoEP or block-gather map is built and before every conversion, and this pass has no budget, so validation grows quadratically with the number of strided pieces per rank.This PR sweeps the boxes with
boxes_disjointfrom #9011 first. Only a rank that fails the sweep takes the pairwise walk, which names the shared shard address, so error messages are unchanged.The second commit moves the remaining hand-written geometry onto
affine_geometry:_dest_boxreturns aLogicalBoxbuilt withcoordinate(), the shared address comes fromintersection()anddot(), andaddress_range()/overlaps_itself()move there fromaffine.py. The transfer executor reusesaddress_range()for its buffer-reach check anddot()for chunk offsets. No behavior or message changes.validate()of 8 ranks with interleaved columns (64 rows; ms, single CPU process):| pieces per rank | before | after |
|---|---|---|
| 128 | 29 | 4 |
| 512 | 441 | 17 |
| 2048 | 6654 | 68 |
Tests:
validate()refuses exactly the maps whose pieces write some shard address twice (enumerated independently in the test), and every refusal names an address that is written twice. The test checks this contract only, so it does not depend on which helper does the sweep.tests/unit/checkpoint/test_affinefiles: 839 passed, 1 skipped on 4× NVIDIA L20 at f6e1f6c. At ac3a329 on CPU (DS_ACCELERATOR=cpu, 4 ranks): 842 passed, 5 skipped.AI assistance
Implementation, tests and this description were drafted with GitHub Copilot CLI and reviewed/validated by the author.