Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
7e7e5a9
[None][feat] bounce v2: core data structures, scheduler, codec, kernel
chuangz0 Jun 28, 2026
b4583e8
[None][feat] bounce v2: transport reactor + control channel + NIXL en…
chuangz0 Jun 28, 2026
c874ccb
[None][doc] bounce v2: DESIGN.md (as-built spec)
chuangz0 Jun 28, 2026
8e600a3
[None][fix] bounce v2: stop silently swallowing cleanup failures
chuangz0 Jun 29, 2026
5e920e6
[None][build] bounce v2: decouple from ENABLE_UCX (gate on NIXL + zmq)
chuangz0 Jun 30, 2026
7e0cac9
[None][doc] bounce v2: explain CreditScheduler::schedule() for newcomers
chuangz0 Jun 30, 2026
4ca42d5
[None][refactor] bounce v2: name the cancel codec (encodeCancel / isC…
chuangz0 Jun 30, 2026
9e082b8
[None][feat] bounce v2: opt-in cub + zero-copy gather/scatter copy ba…
chuangz0 Jun 30, 2026
16d50d7
[None][test] bounce v2: real-RDMA failure-path e2e (no-grant timeout,…
chuangz0 Jun 30, 2026
4d4f0bb
[None][fix] bounce v2: reclaim control-channel DEALER on forgetPeer
chuangz0 Jun 30, 2026
9f9d5fd
[None][chore] bounce v2: group unit tests under executor/bounce/
chuangz0 Jun 30, 2026
f61cfd9
[None][fix] bounce v2: make forgetPeer's peer-reconnect deterministic
chuangz0 Jun 30, 2026
a0f3126
[None][chore] bounce v2: stop tracking local DESIGN.md
chuangz0 Jun 30, 2026
becdc61
[None][test] bounce v2: drive transport tests over real NIXL, drop Lo…
chuangz0 Jun 30, 2026
6861afd
[None][test] bounce v2: drive happy-path e2e through the production API
chuangz0 Jul 1, 2026
83ce36d
[None][fix] bounce v2: clamp maxChunkBytes and guard region bounds
chuangz0 Jul 1, 2026
b4c1ce2
[None][chore] bounce v2: drop dangling DESIGN.md references from comm…
chuangz0 Jul 1, 2026
fc3d229
[None][feat] bounce v2: accept KB/MB/GB suffixes in byte-valued env vars
chuangz0 Jul 7, 2026
f537fcb
[None][feat] bounce v2: NVTX instrumentation for the transfer pipeline
chuangz0 Jul 7, 2026
de6915a
[None][perf] bounce v2: cut per-chunk KV transfer latency ~49% (1.68m…
chuangz0 Jul 13, 2026
f8e7f0d
[None][chore] bounce v2: satisfy clang-format and codespell hooks
chuangz0 Jul 13, 2026
396c8ff
[None][fix] bounce v2: don't modulo an empty ring in dropFromRing
chuangz0 Jul 24, 2026
2dad352
fix: align bounce v2 configuration and peer handshake
chuangz0 Jul 31, 2026
6793ff3
test: cover NIXL bounce through Python transceiver
chuangz0 Jul 31, 2026
44e2dbf
fix: validate bounce control endpoints
chuangz0 Jul 31, 2026
3b42727
fix: prevent starvation of large bounce chunks
chuangz0 Aug 3, 2026
12db298
[None][fix] bounce v2: address code review findings
chuangz0 Aug 10, 2026
8d2c611
[None][test] bounce v2: verify engagement programmatically, not via logs
chuangz0 Aug 10, 2026
5d243a7
[None][test] reject skipped bounce subprocess
chuangz0 Aug 11, 2026
1d2b1c8
fix: harden bounce transport protocol handling
chuangz0 Aug 12, 2026
2bb8cc2
[None][feat] bounce v2: enable via CacheTransceiverConfig.agent_buffe…
chuangz0 Aug 13, 2026
1b0591c
[None][chore] drop per-field capture test for agent_buffer_enable
chuangz0 Aug 13, 2026
3889424
[None][chore] raise KV transfer defaults: 4 sender workers, 512MiB bo…
chuangz0 Aug 14, 2026
6fa2d31
[None][chore] bounce v2: drop the NIXL-notifications control channel
chuangz0 Aug 14, 2026
b82e25c
[None][fix] bounce v2: lease + quarantine reclaim of dead senders' re…
chuangz0 Aug 14, 2026
48e0945
[None][test] bounce v2: deduplicate and consolidate the test suite
chuangz0 Aug 17, 2026
14e0f6b
[None][feat] bounce v2: surface the failure reason to the upper layer
chuangz0 Aug 17, 2026
b3046e4
[None][chore] bounce v2: drop the cub-copy backend and the run-mergin…
chuangz0 Aug 17, 2026
9fac944
[None][refactor] bounce v2: post writes through NixlTransferAgent, dr…
chuangz0 Aug 17, 2026
88492b1
[None][chore] bounce v2: derive the lease/quarantine timeouts from th…
chuangz0 Aug 18, 2026
4235486
[None][fix] bounce v2: fix shutdown lost-wakeup, harden peer-input an…
chuangz0 Aug 19, 2026
8ddae67
[TRTLLM-15344][feat] configure bounce v2 via CacheTransceiverConfig i…
chuangz0 Aug 21, 2026
c4e01b7
[None][fix] bounce v2: reject WANT chunk sizes outside the handshake …
chuangz0 Aug 21, 2026
5c94adc
[None][chore] bounce v2: fix stale comments, drop dead code, dedup lo…
chuangz0 Aug 21, 2026
373e2ab
[TRTLLM-15344][refactor] select the bounce implementation with a bool…
chuangz0 Aug 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# SPDX-FileCopyrightText: Copyright (c) 1993-2022 NVIDIA CORPORATION &
# SPDX-FileCopyrightText: Copyright (c) 1993-2026 NVIDIA CORPORATION &
# AFFILIATES. All rights reserved. SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
Expand Down Expand Up @@ -280,8 +280,15 @@ include_directories(${CMAKE_BINARY_DIR}/_deps/nanobind-src/include)

FetchContent_MakeAvailable(cutlass cxxopts flashmla json msa xgrammar)

# cppzmq (header-only) is the bounce v2 control-plane dependency AND the UCX
# bootstrap dependency. Make it available whenever NIXL (-> bounce) or UCX is
# enabled, so bounce does NOT require UCX (its real deps are NIXL + zmq,
# orthogonal to UCX). ucxx stays UCX-only.
if(NIXL_ROOT OR ENABLE_UCX)
FetchContent_MakeAvailable(cppzmq)
endif()
if(ENABLE_UCX)
FetchContent_MakeAvailable(cppzmq ucxx)
FetchContent_MakeAvailable(ucxx)
endif()

if(NOT NVTX_DISABLE)
Expand Down
16 changes: 15 additions & 1 deletion cpp/include/tensorrt_llm/executor/executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -1522,20 +1522,25 @@ class CacheTransceiverConfig
explicit CacheTransceiverConfig(std::optional<BackendType> backendType = std::nullopt,
std::optional<size_t> maxNumTokens = std::nullopt, std::optional<int> kvTransferTimeoutMs = std::nullopt,
std::optional<int> kvTransferSenderFutureTimeoutMs = std::nullopt,
std::optional<int> kvTransferPollIntervalMs = kDefaultKvTransferPollIntervalMs);
std::optional<int> kvTransferPollIntervalMs = kDefaultKvTransferPollIntervalMs, size_t agentBufferSizeMb = 0,
std::map<std::string, std::string> agentBounceParams = {});

bool operator==(CacheTransceiverConfig const& other) const;
void setBackendType(std::optional<BackendType> backendType);
void setMaxTokensInBuffer(std::optional<size_t> maxTokensInBuffer);
void setKvTransferTimeoutMs(std::optional<int> kvTransferTimeoutMs);
void setKvTransferSenderFutureTimeoutMs(std::optional<int> kvTransferSenderFutureTimeoutMs);
void setKvTransferPollIntervalMs(std::optional<int> kvTransferPollIntervalMs);
void setAgentBufferSizeMb(size_t agentBufferSizeMb);
void setAgentBounceParams(std::map<std::string, std::string> agentBounceParams);

[[nodiscard]] std::optional<size_t> getMaxTokensInBuffer() const;
[[nodiscard]] std::optional<BackendType> getBackendType() const;
[[nodiscard]] std::optional<int> getKvTransferTimeoutMs() const;
[[nodiscard]] std::optional<int> getKvTransferSenderFutureTimeoutMs() const;
[[nodiscard]] std::optional<int> getKvTransferPollIntervalMs() const;
[[nodiscard]] size_t getAgentBufferSizeMb() const;
[[nodiscard]] std::map<std::string, std::string> const& getAgentBounceParams() const;

private:
std::optional<BackendType> mBackendType;
Expand All @@ -1550,6 +1555,15 @@ class CacheTransceiverConfig
// @brief Bounded wait interval in milliseconds for polling KV transfer progress when active transfers block
// disaggregated admission.
std::optional<int> mKvTransferPollIntervalMs;
// @brief Size in MiB of the transfer agent's staging-buffer (bounce) arena, currently
// implemented by the NIXL agent. 0 (default) disables the fast path; >0 enables it at that
// arena capacity (one shared arena for the sender and receiver roles).
size_t mAgentBufferSizeMb{0};
// @brief Expert tuning knobs for the bounce pipeline, keyed by the TRTLLM_NIXL_BOUNCE_*
// environment-variable names without the prefix and the trailing _BYTES, lowercased (e.g.
// TRTLLM_NIXL_BOUNCE_MAX_CHUNK_SIZE_BYTES -> "max_chunk_size"). Precedence: this map >
// environment variable > built-in default. Ignored when mAgentBufferSizeMb == 0.
std::map<std::string, std::string> mAgentBounceParams;
};

/// @brief Configuration class for the model executor
Expand Down
45 changes: 38 additions & 7 deletions cpp/include/tensorrt_llm/executor/transferAgent.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,8 @@ struct VramRegionMeta
size_t chunkSize; ///< 0 = cudaMalloc (no split), >0 = VMM chunk size
};

