Skip to content

[None][fix] Retain Python KV source ownership through backend quiescence - #17981

Draft
chienchunhung wants to merge 5 commits into
NVIDIA:mainfrom
chienchunhung:codex/disagg-kv-ownership-p1-3-sender-liveness
Draft

chienchunhung wants to merge 5 commits into
NVIDIA:mainfrom
chienchunhung:codex/disagg-kv-ownership-p1-3-sender-liveness

Conversation

@chienchunhung

@chienchunhung chienchunhung commented Aug 19, 2026 •

Copy link
Copy Markdown
Collaborator

Stack position

Phase1-PR3 of 5. Depends on #17979 (Phase1-PR2). This layer remains dormant.

  1. Phase1-PR1: [None][fix] Guard Python KV receive ownership and publication #17720 — receive ownership and publication gate
  2. Phase1-PR2: [None][fix] Correlate Python KV receive evidence by generation #17979 — process-local receive-evidence generation
  3. Phase1-PR3: [None][fix] Retain Python KV source ownership through backend quiescence #17981 — CTX source ownership and backend quiescence
  4. Phase1-PR4: [None][fix] Contain ambiguous Python KV retirement and shutdown #17982 — ambiguous retirement and shutdown containment
  5. Phase1-PR5: [None][fix] Qualify Python KV physical ownership for context-first #17983 — activation, fail-closed qualification, and H100 canary

The stack is linear on current main@586d84cdc; because fork heads cannot be upstream PR bases, each PR targets main. Review only d375be8f2...9c3b2db43.

Problem and change

PR1–PR2 protect GEN destination publication and correlate receive evidence, but CTX source memory can still be retired from aggregate logical state rather than exact backend liveness.

This PR adds dormant CTX-side physical ownership for Python KV source operations:

  • serializes cancellation with source-operation admission;
  • roots the exact backend request before submission can become ambiguous;
  • retires source ownership only after positive completion evidence;
  • preserves ownership on submission exceptions and failed waits;
  • suppresses duplicate REQUEST_DATA submission;
  • prevents logical completion from hiding active source access; and
  • retains TxSession and transceiver state until every owned source operation drains.

Timeout/IN_DOUBT containment, executor retirement, and transactional shutdown remain Phase1-PR4. Activation and qualification remain Phase1-PR5.

Validation

Focused CPU regressions cover sibling writers, cancellation/admission ordering, unsubmitted failure settlement, duplicate request data, backend-success ordering, submit ambiguity, failed-wait retention (including bounce slots), close retention, and default-off compatibility.

Repeated TRT-LLM code-owner self-review is clean. ruff, formatting, Python compilation, and git diff --check pass. Runtime pytest is unavailable locally; CI was not triggered for stack construction.

Isolated change size

Area Insertions Deletions Changed lines
Production 529 110 639
Tests 442 0 442
Total 971 110 1,081

Deferred

Timeout and ambiguous evidence, executor/allocator retirement, shutdown containment, and all production activation remain in Phase1-PR4/PR5. Retry/replay, distributed identity, broader Python topology, leases, reroute, and C++ remain later phases.

@chienchunhung
chienchunhung force-pushed the codex/disagg-kv-ownership-p1-3-sender-liveness branch from 9c3b2db to b23b56f Compare August 20, 2026 22:35

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant