Skip to content

Commit 27eefd9

Browse files
nlutsenkometa-codesync[bot]
authored andcommitted
clang-format | Format fbsource with clang-format 21.
Reviewed By: ChristianK275 Differential Revision: D85317706 fbshipit-source-id: b399c5c4b75252999442b7d7d2778e7a241b0025
1 parent 9175a36 commit 27eefd9

File tree

122 files changed

+1010
-823
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+1010
-823
lines changed

comms/ctran/CtranExImpl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ class CtranExRequestImpl {
9696
std::shared_ptr<AsyncError> asyncErr{nullptr};
9797

9898
public:
99-
CtranExRequestImpl(){};
100-
~CtranExRequestImpl(){};
99+
CtranExRequestImpl() {};
100+
~CtranExRequestImpl() {};
101101

102102
// Internal initialization to avoid exposing dependencies in CtranEx.h.
103103
// Initialized for CtranEx transport APIs.

comms/ctran/algos/AllGatherP/AlgoImpl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ class AlgoImpl {
1212
PersistArgs pArgs;
1313

1414
AlgoImpl(CtranComm* comm, cudaStream_t stream)
15-
: comm_(comm), stream_(stream){};
16-
~AlgoImpl(){};
15+
: comm_(comm), stream_(stream) {};
16+
~AlgoImpl() {};
1717

1818
commResult_t initialize();
1919
commResult_t destroy();

comms/ctran/algos/AllReduce/AllReduceNetTypes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ struct RecvResources {
6767
};
6868

6969
struct AllReducePeer {
70-
struct AllReduceConnector send {};
71-
struct AllReduceConnector recv {};
70+
struct AllReduceConnector send{};
71+
struct AllReduceConnector recv{};
7272
int rank;
7373
int refCount;
7474
struct ctran::algos::topo::CtranRing ring;

comms/ctran/algos/AllReduce/AllReduceRing.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -765,8 +765,9 @@ commResult_t ctranAllReduceRing(
765765

766766
int numBlocks = 0;
767767
int numThreads = 0;
768-
FB_COMMCHECK(ctran::allreduce::ring::getNumBlocksAndThreads(
769-
&numBlocks, &numThreads, func));
768+
FB_COMMCHECK(
769+
ctran::allreduce::ring::getNumBlocksAndThreads(
770+
&numBlocks, &numThreads, func));
770771

771772
FB_COMMCHECK(comm->ctran_->algo->initTmpBufs());
772773

comms/ctran/algos/AllToAll/AllToAll.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,9 @@ commResult_t ctranAllToAll(
119119
stream,
120120
allToAllAlgoName(myAlgo),
121121
opCount);
122-
FB_COMMCHECK(ctran::alltoall::setupKernelConfig(
123-
sendbuff, recvbuff, count, datatype, comm, stream, config));
122+
FB_COMMCHECK(
123+
ctran::alltoall::setupKernelConfig(
124+
sendbuff, recvbuff, count, datatype, comm, stream, config));
124125

125126
// prepare operation for IB path
126127
std::vector<std::unique_ptr<struct OpElem>> opGroup;

comms/ctran/algos/AllToAll/AllToAllDedup.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,9 @@ commResult_t ctranAllToAllDedupInit(
219219
// recvbuff is internally managed nccl memory and must be freed with
220220
// ctranAllToAllDedupDestroy
221221
size_t size = maxRecvCount * commTypeSize(datatype);
222-
FB_COMMCHECK(ctran::utils::commCudaMalloc(
223-
(char**)&recvbuff, size, &comm->logMetaData_, "AllToAllDedupInit"));
222+
FB_COMMCHECK(
223+
ctran::utils::commCudaMalloc(
224+
(char**)&recvbuff, size, &comm->logMetaData_, "AllToAllDedupInit"));
224225

225226
void* segHdl{nullptr};
226227
void* regHdl{nullptr};

comms/ctran/algos/AllToAll/AllToAllPImpl.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,9 @@ commResult_t AlgoImpl::exec(const void* sendbuff, const size_t count) {
348348
// prepare kernel config for NVL copies, reuse the alltoall kernel
349349
KernelConfig config = KernelConfig(
350350
KernelConfig::KernelType::ALLTOALL, stream_, algoName(myAlgo), opCount);
351-
FB_COMMCHECK(ctran::alltoall::setupKernelConfig(
352-
sendbuff, recvbuff, count, datatype, comm_, stream_, config));
351+
FB_COMMCHECK(
352+
ctran::alltoall::setupKernelConfig(
353+
sendbuff, recvbuff, count, datatype, comm_, stream_, config));
353354
std::vector<std::unique_ptr<struct OpElem>> opGroup;
354355
// Passing op only when remote peers are present
355356
if (comm_->statex_->nNodes() > 1) {

comms/ctran/algos/AllToAll/AllToAllPImpl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class AlgoImpl {
1818
PersistArgs pArgs;
1919

2020
AlgoImpl(CtranComm* comm, cudaStream_t stream)
21-
: comm_(comm), stream_(stream){};
22-
~AlgoImpl(){};
21+
: comm_(comm), stream_(stream) {};
22+
~AlgoImpl() {};
2323

2424
commResult_t init();
2525

comms/ctran/algos/AllToAll/AllToAllvDynamicCommon.cc

Lines changed: 39 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,23 @@
1515
#define PUT_AND_WAIT(perfconfig) \
1616
do { \
1717
if (algoType == OpElem::opType::ALLTOALLV_DYNAMIC_SPLIT_NON_CONTIG) { \
18-
FB_COMMCHECK(peerPutNonContig<perfconfig>( \
19-
comm, \
20-
sendbuffs, \
21-
remoteRecvBuffs, \
22-
sendCountsTmpbufCPU, \
23-
sendcountsLength, \
24-
datatype, \
25-
tmpRegHdls, \
26-
nRanks, \
27-
myRank, \
28-
timestamp, \
29-
remoteAccessKeys, \
30-
ibPutReqs, \
31-
ibRecvCtrlReqs, \
32-
maxRecvcount, \
33-
maxSendcount)); \
18+
FB_COMMCHECK( \
19+
peerPutNonContig<perfconfig>( \
20+
comm, \
21+
sendbuffs, \
22+
remoteRecvBuffs, \
23+
sendCountsTmpbufCPU, \
24+
sendcountsLength, \
25+
datatype, \
26+
tmpRegHdls, \
27+
nRanks, \
28+
myRank, \
29+
timestamp, \
30+
remoteAccessKeys, \
31+
ibPutReqs, \
32+
ibRecvCtrlReqs, \
33+
maxRecvcount, \
34+
maxSendcount)); \
3435
} else { \
3536
FB_COMMCHECK(peerPutContig( \
3637
comm, \
@@ -171,31 +172,33 @@ static inline commResult_t peerPutContig(
171172
auto [sendCountsTmpbufGPU, tmpbufRegHdl] =
172173
comm->ctran_->algo->getTmpBufInfo(
173174
CtranAlgo::TmpbufType::SENDCOUNTS_TMPBUF);
174-
putMsgs.emplace_back(CtranMapperPutMsg{
175-
.sbuf = &reinterpret_cast<size_t*>(sendCountsTmpbufGPU)[peer],
176-
.dbuf = &remoteTmpRecvCountsBufGPU[myRank],
177-
.len = sizeof(size_t),
178-
.config =
179-
CtranMapperConfig{
180-
.memHdl_ = tmpbufRegHdl,
181-
.remoteAccessKey_ = interNodeRemoteTmpAccessKey,
182-
.notify_ = false /*notify*/},
183-
.req = nullptr});
175+
putMsgs.emplace_back(
176+
CtranMapperPutMsg{
177+
.sbuf = &reinterpret_cast<size_t*>(sendCountsTmpbufGPU)[peer],
178+
.dbuf = &remoteTmpRecvCountsBufGPU[myRank],
179+
.len = sizeof(size_t),
180+
.config =
181+
CtranMapperConfig{
182+
.memHdl_ = tmpbufRegHdl,
183+
.remoteAccessKey_ = interNodeRemoteTmpAccessKey,
184+
.notify_ = false /*notify*/},
185+
.req = nullptr});
184186

185187
ibPutReqs.push_back(std::make_unique<CtranMapperRequest>());
186188

187189
// Only notify the peer at the last message. If we notify every iput,
188190
// the peer may exist without receiving all the data.
189-
putMsgs.emplace_back(CtranMapperPutMsg{
190-
.sbuf = sendbuffs[peer],
191-
.dbuf = remoteRecvBuffs[peer],
192-
.len = sendCountsTmpbufCPU[peer] * commTypeSize(datatype),
193-
.config =
194-
CtranMapperConfig{
195-
.memHdl_ = sendMemHdls[peer],
196-
.remoteAccessKey_ = remoteAccessKeys[peer],
197-
.notify_ = true /*notify*/},
198-
.req = ibPutReqs.back().get()});
191+
putMsgs.emplace_back(
192+
CtranMapperPutMsg{
193+
.sbuf = sendbuffs[peer],
194+
.dbuf = remoteRecvBuffs[peer],
195+
.len = sendCountsTmpbufCPU[peer] * commTypeSize(datatype),
196+
.config =
197+
CtranMapperConfig{
198+
.memHdl_ = sendMemHdls[peer],
199+
.remoteAccessKey_ = remoteAccessKeys[peer],
200+
.notify_ = true /*notify*/},
201+
.req = ibPutReqs.back().get()});
199202
FB_COMMCHECK(comm->ctran_->mapper->iputBatch(std::move(putMsgs), peer));
200203
timestamp->putIssued.emplace_back(peer);
201204
it = ibRecvCtrlReqs.erase(it);

comms/ctran/algos/AllToAll/AllToAllvDynamicCommon.h

Lines changed: 48 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,17 @@ commResult_t peerPutNonContig(
152152
// Skip sending sendcounts if it is second all2allv.
153153
// TODO: using hints instead of nonContigIndices to determine this.
154154
if (!nonContigIndices) {
155-
puts.emplace_back(CtranMapperPutMsg{
156-
.sbuf = reinterpret_cast<size_t*>(sendCountsTmpbufGPU),
157-
.dbuf = &remoteTmpRecvCountsBufGPU[myRank * sendcountsLength],
158-
.len = sizeof(size_t) * sendcountsLength,
159-
.config =
160-
CtranMapperConfig{
161-
.memHdl_ = sendcountsTmpbufRegHdl,
162-
.remoteAccessKey_ = interNodeRemoteTmpAccessKey,
163-
.notify_ = false /*notify*/},
164-
.req = nullptr});
155+
puts.emplace_back(
156+
CtranMapperPutMsg{
157+
.sbuf = reinterpret_cast<size_t*>(sendCountsTmpbufGPU),
158+
.dbuf = &remoteTmpRecvCountsBufGPU[myRank * sendcountsLength],
159+
.len = sizeof(size_t) * sendcountsLength,
160+
.config =
161+
CtranMapperConfig{
162+
.memHdl_ = sendcountsTmpbufRegHdl,
163+
.remoteAccessKey_ = interNodeRemoteTmpAccessKey,
164+
.notify_ = false /*notify*/},
165+
.req = nullptr});
165166
}
166167

167168
// Handle the corner case that all the metadata and data are not sent.
@@ -187,50 +188,53 @@ commResult_t peerPutNonContig(
187188
// the peer may exist without receiving all the data.
188189
if (i == sendIndicesBlockLengthsTmpbufCPU[peer] - 1) {
189190
ibPutReqs.push_back(std::make_unique<CtranMapperRequest>());
190-
puts.emplace_back(CtranMapperPutMsg{
191-
.sbuf = sendbuffs[curIndex],
192-
.dbuf =
193-
(void*)(reinterpret_cast<uintptr_t>(remoteRecvBuffs[peer]) +
194-
remoteRecvBuffsBytesOffset[curIndex]),
195-
.len = totalSendcounts * commTypeSize(datatype),
196-
.config =
197-
CtranMapperConfig{
198-
.memHdl_ = sendMemHdl,
199-
.remoteAccessKey_ = remoteAccessKeys[peer],
200-
.notify_ = true /*notify*/},
201-
.req = ibPutReqs.back().get()});
191+
puts.emplace_back(
192+
CtranMapperPutMsg{
193+
.sbuf = sendbuffs[curIndex],
194+
.dbuf = (void*)(reinterpret_cast<uintptr_t>(
195+
remoteRecvBuffs[peer]) +
196+
remoteRecvBuffsBytesOffset[curIndex]),
197+
.len = totalSendcounts * commTypeSize(datatype),
198+
.config =
199+
CtranMapperConfig{
200+
.memHdl_ = sendMemHdl,
201+
.remoteAccessKey_ = remoteAccessKeys[peer],
202+
.notify_ = true /*notify*/},
203+
.req = ibPutReqs.back().get()});
202204
putNotifiedFlag = true;
203205
} else {
204206
if (totalSendcounts == 0) {
205207
continue;
206208
}
207-
puts.emplace_back(CtranMapperPutMsg{
208-
.sbuf = sendbuffs[curIndex],
209-
.dbuf =
210-
(void*)(reinterpret_cast<uintptr_t>(remoteRecvBuffs[peer]) +
211-
remoteRecvBuffsBytesOffset[curIndex]),
212-
.len = totalSendcounts * commTypeSize(datatype),
213-
.config =
214-
CtranMapperConfig{
215-
.memHdl_ = sendMemHdl,
216-
.remoteAccessKey_ = remoteAccessKeys[peer],
217-
.notify_ = false /*notify*/},
218-
.req = nullptr});
209+
puts.emplace_back(
210+
CtranMapperPutMsg{
211+
.sbuf = sendbuffs[curIndex],
212+
.dbuf = (void*)(reinterpret_cast<uintptr_t>(
213+
remoteRecvBuffs[peer]) +
214+
remoteRecvBuffsBytesOffset[curIndex]),
215+
.len = totalSendcounts * commTypeSize(datatype),
216+
.config =
217+
CtranMapperConfig{
218+
.memHdl_ = sendMemHdl,
219+
.remoteAccessKey_ = remoteAccessKeys[peer],
220+
.notify_ = false /*notify*/},
221+
.req = nullptr});
219222
}
220223
i++;
221224
}
222225

223226
if (!putNotifiedFlag) {
224-
puts.emplace_back(CtranMapperPutMsg{
225-
.sbuf = reinterpret_cast<size_t*>(sendCountsTmpbufGPU),
226-
.dbuf = &remoteTmpRecvCountsBufGPU[myRank * sendcountsLength],
227-
.len = 0,
228-
.config =
229-
CtranMapperConfig{
230-
.memHdl_ = sendcountsTmpbufRegHdl,
231-
.remoteAccessKey_ = interNodeRemoteTmpAccessKey,
232-
.notify_ = true /*notify*/},
233-
.req = ibPutReqs.back().get()});
227+
puts.emplace_back(
228+
CtranMapperPutMsg{
229+
.sbuf = reinterpret_cast<size_t*>(sendCountsTmpbufGPU),
230+
.dbuf = &remoteTmpRecvCountsBufGPU[myRank * sendcountsLength],
231+
.len = 0,
232+
.config =
233+
CtranMapperConfig{
234+
.memHdl_ = sendcountsTmpbufRegHdl,
235+
.remoteAccessKey_ = interNodeRemoteTmpAccessKey,
236+
.notify_ = true /*notify*/},
237+
.req = ibPutReqs.back().get()});
234238
}
235239

236240
FB_COMMCHECK(

0 commit comments

Comments
 (0)