// `AgentDesc` represents the unique identifier for reading and writing to the agent.
// By accessing this identifier, the backend can establish the correct connection.
// It also carries VMM region metadata so that remote agents can split at chunk boundaries.
// `AgentDesc` carries the backend metadata needed to connect to an agent, plus optional
// backend-independent metadata used by higher-level transfer paths.
class AgentDesc final
{
public:
Expand All @@ -262,9 +261,10 @@ class AgentDesc final
{
}

AgentDesc(std::string backendAgentDesc, std::vector<VramRegionMeta> vramRegions)
AgentDesc(std::string backendAgentDesc, std::vector<VramRegionMeta> vramRegions, std::string bounceHandshake = {})
: mBackendAgentDesc{std::move(backendAgentDesc)}
, mVramRegions{std::move(vramRegions)}
, mBounceHandshake{std::move(bounceHandshake)}
{
}

Expand All @@ -278,7 +278,18 @@ class AgentDesc final
return mVramRegions;
}

/// Serialize the entire AgentDesc (backend blob + VMM regions) into an opaque string.
/// Optional NIXL-bounce capability handshake advertised by this agent.
/// An opaque blob encoded/decoded by bounce::encodeHandshake/decodeHandshake: wire version,
/// control-channel kind + endpoint, and effective region-size limits. It is empty when bounce is
/// disabled. A caller must exchange the complete serialized AgentDesc, rather than only
/// getBackendAgentDesc(), for the peer to receive this handshake.
[[nodiscard]] std::string const& getBounceHandshake() const noexcept
{
return mBounceHandshake;
}

