Add size-based pairwise dispatch to all_to_all - #7430
Conversation
Signed-off-by: iemAnshuman <asquare567@gmail.com>
Signed-off-by: iemAnshuman <asquare567@gmail.com>
Signed-off-by: iemAnshuman <asquare567@gmail.com>
Signed-off-by: iemAnshuman <asquare567@gmail.com>
Signed-off-by: iemAnshuman <asquare567@gmail.com>
Signed-off-by: iemAnshuman <asquare567@gmail.com>
Signed-off-by: iemAnshuman <asquare567@gmail.com>
Signed-off-by: iemAnshuman <asquare567@gmail.com>
Signed-off-by: iemAnshuman <asquare567@gmail.com>
Signed-off-by: iemAnshuman <asquare567@gmail.com>
Signed-off-by: iemAnshuman <asquare567@gmail.com>
Signed-off-by: iemAnshuman <asquare567@gmail.com>
Signed-off-by: iemAnshuman <asquare567@gmail.com>
Signed-off-by: iemAnshuman <asquare567@gmail.com>
…nt only) Signed-off-by: iemAnshuman <asquare567@gmail.com>
Signed-off-by: iemAnshuman <asquare567@gmail.com>
Signed-off-by: iemAnshuman <asquare567@gmail.com>
Signed-off-by: iemAnshuman <asquare567@gmail.com>
Signed-off-by: iemAnshuman <asquare567@gmail.com>
Threshold selection for the 4 KiB defaultI evaluated each sampled global threshold over the 32 cells in the 16-node sweep: four locality counts and eight payload sizes. Cells below the threshold keep the fastest non-pairwise result and contribute 1.0x to the overall geometric mean. Cells at or above the threshold use the measured pairwise result. For each cell, the non-pairwise baseline is the fastest result among standard one-shot, standard reused, forced flat, and tree arities 2, 3, and 4.
The 1 KiB threshold has the highest aggregate geometric mean, but it introduces two regressions:
The 4 KiB threshold wins all 12 cells it selects and produces a 2.08x whole-matrix geometric mean, 3.2% below the maximum at 1 KiB. At the 4 KiB boundary, pairwise is 1.14x, 2.79x, 5.25x, and 13.82x faster at 16, 32, 64, and 128 localities, respectively. This makes 4096 bytes the smallest no-regression threshold in this sweep. The crossover can change with the transport and topology, so callers can override the default. Full measurements and methodology: 16-node pairwise |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
|
@iemAnshuman Why did you close this PR? Has it been superseded with #7431? |
Performance test reportHPX PerformanceComparison
Info
Comparison
Info
Comparison
Info
Explanation of Symbols
|
Proposed Changes
all_to_alloverloads.pairwise_threshold_arg, with a default of 4096 bytes, to select between routed and pairwise exchange.--pairwise_thresholdinbenchmark_collectives.Any background context you want to provide?
The basename-based implementation currently routes every contribution through one communicator site. This limits the number of messages sent by each site, but concentrates the exchange on one locality. The pairwise path sends each destination row directly to its peer. This removes the relay when the payload is large enough to offset the additional messages.
Pairwise exchange requires at least three sites and an explicit positive generation. Calls using the default generation remain on the routed path. Automatic dispatch uses
sizeof(T)for trivially copyable, fixed-size row types. Dynamically sized rows remain routed because local size checks could cause different sites to select different algorithms. Callers that know the rows are uniform can passpairwise_threshold_arg(0)at every site to request pairwise exchange.The channel communicator is cached by normalized basename and site count. Reusing it across generations avoids repeated AGAS registration and peer discovery, while generation tags keep exchanges separate. The implementation preserves the existing argument validation and supports
vector<bool>rows and rows that cannot be default-constructed or assigned.The 16-node Rostam/Buran campaign covered 16, 32, 64, and 128 localities, with payloads from 4 B through 64 KiB per destination. All 960 executions completed without retries or failures. A 4 KiB threshold was the smallest sampled threshold for which every selected pairwise result beat the fastest non-pairwise HPX result in the same campaign.
Full measurements: 16-node pairwise
all_to_allresultsVerification
benchmark_collectives.all_to_alltests.intelements.clang-format --dry-run --Werrorandgit diff --check.Checklist
Not all points below apply to all pull requests.