Skip to content

Commit cccc6f2

Browse files
committed
interface
Signed-off-by: Chuang <[email protected]>
1 parent 3d010d4 commit cccc6f2

File tree

3 files changed

+25
-8
lines changed

3 files changed

+25
-8
lines changed

cpp/tensorrt_llm/common/envUtils.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,23 @@ std::string getEnvUCXInterface()
284284
return ucxInterface;
285285
}
286286

287+
std::string getEnvNixlInterface()
288+
{
289+
static std::once_flag flag;
290+
static std::string nixlInterface;
291+
292+
std::call_once(flag,
293+
[&]()
294+
{
295+
char const* nixl_interface = std::getenv("TRTLLM_NIXL_INTERFACE");
296+
if (nixl_interface)
297+
{
298+
nixlInterface = nixl_interface;
299+
}
300+
});
301+
return nixlInterface;
302+
}
303+
287304
bool getEnvDisaggLayerwise()
288305
{
289306
static bool const disaggLayerwise = getBoolEnv("TRTLLM_DISAGG_LAYERWISE");

cpp/tensorrt_llm/common/envUtils.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ bool getEnvUseNixlKvCache();
6060

6161
std::string getEnvUCXInterface();
6262

63+
std::string getEnvNixlInterface();
64+
6365
bool getEnvDisaggLayerwise();
6466

6567
bool getEnvDisableSelectiveCacheTransfer();

cpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
namespace tensorrt_llm::executor::kv_cache
3737
{
3838

39-
// 文件锁RAII管理类
4039
class FileLock
4140
{
4241
private:
@@ -62,7 +61,6 @@ class FileLock
6261
if (locked_)
6362
return true;
6463

65-
// 创建锁文件目录(如果不存在)
6664
size_t pos = lockFile_.find_last_of('/');
6765
if (pos != std::string::npos)
6866
{
@@ -121,14 +119,14 @@ static std::string getAvailableIP()
121119
if (ifa->ifa_addr == nullptr)
122120
continue;
123121

124-
std::string ucxInterface = common::getEnvUCXInterface();
125-
if (!ucxInterface.empty() && strcmp(ifa->ifa_name, ucxInterface.c_str()) != 0)
122+
std::string nixlInterface = common::getEnvNixlInterface();
123+
if (!nixlInterface.empty() && strcmp(ifa->ifa_name, nixlInterface.c_str()) != 0)
126124
{
127125
continue;
128126
}
129127

130128
// Skip the loopback interface
131-
if (ucxInterface.empty() && (strncmp(ifa->ifa_name, "docker", 6) == 0 || strcmp(ifa->ifa_name, "lo") == 0))
129+
if (nixlInterface.empty() && (strncmp(ifa->ifa_name, "docker", 6) == 0 || strcmp(ifa->ifa_name, "lo") == 0))
132130
{
133131
continue;
134132
}
@@ -141,16 +139,16 @@ static std::string getAvailableIP()
141139
char address_buffer[INET_ADDRSTRLEN];
142140
inet_ntop(AF_INET, addr_ptr, address_buffer, sizeof(address_buffer));
143141

144-
TLLM_LOG_DEBUG(mpi::MpiComm::world().getRank(), " ***** UCX Interface: %s IP Address: %s", ifa->ifa_name,
145-
address_buffer);
142+
TLLM_LOG_DEBUG(mpi::MpiComm::world().getRank(), " ***** NIXL Interface: %s IP Address: %s",
143+
ifa->ifa_name, address_buffer);
146144
ip = address_buffer;
147145
break;
148146
}
149147
}
150148
if (ifa == nullptr)
151149
{
152150
TLLM_LOG_ERROR(mpi::MpiComm::world().getRank(),
153-
"UCX No valid IP address found please set correct UCX interface with env variable TRTLLM_UCX_INTERFACE");
151+
"UCX No valid IP address found please set correct NIXL interface with env variable TRTLLM_UCX_INTERFACE");
154152
}
155153

156154
freeifaddrs(ifaddr);

0 commit comments

Comments
 (0)