[None][fix] Guard Python KV receive ownership and publication - #17720
[None][fix] Guard Python KV receive ownership and publication#17720chienchunhung wants to merge 10 commits into
Conversation
|
/bot run --disable-fail-fast --stage-list "A10-PyTorch-1, A10-PyTorch-2, A10-PyTorch-3" |
|
PR_Github #66363 [ run ] triggered by Bot. Commit: |
|
/bot run --stage-list "CPU-Generic-x86-1" |
|
PR_Github #66377 [ run ] triggered by Bot. Commit: |
|
PR_Github #66363 [ run ] completed with state |
905fb53 to
0304618
Compare
|
/bot run --stage-list "CPU-Generic-x86-1" |
|
PR_Github #66385 [ run ] triggered by Bot. Commit: |
|
PR_Github #66377 [ run ] completed with state |
|
PR_Github #66385 [ run ] completed with state
|
|
/bot run --stage-list "CPU-Generic-x86-1" |
2 similar comments
|
/bot run --stage-list "CPU-Generic-x86-1" |
|
/bot run --stage-list "CPU-Generic-x86-1" |
|
PR_Github #66436 [ run ] triggered by Bot. Commit: |
|
PR_Github #66436 [ run ] completed with state
|
|
/bot run --stage-list "CPU-Generic-x86-1" |
|
PR_Github #66556 [ run ] triggered by Bot. Commit: |
|
PR_Github #66556 [ run ] completed with state
|
0a1aaf7 to
4c37734
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #66849 [ run ] triggered by Bot. Commit: |
4c37734 to
3c37cb4
Compare
|
/bot run --stage-list "CPU-Generic-x86-1" |
|
PR_Github #66895 [ run ] triggered by Bot. Commit: |
|
PR_Github #66849 [ run ] completed with state |
|
PR_Github #66895 [ run ] completed with state
|
|
/bot run --stage-list "CPU-Generic-x86-1" |
ea8bdfb to
f27bea1
Compare
|
PR_Github #70797 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #71025 [ run ] triggered by Bot. Commit: |
|
PR_Github #71025 [ run ] completed with state
|
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>
c79720a to
6242f98
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #71051 [ run ] triggered by Bot. Commit: |
|
/bot run --disable-fail-fast |
|
PR_Github #71067 [ run ] triggered by Bot. Commit: |
Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
|
PR_Github #71051 [ run ] completed with state |
|
/bot run --disable-fail-fast |
|
PR_Github #71072 [ run ] triggered by Bot. Commit: |
|
PR_Github #71067 [ run ] completed with state |
|
PR_Github #71072 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #71141 [ run ] triggered by Bot. Commit: |
|
PR_Github #71141 [ run ] completed with state
|
Design position
DBR-PR1 — receive-side ownership foundation. This PR adds the GEN-side physical-ownership and publication primitive required by deadline-bounded KV transfer retirement.
It is intentionally dormant on its own:
enforce_physical_ownershipdefaults toFalse, and this PR adds no public configuration, factory wiring, source ownership, quiescence deadline, endpoint fail-close, or supported production topology.The immediate follow-up is #18041 (DBR-PR2), which adds narrow CTX source ownership and activates both local owners for one qualified no-retry Python/NIXL FP4-MLA cell. Typed backend evidence, the non-resettable quiescence clock, and rank-aligned fail-close/restart remain DBR-PR3 through DBR-PR5.
Problem
The Python KV receive path can make a request logically terminal while transport or local CUDA work may still access its destination. That creates these deterministic hazards:
REQUEST_DATApublication, so the sender observes cancellation before the delayed request.REQUEST_DATAsend can stall terminal-result processing.Safety boundary implemented here
For an ownership-enabled receive session, destination reuse is allowed only when:
Logical failure or cancellation does not erase a live writer claim. Invalid or incomplete evidence does not authorize release. This is a local receive-side invariant; it does not yet provide sender-side backend-DONE retention or deadline-bounded endpoint recovery.
What changes
RxSessionstate lock, but perform network sends under a separate protocol-order lock so result handling remains live and cancellation cannot overtake publication.REQUEST_DATAfan-out returns successfully.resources_drained()is true.flowchart LR U["Destination unpublished"] --> G{"Cancellation / publication gate"} G -- "cancel wins" --> S["SAFE_UNPUBLISHED<br/>no writer authorized"] S --> R["Release reservation"] G -- "publication wins" --> C["Seal writer cohort"] 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["Receive owner drained<br/>reuse may proceed"]Regression-first history
c66afdab1, contains the three deterministic motivating regressions only.12d40c2a9, adds the dormant receive-side fix and three compatibility regressions.7e247c32f, adds and fixes the cancel-before-dispatch idempotency regression.7a378d62f, hardens publication ordering, cohort authorization, close refusal, and cross-rank drain consensus, bringing the focused CPU suite to ten tests.c3ab2cc98, prevents shutdown from dropping an active receive owner, bringing the focused CPU suite to eleven tests.Historical RED evidence:
CPU-Generic-x86-1PR_Github #66895 / pipeline #54452 reproduced the three original hazards on a test-only predecessor snapshot. It is motivation evidence, not patch-equivalent evidence for commit 1.Predecessor-head GREEN evidence:
CPU-Generic-x86-1PR_Github #67564 / pipeline #55055 passed atd371644d8with the first six regressions and compatibility cases. Current headc3ab2cc98has eleven focused tests; full current-head CI is pending.Change size
+498/-125acrosstransfer.pyandtransceiver.py.+592/-0in one CPU regression file.+1,090/-125across three files.Deferred
This PR does not add CTX source or exact backend-handle ownership, production activation, timeout/quiescence clocks, late-settlement typing, rank-aligned fail-close/restart, retry or reroute identity, broad topology/backend qualification, in-flight cancellation, or C++ parity.
#18041 is the narrow activation bridge. The remaining deadline-bounded retirement and generalization work stays in DBR-PR3 through DBR-PR8.
Dev Engineer Review
resources_drained()succeeds.RxSession.mark_transferring()with an optionalwriter_cohortargument.QA Engineer Review
Added these test functions:
test_failed_writer_cannot_authorize_reuse_while_sibling_is_active()test_pre_cancelled_rx_session_never_publishes_destination()test_remote_cancel_resolves_strong_owned_session()test_remote_cancelled_session_is_retained_until_writers_drain()test_failed_receive_session_is_retained_until_writers_drain()test_failed_receive_consensus_waits_for_every_rank_to_drain()test_non_terminal_writer_result_does_not_authorize_reuse()test_partial_publication_failure_quarantines_destination()test_out_of_cohort_writer_cannot_authorize_reuse()test_cancel_after_publication_cannot_overtake_request_data()test_cancel_before_dispatch_releases_late_idle_reservation()test_cancel_request_retains_session_when_close_refuses()test_collect_done_waits_for_physical_drain()test_shutdown_refuses_to_drop_active_receive_owner()No files under
tests/integration/test_lists/were modified. These tests are not covered by entries intest-db/orqa/.Verdict: insufficient.