/// Serialize the entire AgentDesc (backend blob + VMM regions + bounce handshake) into an
/// opaque string.
[[nodiscard]] std::string serialize() const;

/// Deserialize an opaque string back into an AgentDesc.
Expand All @@ -287,6 +298,7 @@ class AgentDesc final
private:
std::string mBackendAgentDesc;
std::vector<VramRegionMeta> mVramRegions;
std::string mBounceHandshake;
};

// `TransferOp` is an enumeration that represents the types of transfer operations.
Expand Down Expand Up @@ -371,6 +383,13 @@ class TransferStatus
{
return false;
}

/// Human-readable detail for the most recent terminal state (empty when unavailable). Backends
/// override this so a kFAILURE from wait() can carry its cause to the caller.
[[nodiscard]] virtual std::string getLastStatusStr() const
{
return {};
}
};

struct BaseAgentConfig
Expand All @@ -383,6 +402,18 @@ struct BaseAgentConfig
std::unordered_map<std::string, std::string> backendParams;
std::optional<int> rank;
std::optional<int> worldSize;
/// Size in MiB of the agent's staging-buffer (bounce) arena, currently implemented by the
/// NIXL agent. 0 (default) disables the fast path; >0 enables it at that arena capacity.
/// Ignored by agents without bounce support (e.g. mooncake).
size_t agentBufferSizeMb{0};
/// Expert tuning knobs for the bounce pipeline, keyed by the TRTLLM_NIXL_BOUNCE_*
/// environment-variable names without the prefix and the trailing _BYTES, lowercased (e.g.
/// TRTLLM_NIXL_BOUNCE_MAX_CHUNK_SIZE_BYTES -> "max_chunk_size").
/// Kept SEPARATE from backendParams on purpose: backendParams is forwarded verbatim to the
/// backend plugin (e.g. NIXL createBackend), so bounce keys must not leak into it.
/// Precedence: this map > environment variable > built-in default. Ignored when
/// agentBufferSizeMb == 0.
std::unordered_map<std::string, std::string> bounceParams;
};

