-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into chhwang/macro
- Loading branch information
Showing
25 changed files
with
271 additions
and
82 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
#ifndef MSCCLPP_ENV_HPP_ | ||
#define MSCCLPP_ENV_HPP_ | ||
|
||
#include <memory> | ||
#include <string> | ||
|
||
namespace mscclpp { | ||
|
||
class Env; | ||
|
||
/// Get the MSCCL++ environment. | ||
/// @return A reference to the global environment object. | ||
std::shared_ptr<Env> env(); | ||
|
||
/// The MSCCL++ environment. The constructor reads environment variables and sets the corresponding fields. | ||
/// Use the @ref env() function to get the environment object. | ||
class Env { | ||
public: | ||
const std::string debug; | ||
const std::string debugSubsys; | ||
const std::string debugFile; | ||
const std::string hcaDevices; | ||
const std::string hostid; | ||
const std::string socketFamily; | ||
const std::string socketIfname; | ||
const std::string commId; | ||
const std::string executionPlanDir; | ||
const std::string npkitDumpDir; | ||
const bool cudaIpcUseDefaultStream; | ||
|
||
private: | ||
Env(); | ||
|
||
friend std::shared_ptr<Env> env(); | ||
}; | ||
|
||
} // namespace mscclpp | ||
|
||
#endif // MSCCLPP_ENV_HPP_ |
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
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,28 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
#include <nanobind/nanobind.h> | ||
#include <nanobind/stl/shared_ptr.h> | ||
#include <nanobind/stl/string.h> | ||
|
||
#include <mscclpp/env.hpp> | ||
|
||
namespace nb = nanobind; | ||
using namespace mscclpp; | ||
|
||
void register_env(nb::module_& m) { | ||
nb::class_<Env>(m, "Env") | ||
.def_ro("debug", &Env::debug) | ||
.def_ro("debug_subsys", &Env::debugSubsys) | ||
.def_ro("debug_file", &Env::debugFile) | ||
.def_ro("hca_devices", &Env::hcaDevices) | ||
.def_ro("hostid", &Env::hostid) | ||
.def_ro("socket_family", &Env::socketFamily) | ||
.def_ro("socket_ifname", &Env::socketIfname) | ||
.def_ro("comm_id", &Env::commId) | ||
.def_ro("execution_plan_dir", &Env::executionPlanDir) | ||
.def_ro("npkit_dump_dir", &Env::npkitDumpDir) | ||
.def_ro("cuda_ipc_use_default_stream", &Env::cudaIpcUseDefaultStream); | ||
|
||
m.def("env", &env); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT license. | ||
|
||
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS *.cc *.cu) | ||
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS *.cc *.cpp *.cu) | ||
target_sources(mscclpp_obj PRIVATE ${SOURCES}) | ||
target_include_directories(mscclpp_obj PRIVATE include) |
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.