Skip to content

[None][fix] Guard Python KV receive ownership and publication - #17720

Merged
chienchunhung merged 10 commits into
NVIDIA:mainfrom
chienchunhung:codex/disagg-ownership-red-regressions
Sep 3, 2026
Merged

[None][fix] Guard Python KV receive ownership and publication#17720
chienchunhung merged 10 commits into
NVIDIA:mainfrom
chienchunhung:codex/disagg-ownership-red-regressions

Conversation

@chienchunhung

@chienchunhung chienchunhung commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

DBR-PR1 — receive-side ownership foundation. This PR adds the dormant GEN-side physical-ownership and publication primitive needed for safe, deadline-bounded KV-transfer retirement.

Today a Python KV receive can become logically failed or cancelled while a remote writer or local CUDA operation may still access its destination. That can allow premature cleanup, republish work after cancellation, lose ownership during partial publication, or tear down registered resources during shutdown.

This PR separates logical outcome from physical liveness. It remains default-off: enforce_physical_ownership defaults to False, and this PR adds no public configuration or production activation.

Safety boundary

When ownership enforcement is enabled, destination reuse is allowed only when:

  • cancellation wins before any writer is authorized; or
  • every authorized writer has settled and local receive/scatter work is complete.

Failure, cancellation, timeout, or incomplete evidence does not prove quiescence. Writer identities are sealed explicitly for identified cohorts; the qualified immutable/no-retry ADP path may instead seal the selected group by its expected writer count.

flowchart LR
    U["Destination unpublished"] --> G{"Cancellation / publication gate"}
    G -- "cancel wins" --> S["SAFE_UNPUBLISHED"]
    S --> R["Release reservation"]
    G -- "publication wins" --> C["Seal authorized writers"]
    C --> P["Publish REQUEST_DATA"]
    P --> A["Destination may be accessed"]
    A --> T{"All writers settled<br/>and local work complete?"}
    T -- "no" --> H["Retain session and allocation"]
    T -- "yes" --> D["Owner drained<br/>reuse may proceed"]
Loading

Implementation

  • Track publication, authorized writers, per-writer terminal evidence, and local completion independently from request status.
  • Serialize publication with cancellation without holding the session-state lock across blocking network sends.
  • Retain ownership-enabled sessions until the shared resources_drained() predicate succeeds.
  • Gate failure consensus, cancellation, request removal, close, and shutdown on the same predicate.
  • Preserve safe unpublished state across repeated cancellation and fail closed on partial or invalid evidence.
  • Preserve legacy behavior when enforcement is disabled.

Validation

The first commit, fc756e735, contains the three deterministic motivating regressions. Historical RED evidence from a test-only predecessor is PR_Github #66895 / pipeline #54452; it is motivation evidence, not patch-equivalent evidence for the current first commit.

At current head bff832cf1:

  • CPU-Generic-x86-1 and tests/unittest/disaggregated passed in the exact-head full-CI sequence.
  • The complete incremental full run finished SUCCESS in PR_Github #71299 / pipeline #58427. Earlier same-head retries contained infrastructure/dependency-install failures only; no product failure remains.
  • All current GitHub checks are green.

The focused module contains 20 ownership regressions covering writer failure, pre-publication cancellation, publication ordering, partial publication, cross-rank drain consensus, shutdown retention, and immutable/no-retry ADP group sealing. Three existing test modules provide compatibility coverage.

Deferred

This PR does not add CTX source/backend-handle ownership, a quiescence deadline, endpoint fail-close/restart, retry or reroute identity, broad topology/backend qualification, in-flight cancellation, or C++ parity. Follow-up #18041 adds the narrow CTX-side bridge and qualified activation; this PR alone changes no production deployment behavior.

@chienchunhung

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast --stage-list "A10-PyTorch-1, A10-PyTorch-2, A10-PyTorch-3"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66363 [ run ] triggered by Bot. Commit: 8abd3b1 Link to invocation

@chienchunhung

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "CPU-Generic-x86-1"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66377 [ run ] triggered by Bot. Commit: 905fb53 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66363 [ run ] completed with state ABORTED. Commit: 8abd3b1

