Repository navigation
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4986
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 46248df with merge base cff77b4 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@claude review |
|
Claude finished @lisjin's task in 2m 10s —— View job Review: Accelerate coupled pruning for sharded DTensors
Overall this is a clean, well-scoped optimization. The eligibility gate is conservative. It only uses global metadata (shapes, placements, mesh), so every participant reaches the same decision and no rank can hang waiting on a collective the others skipped. Non-participants return early in 1. Replica groups could pick different channels on NCCL (medium)
The docstring says "selection is consistent within a mesh." Within one shard group that holds, because ring and tree all-reduce give every member the same bits. On a 2-D mesh, though, each replica group (each row of Suggested fix: gather the reader partials instead of all-reducing them, then sum them locally in a fixed order. The partials are only 2. The fast path skips
|
Stack from ghstack (oldest at bottom):
Avoid materializing full coupled clusters for eligible two-dimensional Dim0/Dim1 Shard(0) layouts. Aggregate reader score partials, gather writer blocks, mask shards locally, and batch literal-zero counts using at most three mesh-scoped collectives; retain the materializing reference for unsupported layouts. This PR depends on the preceding coupled-pruning core PR and is adapted from qpat ebc76a1 (#57).
Verify real multi-rank fast/reference parity, reader-only and writer-only clusters, uneven and reshaped fallbacks, both replicated/sharded mesh-axis orders, replica accounting, subset meshes, and tied-score rank agreement. This completes the original feature set without changing the final tree; CPU Gloo correctness is not a NCCL/FSDP2 performance benchmark.
Test Plan:
source /home/lvj/.ao/bin/activate OMP_NUM_THREADS=1 python -m pytest /home/lvj/ao/test/prototype/pat -q181 passed, 160 subtests passed, including all eight real multi-rank tests. Ruff F/I and formatting checks, git diff --check, and read-only split-boundary review passed. The final tree exactly matches the saved original four-PR tip.