Revert env/core changes superseded by main

main already provides MSCCLPP_IB_GID_INDEX env override and
MSCCLPP_FORCE_DISABLE_GDR, so drop the now-redundant divergences in
include/mscclpp/core.hpp, include/mscclpp/env.hpp, and src/core/env.cpp.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Binyang Li
2026-04-17 18:34:08 +00:00
parent d48964f5be
commit 61e017ca97
3 changed files with 3 additions and 5 deletions

View File

@@ -8,7 +8,6 @@
#include <bitset>
#include <future>
#include <memory>
#include <mscclpp/env.hpp>
#include <mscclpp/errors.hpp>
#include <mscclpp/gpu_data_types.hpp>
#include <mscclpp/version.hpp>
@@ -431,7 +430,7 @@ struct EndpointConfig {
int maxWrPerSend = DefaultMaxWrPerSend, Mode mode = Mode::Default)
: deviceIndex(deviceIndex),
port(port),
gidIndex(env()->ibGidIndex >= 0 ? env()->ibGidIndex : gidIndex),
gidIndex(gidIndex),
maxCqSize(maxCqSize),
maxCqPollNum(maxCqPollNum),
maxSendWr(maxSendWr),

View File

@@ -116,8 +116,7 @@ class Env {
const bool forceDisableGdr;
/// Env name: `MSCCLPP_IB_GID_INDEX`. The GID index to use for IB transport.
/// When set to a non-negative value, overrides the `gidIndex` parameter passed to `EndpointConfig::Ib`.
/// Default is -1 (unset, uses the constructor argument which defaults to `EndpointConfig::Ib::DefaultGidIndex`).
/// Default is 0. Used when `EndpointConfig::Ib::gidIndex` is -1 (unspecified).
const int ibGidIndex;
private:

View File

@@ -67,7 +67,7 @@ Env::Env()
ncclSymmetricMemory(readEnv<bool>("MSCCLPP_NCCL_SYMMETRIC_MEMORY", false)),
forceDisableNvls(readEnv<bool>("MSCCLPP_FORCE_DISABLE_NVLS", false)),
forceDisableGdr(readEnv<bool>("MSCCLPP_FORCE_DISABLE_GDR", false)),
ibGidIndex(readEnv<int>("MSCCLPP_IB_GID_INDEX", -1)) {}
ibGidIndex(readEnv<int>("MSCCLPP_IB_GID_INDEX", 0)) {}
std::shared_ptr<Env> env() {
static std::shared_ptr<Env> globalEnv = std::shared_ptr<Env>(new Env());