Link to invocation

@chienchunhung
chienchunhung force-pushed the codex/disagg-ownership-red-regressions branch from 905fb53 to 0304618 Compare August 14, 2026 21:43
@chienchunhung

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "CPU-Generic-x86-1"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66385 [ run ] triggered by Bot. Commit: 0304618 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66377 [ run ] completed with state ABORTED. Commit: 905fb53

Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66385 [ run ] completed with state SUCCESS. Commit: 0304618
/LLM/main/L0_MergeRequest_PR pipeline #54028 (Partly Tested) completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@chienchunhung chienchunhung changed the title [None][test] reproduce Python disaggregated ownership gaps [None][fix] enforce Python KV transfer physical ownership Aug 15, 2026
@chienchunhung

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "CPU-Generic-x86-1"

2 similar comments
@chienchunhung

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "CPU-Generic-x86-1"

@chienchunhung

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "CPU-Generic-x86-1"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66436 [ run ] triggered by Bot. Commit: 09c9350 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66436 [ run ] completed with state FAILURE. Commit: 09c9350
/LLM/main/L0_MergeRequest_PR pipeline #54076 (Partly Tested) completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@chienchunhung

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "CPU-Generic-x86-1"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66556 [ run ] triggered by Bot. Commit: 0a1aaf7 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66556 [ run ] completed with state FAILURE. Commit: 0a1aaf7
/LLM/main/L0_MergeRequest_PR pipeline #54187 (Partly Tested) completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@chienchunhung
chienchunhung force-pushed the codex/disagg-ownership-red-regressions branch from 0a1aaf7 to 4c37734 Compare August 17, 2026 20:17
@chienchunhung

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66849 [ run ] triggered by Bot. Commit: 4c37734 Link to invocation

@chienchunhung
chienchunhung force-pushed the codex/disagg-ownership-red-regressions branch from 4c37734 to 3c37cb4 Compare August 17, 2026 23:36

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "CPU-Generic-x86-1"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66895 [ run ] triggered by Bot. Commit: 3c37cb4 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66849 [ run ] completed with state ABORTED. Commit: 4c37734

Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66895 [ run ] completed with state FAILURE. Commit: 3c37cb4
/LLM/main/L0_MergeRequest_PR pipeline #54452 (Partly Tested) completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "CPU-Generic-x86-1"

@chienchunhung
chienchunhung force-pushed the codex/disagg-ownership-red-regressions branch from ea8bdfb to f27bea1 Compare August 18, 2026 01:50
Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
@chienchunhung
chienchunhung force-pushed the codex/disagg-ownership-red-regressions branch from c79720a to 6242f98 Compare September 2, 2026 19:29
@chienchunhung

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #71051 [ run ] triggered by Bot. Commit: 6242f98 Link to invocation

@chienchunhung

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #71067 [ run ] triggered by Bot. Commit: 6242f98 Link to invocation

Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #71051 [ run ] completed with state ABORTED. Commit: 6242f98

Link to invocation

@chienchunhung

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #71072 [ run ] triggered by Bot. Commit: bff832c Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #71067 [ run ] completed with state ABORTED. Commit: 6242f98

Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #71072 [ run ] completed with state FAILURE. Commit: bff832c
/LLM/main/L0_MergeRequest_PR pipeline #58224 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@chienchunhung

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #71141 [ run ] triggered by Bot. Commit: bff832c Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #71141 [ run ] completed with state FAILURE. Commit: bff832c
/LLM/main/L0_MergeRequest_PR pipeline #58282 completed with status: 'UNSTABLE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

Link to invocation

@chienchunhung

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #71299 [ run ] triggered by Bot. Commit: bff832c Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #71299 [ run ] completed with state SUCCESS. Commit: bff832c
/LLM/main/L0_MergeRequest_PR pipeline #58427 completed with status: 'SUCCESS'

CI Report

Link to invocation

@chienchunhung
chienchunhung merged commit fd79a3d into NVIDIA:main Sep 3, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants