Skip to content

Commit e923e24

Browse files
authored
removing secondary reordering (#314)
1 parent e21806e commit e923e24

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/client/Presets/PodAllToAll.hpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,16 @@ int PodAllToAllPreset(EnvVars& ev,
154154
return ERR_FATAL;
155155
}
156156
int groupSize = n / numGroups;
157-
std::vector<MemDevice> devices(n);
158157
std::vector<int> indices(n);
159158
for (int k = 0; k < n; k++) indices[k] = k;
160159
Utils::StrideGenerate(indices, groupStride);
161-
int idx = 0;
162-
for (int rank : ranks) {
163-
for (int devIdx = 0; devIdx < numGpus; devIdx++) {
164-
devices[indices[idx++]] = {memType, devIdx, rank};
165-
}
160+
161+
std::vector<MemDevice> devices(n);
162+
for (int i = 0; i < n; i++) {
163+
int const globalIdx = indices[i];
164+
int const rankIdx = globalIdx / numGpus;
165+
int const devIdx = globalIdx % numGpus;
166+
devices[i] = {memType, devIdx, ranks[rankIdx]};
166167
}
167168

168169
// Build transfers for every group, then run once per pod so all groups share the same

0 commit comments

Comments
 (0)