Add: carry an endpoint deployment on Global CommDomain members - #1876
Add: carry an endpoint deployment on Global CommDomain members#1876sunkaixuan2018 wants to merge 1 commit into
Conversation
A `GlobalDomainMember` was four tree positions -- node and local worker ids, global device rank, domain rank -- none of which said what the endpoint is deployed on. The backing a member's window is carved from is derived from its deployment (`comm_endpoints._backend_kind_for_provider`), so without the field a member's semantics are welded to one tree level and a host or AICPU participant has no spelling at all. - `GlobalDomainMember` gains an `EndpointDeployment`, normalized at construction so the identity check and the wire-id lookup agree -- `EndpointDeployment` subclasses `str`, so an un-normalized value would encode yet fail validation - The member wire carries it as a u32 ordinal from an explicit table, mirroring `GLOBAL_DOMAIN_PROFILE_IDS`; enum declaration order is not a wire contract - `validate_member_table` admits only `DEVICE_AICORE`, stated in terms of backing rather than level: no host-mappable window backing exists, because `halHostRegister` refuses a VMM VA - `Worker` resolves the deployment from the registered L3 node, so `allocate_global_domain` keeps its member tuple and no example changes `GLOBAL_DOMAIN_VERSION` guarded four unrelated layouts at once, including the descriptor the platform backend stamps with `COMM_GLOBAL_DOMAIN_VERSION`. Advancing it for a Python-only field addition would have failed every allocation at PREPARE. The L4<->L3 commands now carry their own `GLOBAL_DOMAIN_COMMAND_VERSION`, so a stale peer reports a version mismatch rather than a truncated wire, and the backend-paired constant stays at 1.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review. 📝 WalkthroughWalkthroughGlobal CommDomain members now include ChangesGlobal CommDomain deployment metadata
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This localized change adds endpoint deployment metadata without changing behavior, and the reported validation is passing. No actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant Worker
participant GlobalDomainMember
participant MemberTable
participant GlobalDomainWireCodec
Worker->>GlobalDomainMember: assign registered EndpointDeployment
GlobalDomainMember->>MemberTable: validate deployment
MemberTable-->>GlobalDomainMember: accept DEVICE_AICORE
GlobalDomainMember->>GlobalDomainWireCodec: encode deployment ID
GlobalDomainWireCodec-->>GlobalDomainMember: decode deployment ID
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Reviewed at Before anything else: the premise this PR implements was overturned four days ago, and that is my fault, not yours. #1836's body still says "add a deployment to members" because I never pushed the correction. Our internal notes have recorded since 2026-08-14 that the issue body is half-wrong and that corrected wording was pending my action — and you did the honest thing, which is implement the issue as written. The design ruling landed after I filed it. So please read what follows as "the target moved", not "you misread the target". What the ruling says, and why I think it holdsThe conclusion was that the dimension does not belong on ①
So the field is set to a constant, validated to be that constant, encoded, decoded, and — this is the part that matters — never read to make a decision. Its only consumers in the repo are the four sites that maintain it: normalize ( ② The The window is carved by the platform backend via ③ What's actually missing is an attachment axis. #1770 already landed the right shape: Authority is The version split is genuinely good and should surviveIndependent of all of the above, splitting
Your reasoning in the body is right and worth preserving in a comment: one constant was guarding four unrelated layouts, and bumping it for a Python-only change would have failed every allocation at PREPARE with a descriptor-version mismatch unless the C++ macro moved in lockstep. That was a trap and you disarmed it. Two more things I want to credit specifically:
The test coverage is also better than the change strictly needed: round-trip, normalization, non-device rejection, unknown-wire-id rejection, and command-version independence. What I suggest
I will correct #1836 — retitle it to the attachment axis, drop the overturned motivation, and rewrite the proposed fix — before anyone else picks it up. VerdictNeeds discussion, on the premise rather than the code. If we only had the version split and the normalization insight, this would be a clean approve. I'm sorry for the wasted round. The specific process failure was mine: our notes flagged #1836's body as publicly wrong and pending correction, and I left it sitting there where you could reasonably act on it. |
|
I've corrected #1836 — retitled to the attachment axis, dropped the overturned motivation, rewrote the proposed fix, and added a changelog comment explaining the delta. Before doing that I re-verified the design ruling's three reasons against
I also went looking for a reason to keep the field, and specifically checked whether removing it would cost a version bump — it would not. Two ways forward — your call, and I'd take eitherA — Narrow this PR. Keep the version split, the normalization fix, and the docs framing that a member is an endpoint rather than a tree position. Drop the B — Split into two. Land the version split as its own PR; close the deployment half. I lean B. The version split is independently valuable and I'd approve it on sight — it disarms a real trap (one constant guarding four unrelated layouts, where a Python-only bump would have failed every allocation at PREPARE with a descriptor-version mismatch). It shouldn't have to wait on a premise argument it has nothing to do with. And as its own PR the commit message can say what it fixes, instead of being a subsection of a change that got retargeted. Either way, please move If you want the follow-upThe attachment work is described in the rewritten #1836, but read the prerequisites section before starting: it has two prerequisites, not one. Nothing about the quality of this PR is in question. 1531 unit tests, sim, real hardware through |
|
Closing in favour of the split you suggested (option B), and thank you for the review — the three reasons hold and I verified each on the branch rather than taking them on trust. The Your ① is also right in a way I should have caught before opening: I've since seen that #1879 landed the attachment axis, so the follow-up is already covered — good, and it makes the case for retargeting rather than narrowing even clearer. The version split is now #1885, rebased onto
One thing I deliberately left out of #1885, in case you disagree: the No follow-up needed on the attachment work from me — but thank you for the prerequisites writeup on |
Summary
A
GlobalDomainMemberwas four tree positions — node and local worker ids, global device rank, domain rank — none of which said what the endpoint is deployed on. The backing a member's window is carved from is derived from its deployment (comm_endpoints._backend_kind_for_provider), so without the field a member's semantics are welded to one tree level, and aHOST_CPUparticipant or the two deployment views of one chip have no spelling at all.Placeholder-only, as the issue specifies: the dimension is added, exactly one value is accepted, behavior does not change.
GlobalDomainMembergains anEndpointDeployment, imported fromcomm_endpointsrather than redefined. It is normalized at construction becauseEndpointDeploymentsubclassesstr— an un-normalized value would be found by the wire-id table yet rejected byvalidate_member_table's identity check, so the encoder and the validator would disagree about the same value.u32ordinal from an explicit table, mirroringGLOBAL_DOMAIN_PROFILE_IDS. Enum declaration order is not a wire contract, so the mapping is stated rather than derived.validate_member_tableadmits onlyDEVICE_AICORE, and says so in terms of backing rather than level: no host-mappable window backing is implemented, becausehalHostRegisterrefuses a VMM VA.Workerresolves the deployment from the registered L3 node rather than the caller, soallocate_global_domain(members=[(l3_id, l2_index), ...])keeps its signature and no example changes.docs/comm-domain.mdstates the invariant instead of leaving a reader to infer member semantics from the tuple shape.Why a second version constant
GLOBAL_DOMAIN_VERSIONguarded four unrelated layouts at once: the L4↔L3 commands, theLOCAL_*L3→L2 mailbox structs, the release/copy commands, and the descriptor — which the platform backend stamps withCOMM_GLOBAL_DOMAIN_VERSIONinsrc/common/platform_comm/comm.hand Python checks on decode. Advancing that constant for a Python-only field addition would have failed every allocation at PREPARE withglobal domain descriptor version mismatch, unless the C++ macro moved in lockstep and every runtime was rebuilt.The L4↔L3 commands now carry their own
GLOBAL_DOMAIN_COMMAND_VERSION = 2, so a stale peer reports a version mismatch instead of a confusing truncated-wire error, and the backend-paired constant stays at 1. No C++ changes —src/is untouched, and the member table never reaches the device (the L3→L2LOCAL_PREPARE_REQUESTcarries onlydomain_rankandrank_count).Testing
Validated on an Ascend910 V1 host; onboard runs went through
task-submit.pytest tests/ut -m "not requires_hardware": 1486 passedsimpler.remote_l3_workerdaemons over TCP, plus the mixed local/remote and MPI-group pathstests/st --platform a2a3sim: 64 passed, 0 failedpytest tests/ut -m requires_hardware --platform a2a3: 6/6 passed, includingtest_two_rank_comm_lifecycleandtest_two_rank_allocate_release_round_triptests/st/worker --platform a2a3: 12/12 PASS, includingTestAsyncNotifyDemo, which declares no sim variantNew unit cases cover the deployment round-tripping on the wire, construction-time normalization, rejection of a non-
DEVICE_AICOREmember, rejection of an unknown deployment id arriving on the wire, and the command version being independent of the backend-stamped descriptor version.Scope
Deliberately excluded, per the issue: no
EndpointId/session_id/worker_path, no member selector, no capability computation. The two follow-ups that share this root cause —CommBufferSpecbeing an offset slice of one window rather than an independent Buffer, andcomm_profilebeing one node-level string — are breaking changes that need the endpoint registry to be load-bearing first.Fixes #1836