1616#include " comms/utils/colltrace/CollTraceInterface.h"
1717#include " comms/utils/commSpecs.h"
1818
19+ using meta::comms::CommBackend;
1920struct ctranConfig {
2021 int blocking{-1 };
2122 const char * commDesc{nullptr };
2223 const char * ncclAllGatherAlgo{nullptr };
24+ std::vector<enum CommBackend> backends = {};
2325
2426 bool operator ==(const ctranConfig& other) const {
2527 return (
2628 blocking == other.blocking && commDesc == other.commDesc &&
2729 commDesc == other.commDesc &&
28- ncclAllGatherAlgo == other.ncclAllGatherAlgo );
30+ ncclAllGatherAlgo == other.ncclAllGatherAlgo &&
31+ backends == other.backends );
2932 }
3033};
3134
@@ -46,8 +49,9 @@ class CtranComm {
4649 // For real communicationator we should use factory method to create.
4750 explicit CtranComm (
4851 std::shared_ptr<Abort> abort =
49- ctran::utils::createAbort (/* enabled=*/ false ))
50- : abort_(abort) {
52+ ctran::utils::createAbort (/* enabled=*/ false ),
53+ ctranConfig commConfig = ctranConfig{})
54+ : config_(commConfig), abort_(abort) {
5155 asyncErr_ =
5256 std::make_shared<AsyncError>(NCCL_CTRAN_ABORT_ON_ERROR, " CtranComm" );
5357 if (!abort_) {
@@ -58,11 +62,12 @@ class CtranComm {
5862 opCount_ = &ctranOpCount_;
5963 }
6064
61- // The MemCache allocator is destroyed in a different time than all other
62- // Ctran resources. To accommodate this, we split the CtranComm destructor
63- // into two parts. In the first part, we destroy all resources except for
64- // MemCache. The second part is moved to the destructor, where it is safe to
65- // destroy MemCache and reset its reference.
65+ // The MemCache allocator is destroyed in a different time than all
66+ // other Ctran resources. To accommodate this, we split the CtranComm
67+ // destructor into two parts. In the first part, we destroy all
68+ // resources except for MemCache. The second part is moved to the
69+ // destructor, where it is safe to destroy MemCache and reset its
70+ // reference.
6671 void destroy () {
6772 // All smart pointers are automatically de-initialized, but we want to
6873 // ensure they do so in a specific order. Therefore, we manually handle
@@ -72,8 +77,8 @@ class CtranComm {
7277 collTrace_.reset ();
7378 colltraceNew_.reset ();
7479 statex_.reset ();
75- // NOTE: memCache needs to be destroyed after transportProxy_ to release all
76- // buffers
80+ // NOTE: memCache needs to be destroyed after transportProxy_ to release
81+ // all buffers
7782 memCache_.reset ();
7883
7984 this ->logMetaData_ .commDesc .clear ();
0 commit comments