From 61e017ca97fa7de282ee746e721cd6ef8939eb5c Mon Sep 17 00:00:00 2001 From: Binyang Li Date: Fri, 17 Apr 2026 18:34:08 +0000 Subject: [PATCH] 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> --- include/mscclpp/core.hpp | 3 +-- include/mscclpp/env.hpp | 3 +-- src/core/env.cpp | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/mscclpp/core.hpp b/include/mscclpp/core.hpp index c0c37970..ca2fc34f 100644 --- a/include/mscclpp/core.hpp +++ b/include/mscclpp/core.hpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -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), diff --git a/include/mscclpp/env.hpp b/include/mscclpp/env.hpp index acaf0bfd..a6dd306b 100644 --- a/include/mscclpp/env.hpp +++ b/include/mscclpp/env.hpp @@ -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: diff --git a/src/core/env.cpp b/src/core/env.cpp index 2af5bddf..7a42471b 100644 --- a/src/core/env.cpp +++ b/src/core/env.cpp @@ -67,7 +67,7 @@ Env::Env() ncclSymmetricMemory(readEnv("MSCCLPP_NCCL_SYMMETRIC_MEMORY", false)), forceDisableNvls(readEnv("MSCCLPP_FORCE_DISABLE_NVLS", false)), forceDisableGdr(readEnv("MSCCLPP_FORCE_DISABLE_GDR", false)), - ibGidIndex(readEnv("MSCCLPP_IB_GID_INDEX", -1)) {} + ibGidIndex(readEnv("MSCCLPP_IB_GID_INDEX", 0)) {} std::shared_ptr env() { static std::shared_ptr globalEnv = std::shared_ptr(new Env());