class BaseTransferAgent
Expand Down Expand Up @@ -416,8 +447,8 @@ class BaseTransferAgent
/// @return The descriptor of the local agent.
virtual AgentDesc getLocalAgentDesc() = 0;

/// @brief Fetch the descriptor of the local agent.
/// @return The descriptor of the local agent.
/// @brief Fetch the backend-specific connection information for the local agent.
/// @return The local connection information. Optional AgentDesc metadata is not included.
virtual ConnectionInfoType getLocalConnectionInfo() = 0;

/// @brief Initiate the transfer by submitting the request.
Expand Down
6 changes: 4 additions & 2 deletions cpp/tensorrt_llm/batch_manager/cacheTransceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,15 +664,17 @@ CacheTransceiver::CacheTransceiver(kv_cache_manager::BaseKVCacheManager* cacheMa
auto rnnState
= mCacheState->hasRnnConfig() ? std::make_optional(mCacheState->getRnnCacheState()) : std::nullopt;
mManager = std::make_unique<tensorrt_llm::executor::kv_cache::AgentConnectionManager>(
mCacheTransBufferManagerPtrs, *mCacheState, "nixl", rnnState);
mCacheTransBufferManagerPtrs, *mCacheState, "nixl", rnnState,
mCacheTransceiverConfig->getAgentBufferSizeMb(), mCacheTransceiverConfig->getAgentBounceParams());
TLLM_LOG_INFO("NIXL Connection Manager created");
}
else if (backendType.value() == executor::CacheTransceiverConfig::BackendType::MOONCAKE)
{
auto rnnState
= mCacheState->hasRnnConfig() ? std::make_optional(mCacheState->getRnnCacheState()) : std::nullopt;
mManager = std::make_unique<tensorrt_llm::executor::kv_cache::AgentConnectionManager>(
mCacheTransBufferManagerPtrs, *mCacheState, "mooncake", rnnState);
mCacheTransBufferManagerPtrs, *mCacheState, "mooncake", rnnState,
mCacheTransceiverConfig->getAgentBufferSizeMb(), mCacheTransceiverConfig->getAgentBounceParams());
TLLM_LOG_INFO("MOONCAKE Connection Manager created");
}
else if (backendType.value() == executor::CacheTransceiverConfig::BackendType::MPI)
Expand Down
28 changes: 26 additions & 2 deletions cpp/tensorrt_llm/executor/cacheTransceiverConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ namespace tensorrt_llm::executor

