**[None][feat] Remote-G2 failed-transfer handling: structured load-error reporting, recompute fallback, and initiator-side abort**#4
Open
cheese-head wants to merge 3 commits into
Conversation
Signed-off-by: Patrick Riel <priel@nvidia.com>
Signed-off-by: Patrick Riel <priel@nvidia.com>
… shape: error reporting + scheduler callback + abort hook Signed-off-by: Patrick Riel <priel@nvidia.com>
oandreeva-nv
reviewed
Jun 5, 2026
Comment on lines
+647
to
+651
| failed_block_ids = self.worker.get_block_ids_with_load_errors() | ||
| all_failed = mpi_allgather(failed_block_ids) | ||
| failed_set = set( | ||
| block_id for rank_ids in all_failed for block_id in rank_ids | ||
| ) |
Owner
There was a problem hiding this comment.
Could you please verify the following for TP>1 :
handle_load_errors calls mpi_allgather which requires all TP ranks to participate simultaneously. With TP>1, kv_connector_manager only exists on rank 0 — non-rank-0 workers hit the if self.kv_connector_manager is None: return guard and skip the allgather, leaving rank 0 blocked indefinitely.
The existing get_finished path handles this correctly via _run_on_leader (rank 0 runs, mpi_broadcast to others). handle_load_errors should follow the same pattern — or kv_connector_manager needs to be present on all TP ranks.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The remote-G2 KV-cache transfer protocol previously exposed only
release()andis_completed() -> bool. Two failure modes leaked out of that single gap:into a single
ERR, but the connector never inspected it, so a mid-flighttransfer error was indistinguishable from "still in progress" until the 30 s
transfer timeout fired. When trouble was finally noticed,
get_finished()raised a
RuntimeErrorstraight into the executor's main loop — not aper-request-recoverable place to throw.
down its in-flight transfer or lease, leaking the NIXL transfer and leaving
the request tracked as loading.
Both stem from the contract being too narrow. This PR expands the connector
contract once (mirroring the kvbm-v2 / vLLM failure-notification shape: error
reporting + scheduler callback + abort hook) to close both.
What changed
remote_g2_raw_nixl_adapter.py,remote_g2_transfer.py):added
is_failed()(reads NIXL state;ERR/poll-exception = hard failure, sofailures are detected immediately instead of waiting out the timeout) and
abort(). Modern NIXL has no standaloneabort_xfer()—release_xfer_handle()cancels an active transfer before freeing it — so
abort()surfaces thatprimitive through a distinct, idempotent entry point.
remote_g2_connector.py):get_finished()no longer raises.On failed state / poll exception / timeout it records the load's
target_block_ids, releases handle + lease exactly once, emits thelocal_recomputefallback event, and keeps polling other loads. Addedget_block_ids_with_load_errors()(drain-once) andabort_request().kv_cache_connector.py):KvCacheConnectorWorkergainsget_block_ids_with_load_errors()(default[]) andabort_request()(default no-op).
KvCacheConnectorManagergainshandle_load_errors()(mpi_allgather failed block ids across ranks, map to affected requests via
get_cache_indices),recompute_failed_load()(rewind), andabort_request().py_executor.py):_kv_connector_handle_load_errors()runs inforward()after save — affected requests fall back to local recompute viarecompute_failed_load(), or are terminated only if the rewind cannot apply._handle_canceled_requests()now callsabort_request()for in-flightconnector loads.
cpp/cmake/modules/FindNIXL.cmake): supporting NIXL discoverychanges for the GDS/remote transfer path.
docs/source/features/remote_g2_partial_prefix_recovery.md): designnote for the deferred Phase 2 partial-prefix recovery.
Recovery semantics. A parked request had a computed prefix of
local_prefix + external_matchtokens. On load failure,recompute_failed_load()sets the request to
CONTEXT_INIT, rewindscontext_current_position/prepopulated_prompt_lendown tolocal_prefix, zeroes the connectormatched-token count, and re-admits the request without re-
add_sequence(itsblocks are still allocated). The engine then recomputes the external region
locally instead of failing the request. Remote-G2 never publishes loaded blocks
into the reuse tree, so the in-place blocks need no invalidation.
Scope / non-goals. Phase 1 recomputes the entire external prefix on
failure. Partial-prefix recovery (keep valid blocks up to the first miss) is
deferred because NIXL exposes only a single aggregate status per batched handle,
so which blocks landed is unobservable without per-block transfers. The deferred
design is documented; the rewind machinery added here is reused by Phase 2 with
a different target (
local + K*block_size).Test Coverage
tests/unittest/_torch/test_remote_g2_connector.py(27 tests pass; runs in thedynamo dev container with the C++ bindings):
test_remote_g2_worker_failure_releases_once_and_publishes_nothingtest_remote_g2_worker_timeout_releases_transfer_and_lease_oncetest_remote_g2_worker_emits_fallback_before_validity_or_publicationtest_remote_g2_worker_emits_failed_after_validity_is_markedtest_remote_g2_worker_failed_state_does_not_propagate_and_reports_blockstest_remote_g2_worker_failed_block_ids_drained_once_per_steptest_abort_request_calls_result_aborttest_abort_request_releases_lease_oncetest_abort_request_releases_transfer_handle_oncetest_abort_request_after_completion_is_nooptest_abort_request_unknown_id_is_nooptest_recompute_failed_load_rewinds_to_local_prefixRun:
PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.