forked from awslabs/raf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'comm-refactor' of github.com:Tonny-Gu/meta into multi-comm
- Loading branch information
Showing
24 changed files
with
387 additions
and
470 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/*! | ||
* Copyright (c) 2022 by Contributors | ||
* \file src/distributed/mpi_communicator.cc | ||
* \brief MPI Communicator. | ||
*/ | ||
#pragma once | ||
#include <mpi.h> | ||
#include "mnm/communicator.h" | ||
#include <string> | ||
#include <functional> | ||
|
||
namespace mnm { | ||
namespace distributed { | ||
namespace communicator { | ||
|
||
class MPICommunicatorObj final : public CommunicatorObj { | ||
public: | ||
const MPI_Comm mpi_comm = MPI_COMM_WORLD; | ||
static constexpr const char* _type_key = "mnm.distributed.MPICommunicator"; | ||
virtual ~MPICommunicatorObj(); | ||
MNM_FINAL_OBJECT(MPICommunicatorObj, CommunicatorObj); | ||
}; | ||
|
||
class MPICommunicator final : public Communicator { | ||
public: | ||
static MPICommunicator make(TupleValue rank_list); | ||
MNM_OBJECT_REF(MPICommunicator, Communicator, MPICommunicatorObj); | ||
}; | ||
|
||
} // namespace communicator | ||
} // namespace distributed | ||
} // namespace mnm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/*! | ||
* Copyright (c) 2022 by Contributors | ||
* \file src/distributed/nccl_communicator.cc | ||
* \brief NCCL Communicator | ||
*/ | ||
#pragma once | ||
#include <algorithm> | ||
#include <nccl.h> | ||
#include "mnm/communicator.h" | ||
#include "mnm/op_utils.h" | ||
#include "mnm/value.h" | ||
|
||
namespace mnm { | ||
namespace distributed { | ||
namespace communicator { | ||
|
||
class NCCLCommunicatorObj final : public CommunicatorObj { | ||
public: | ||
ncclComm_t nccl_comm; | ||
Communicator parent_comm; // Prevent MPI Communicator from releasing in advanced | ||
static constexpr const char* _type_key = "mnm.distributed.NCCLCommunicator"; | ||
virtual ~NCCLCommunicatorObj(); | ||
MNM_FINAL_OBJECT(NCCLCommunicatorObj, CommunicatorObj); | ||
}; | ||
|
||
class NCCLCommunicator final : public Communicator { | ||
public: | ||
static NCCLCommunicator make(value::TupleValue rank_list); | ||
MNM_OBJECT_REF(NCCLCommunicator, Communicator, NCCLCommunicatorObj); | ||
}; | ||
|
||
} // namespace communicator | ||
} // namespace distributed | ||
} // namespace mnm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.