CacheTransceiverConfig::CacheTransceiverConfig(std::optional<BackendType> backendType,
std::optional<size_t> maxNumTokens, std::optional<int> kvTransferTimeoutMs,
std::optional<int> kvTransferSenderFutureTimeoutMs, std::optional<int> kvTransferPollIntervalMs)
std::optional<int> kvTransferSenderFutureTimeoutMs, std::optional<int> kvTransferPollIntervalMs,
size_t agentBufferSizeMb, std::map<std::string, std::string> agentBounceParams)
: mBackendType(backendType)
, mMaxTokensInBuffer(maxNumTokens)
, mKvTransferTimeoutMs(kvTransferTimeoutMs)
, mKvTransferSenderFutureTimeoutMs(kvTransferSenderFutureTimeoutMs)
, mAgentBufferSizeMb(agentBufferSizeMb)
, mAgentBounceParams(std::move(agentBounceParams))
{
setKvTransferPollIntervalMs(kvTransferPollIntervalMs);
}
Expand All @@ -37,7 +40,8 @@ bool CacheTransceiverConfig::operator==(CacheTransceiverConfig const& other) con
return mMaxTokensInBuffer == other.mMaxTokensInBuffer && mBackendType == other.mBackendType
&& mKvTransferTimeoutMs == other.mKvTransferTimeoutMs
&& mKvTransferSenderFutureTimeoutMs == other.mKvTransferSenderFutureTimeoutMs
&& mKvTransferPollIntervalMs == other.mKvTransferPollIntervalMs;
&& mKvTransferPollIntervalMs == other.mKvTransferPollIntervalMs
&& mAgentBufferSizeMb == other.mAgentBufferSizeMb && mAgentBounceParams == other.mAgentBounceParams;
}

void CacheTransceiverConfig::setBackendType(std::optional<BackendType> backendType)
Expand Down Expand Up @@ -101,4 +105,24 @@ std::optional<int> CacheTransceiverConfig::getKvTransferPollIntervalMs() const
{
return mKvTransferPollIntervalMs;
}

void CacheTransceiverConfig::setAgentBufferSizeMb(size_t agentBufferSizeMb)
{
mAgentBufferSizeMb = agentBufferSizeMb;
}

size_t CacheTransceiverConfig::getAgentBufferSizeMb() const
{
return mAgentBufferSizeMb;
}

void CacheTransceiverConfig::setAgentBounceParams(std::map<std::string, std::string> agentBounceParams)
{
mAgentBounceParams = std::move(agentBounceParams);
}

std::map<std::string, std::string> const& CacheTransceiverConfig::getAgentBounceParams() const
{
return mAgentBounceParams;
}
} // namespace tensorrt_llm::executor
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,8 @@ std::optional<size_t> AgentConnection::getPreAssignedBufferId(uint8_t kind) cons

