From 90da87742c7fdcf1bd65763aee04e1f9a38fc6e0 Mon Sep 17 00:00:00 2001 From: Olli Saarikivi Date: Wed, 29 Sep 2021 16:05:35 -0700 Subject: [PATCH] Bring back old scratch sorting as default --- sccl/ncclize.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sccl/ncclize.py b/sccl/ncclize.py index 3bf2dd7..f1016ad 100644 --- a/sccl/ncclize.py +++ b/sccl/ncclize.py @@ -336,6 +336,10 @@ def allocate_scratch(gpu, addr): _remap_scratch_into_input_output(liveness, gpus, logging) elif greedy_scratch_sorting: _greedy_scratch_sort(algorithm, gpus) + else: + # Sort scratch mappings in an attempt to make more of them contiguous (this is of course a heuristic). + for gpu in gpus.values(): + gpu.scratch = { addr: idx for idx, addr in enumerate(sorted(gpu.scratch)) } # Add any copies from input to output that weren't already added for rank, gpu in gpus.items():