AgentConnectionManager::AgentConnectionManager(
std::vector<batch_manager::BaseTransBufferManager*> cacheTransBufferManagers, CacheState cacheState,
std::string const& backendType, std::optional<CacheState::RnnCacheState> rnnCacheState)
std::string const& backendType, std::optional<CacheState::RnnCacheState> rnnCacheState, size_t agentBufferSizeMb,
std::map<std::string, std::string> const& agentBounceParams)
: mCacheState(std::move(cacheState))
, mRnnCacheState(std::move(rnnCacheState))
, mCacheTransBufferManagers(std::move(cacheTransBufferManagers))
Expand Down Expand Up @@ -425,6 +426,11 @@ AgentConnectionManager::AgentConnectionManager(
BaseAgentConfig config{mAgentName, true, false, true};
config.rank = mRank;
config.worldSize = mWorldSize;
config.agentBufferSizeMb = agentBufferSizeMb;
// BaseAgentConfig keeps bounce knobs separate from backendParams (which is forwarded verbatim
// to the backend plugin); convert the ordered map from CacheTransceiverConfig here.
config.bounceParams
= std::unordered_map<std::string, std::string>(agentBounceParams.begin(), agentBounceParams.end());
m_Agent = makeTransferAgent(backendType, &config);
TLLM_CHECK(!mCacheTransBufferManagers.empty());
mBufferKinds.reserve(mCacheTransBufferManagers.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ class AgentConnectionManager : public ConnectionManager
public:
AgentConnectionManager(std::vector<batch_manager::BaseTransBufferManager*> cacheTransBufferManagers,
CacheState cacheState, std::string const& backendType,
std::optional<CacheState::RnnCacheState> rnnCacheState = std::nullopt);
std::optional<CacheState::RnnCacheState> rnnCacheState = std::nullopt, size_t agentBufferSizeMb = 0,
std::map<std::string, std::string> const& agentBounceParams = {});
~AgentConnectionManager();
AgentConnection* recvConnect(DataContext const& ctx, void* data, size_t size) override;
[[nodiscard]] std::vector<Connection const*> getConnections(CommState const& state) override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,42 @@ if(NIXL_ROOT)
# Link against CUDA runtime (for cudaMemcpy in posix fallback)
target_link_libraries(${NIXL_WRAPPER_TARGET} PRIVATE CUDA::cudart)

# ------------------------------------------------------------------------
# Bounce v2 transport. Its real dependencies are NIXL (data plane, gated by
# the NIXL_ROOT block above) + zmq (control plane) — NOT UCX. So compile it
# whenever zmq is available, INDEPENDENT of ENABLE_UCX. cppzmq (header-only)
# is fetched at the top level when NIXL or UCX is on. Activates the
# TLLM_BOUNCE_V2 code paths; runtime use is still opt-in via
# CacheTransceiverConfig.agent_buffer_size_mb.
# ------------------------------------------------------------------------
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules(ZMQ libzmq) # optional: bounce is skipped if libzmq is
# absent
endif()
if(ZMQ_FOUND)
target_sources(
${NIXL_WRAPPER_TARGET}
PRIVATE bounce/BounceTransferPlan.cpp
bounce/BuddyAllocator.cpp
bounce/CreditScheduler.cpp
bounce/BounceMessage.cpp
bounce/BounceArena.cpp
bounce/ExecPool.cpp
bounce/GatherScatterKernel.cu
bounce/ZmqControlChannel.cpp
bounce/BounceTransport.cpp)
target_include_directories(
${NIXL_WRAPPER_TARGET} PRIVATE ${CMAKE_BINARY_DIR}/_deps/cppzmq-src
${ZMQ_INCLUDE_DIRS})
target_link_libraries(${NIXL_WRAPPER_TARGET} PRIVATE ${ZMQ_LIBRARIES}
${NIXL_BUILD_LIBRARY})
target_compile_definitions(${NIXL_WRAPPER_TARGET} PRIVATE TLLM_BOUNCE_V2=1)
# The .cu device symbols must resolve into this shared lib.
set_target_properties(${NIXL_WRAPPER_TARGET}
PROPERTIES CUDA_RESOLVE_DEVICE_SYMBOLS ON)
endif()

set(NIXL_ENABLED TRUE)
else()
set(NIXL_ENABLED FALSE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@ NB_MODULE(tensorrt_llm_transfer_agent_binding, m)
// subclass type is not directly registered (e.g., agents created via factory).
nb::class_<kvc::TransferStatus>(m, "TransferStatus")
.def("is_completed", &kvc::TransferStatus::isCompleted, nb::call_guard<nb::gil_scoped_release>())
.def("wait", &kvc::TransferStatus::wait, nb::arg("timeout_ms") = -1, nb::call_guard<nb::gil_scoped_release>());
.def("wait", &kvc::TransferStatus::wait, nb::arg("timeout_ms") = -1, nb::call_guard<nb::gil_scoped_release>())
// Failure detail for the last terminal state (empty if unavailable). Named to match the
// lookup in BindingsNixlTransferStatus.last_status_str (nixl/_agent_cpp.py), which is what
// the Python transceiver's error log reads.
.def("get_last_status_str", &kvc::TransferStatus::getLastStatusStr);

// BaseAgentConfig struct
nb::class_<kvc::BaseAgentConfig>(m, "BaseAgentConfig")
Expand All @@ -199,23 +203,28 @@ NB_MODULE(tensorrt_llm_transfer_agent_binding, m)
[](kvc::BaseAgentConfig* self, std::string name, bool use_prog_thread, bool multi_thread,
bool use_listen_thread, bool enable_telemetry,
std::unordered_map<std::string, std::string> backend_params, std::optional<int> rank,
std::optional<int> world_size)
std::optional<int> world_size, size_t agent_buffer_size_mb,
std::unordered_map<std::string, std::string> bounce_params)
{
new (self) kvc::BaseAgentConfig{std::move(name), use_prog_thread, multi_thread, use_listen_thread,
enable_telemetry, std::move(backend_params), rank, world_size};
enable_telemetry, std::move(backend_params), rank, world_size, agent_buffer_size_mb,
std::move(bounce_params)};
},
nb::arg("name"), nb::arg("use_prog_thread") = true, nb::arg("multi_thread") = false,
nb::arg("use_listen_thread") = false, nb::arg("enable_telemetry") = false,
nb::arg("backend_params") = std::unordered_map<std::string, std::string>{}, nb::arg("rank") = std::nullopt,
nb::arg("world_size") = std::nullopt)
nb::arg("world_size") = std::nullopt, nb::arg("agent_buffer_size_mb") = 0,
nb::arg("bounce_params") = std::unordered_map<std::string, std::string>{})
.def_rw("name", &kvc::BaseAgentConfig::mName)
.def_rw("use_prog_thread", &kvc::BaseAgentConfig::useProgThread)
.def_rw("multi_thread", &kvc::BaseAgentConfig::multiThread)
.def_rw("use_listen_thread", &kvc::BaseAgentConfig::useListenThread)
.def_rw("enable_telemetry", &kvc::BaseAgentConfig::enableTelemetry)
.def_rw("backend_params", &kvc::BaseAgentConfig::backendParams)
.def_rw("rank", &kvc::BaseAgentConfig::rank)
.def_rw("world_size", &kvc::BaseAgentConfig::worldSize);
.def_rw("world_size", &kvc::BaseAgentConfig::worldSize)
.def_rw("agent_buffer_size_mb", &kvc::BaseAgentConfig::agentBufferSizeMb)
.def_rw("bounce_params", &kvc::BaseAgentConfig::bounceParams);

// BaseTransferAgent class (abstract base)
// All transfer-engine operations release the GIL: they may block on NIXL /
Expand Down Expand Up @@ -293,7 +302,10 @@ NB_MODULE(tensorrt_llm_transfer_agent_binding, m)
.def("get_notified_sync_messages", &kvc::NixlTransferAgent::getNotifiedSyncMessages,
nb::call_guard<nb::gil_scoped_release>())
.def("check_remote_descs", &kvc::NixlTransferAgent::checkRemoteDescs, nb::arg("name"), nb::arg("memory_descs"),
nb::call_guard<nb::gil_scoped_release>());
nb::call_guard<nb::gil_scoped_release>())
// Programmatic bounce v2 observability (deployment checks and tests; no log parsing).
.def_prop_ro("bounce_enabled", &kvc::NixlTransferAgent::isBounceEnabled)
.def_prop_ro("bounce_submit_count", &kvc::NixlTransferAgent::getBounceSubmitCount);
#endif

// NOTE: MooncakeTransferAgent/MooncakeTransferStatus class bindings are intentionally
Expand Down
Loading
Loading