Add: support mixed local and remote L4 CommDomains - #1456
Conversation
📝 WalkthroughWalkthroughThis change adds Global CommDomain support across remote L3 workers, including wire codecs, transactional allocation and cleanup, simulation and A3 backend implementations, Python APIs, remote control handling, tests, and end-to-end smoke workflows. ChangesGlobal CommDomain
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
tests/ut/py/test_global_comm_domain.py (1)
176-189: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winFixed
time.sleep(0.3)daemon warmup is racy.worker.init()connects to the freshly spawned daemons, but there is no guarantee they have bound their ports within 300 ms on a loaded CI host, which can cause intermittent connection failures. Consider polling each(127.0.0.1, port)for accept-readiness (short connect-retry loop with a bounded deadline) beforeadd_remote_worker/initinstead of a static sleep.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/ut/py/test_global_comm_domain.py` around lines 176 - 189, Replace the fixed time.sleep(0.3) in the worker setup test with bounded polling that attempts short TCP connections to each 127.0.0.1 port until all daemons accept connections or a deadline is reached. Perform this readiness check before the add_remote_worker calls and worker.init(), and fail clearly if any daemon remains unavailable.src/common/platform_comm/comm.h (1)
48-57: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winPin the descriptor ABI used by the wire codec.
ChipWorker::comm_global_domain_prepareserializessizeof(CommGlobalDomainDescriptor), while the Python wire contract fixes this descriptor at 288 bytes. Add size/offsetstatic_asserts or explicit field serialization so compiler packing changes cannot silently break remote imports.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/common/platform_comm/comm.h` around lines 48 - 57, Pin the CommGlobalDomainDescriptor wire layout used by ChipWorker::comm_global_domain_prepare: add compile-time size and field-offset assertions matching the 288-byte Python contract, including the handle field, so packing changes fail at build time rather than altering serialized imports.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/remote-l3-worker-design/implementation-record.md`:
- Around line 91-94: Update the L4-brokered Global CommDomain setup description
to state that domains are released after the L4 DAG drain by default, while
explicitly noting that retain_after_run=True preserves them for a later run.
In `@python/simpler/task_interface.py`:
- Around line 910-921: Sort the entries alphabetically in both __slots__ tuples
in the relevant classes, including the declaration containing name and members
and the second declaration around the referenced location, while preserving
every existing slot name.
- Around line 975-979: Update release so _released is set to True only after
_release_fn(self) completes successfully. If the remote cleanup raises,
propagate the error while leaving the handle unreleased so a later release()
retries the cleanup.
---
Nitpick comments:
In `@src/common/platform_comm/comm.h`:
- Around line 48-57: Pin the CommGlobalDomainDescriptor wire layout used by
ChipWorker::comm_global_domain_prepare: add compile-time size and field-offset
assertions matching the 288-byte Python contract, including the handle field, so
packing changes fail at build time rather than altering serialized imports.
In `@tests/ut/py/test_global_comm_domain.py`:
- Around line 176-189: Replace the fixed time.sleep(0.3) in the worker setup
test with bounded polling that attempts short TCP connections to each 127.0.0.1
port until all daemons accept connections or a deadline is reached. Perform this
readiness check before the add_remote_worker calls and worker.init(), and fail
clearly if any daemon remains unavailable.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f217e7f8-c970-4de9-9e33-aa5539b441f5
📒 Files selected for processing (41)
docs/comm-domain.mddocs/remote-l3-worker-design.mddocs/remote-l3-worker-design/implementation-record.mddocs/remote-l3-worker-design/protocol.mdpython/bindings/CMakeLists.txtpython/bindings/task_interface.cpppython/bindings/worker_bind.hpython/simpler/global_comm_domain.pypython/simpler/global_comm_smoke.pypython/simpler/orchestrator.pypython/simpler/remote_l3_protocol.pypython/simpler/remote_l3_session.pypython/simpler/remote_l3_worker.pypython/simpler/task_interface.pypython/simpler/worker.pysrc/a2a3/platform/onboard/host/comm_hccl.cppsrc/a5/platform/onboard/host/comm_hccl.cppsrc/common/hierarchical/remote_endpoint.cppsrc/common/hierarchical/remote_endpoint.hsrc/common/hierarchical/remote_wire.cppsrc/common/hierarchical/remote_wire.hsrc/common/hierarchical/worker.hsrc/common/hierarchical/worker_manager.cppsrc/common/hierarchical/worker_manager.hsrc/common/platform_comm/comm.hsrc/common/platform_comm/comm_sim.cppsrc/common/worker/chip_worker.cppsrc/common/worker/chip_worker.htests/ut/py/test_callable_identity.pytests/ut/py/test_global_comm_domain.pytools/a3_l4_tcp_smoke/README.mdtools/a3_l4_tcp_smoke/compute_then_tload_smoke.pytools/a3_l4_tcp_smoke/global_tload_smoke.pytools/a3_l4_tcp_smoke/kernels/aiv/global_tload_kernel.cpptools/a3_l4_tcp_smoke/kernels/aiv/local_add_kernel.cpptools/a3_l4_tcp_smoke/kernels/orchestration/global_tload_orch.cpptools/a3_l4_tcp_smoke/kernels/orchestration/local_add_orch.cpptools/remote_l4_npu/README.mdtools/remote_l4_npu/remote_l4_npu_smoke.pytools/remote_l4_npu/run_parent_smoke.shtools/remote_l4_npu/start_machine_daemon.sh
a49e5f4 to
d7afa04
Compare
|
Also addressed the two CodeRabbit nitpicks listed in the review summary:
|
e8bfbf8 to
cd902af
Compare
3f0ba5a to
32f8fe6
Compare
32f8fe6 to
d909364
Compare
- Relay rank-ordered Fabric descriptors through L4 to local and remote L3 nodes - Route local Global CommDomain control through NEXT_LEVEL mailboxes - Reject unsupported platform/profile capabilities before allocation and at COMM_INIT - Make same-name release tracking identity-safe and release failures terminal - Replace message matching with a dedicated childless-buffer exception - Add transaction failure injection plus remote, mixed-node, compute, and communication smokes - Document no-mpirun setup and retained Global CommDomain lifetimes Co-authored-by: Leaf-Salix <2503954024@qq.com>
d909364 to
34c8b74
Compare
Summary
mpirun.add_worker) and TCP-connected remote L3 workers (add_remote_worker).sim, real A2/A3 acceptsa3-fabric-v1, and unsupported platform/profile pairs are rejected beforePREPAREand again at L3COMM_INIT.Testing
34c8b742: removed the obsoleteCallConfig.block_dimassignment found by the two-machine group-compute validation. Local runtime tests and builds were intentionally not run because this workstation has no target test environment; the group-compute smoke is pending a remote rerun.git diff --check.d909364a: focused tests passed (104 passed), including capability and PREPARE/IMPORT/COMMIT/ABORT failure injection. Two-host Global TLOAD, compute-then-TLOAD, and mixed local/remote L3 peer-TLOAD passed with every reportedmax_diff=0and nompirun.d909364a, the group-compute smoke stopped before remote dispatch because the removedCallConfig.block_dimfield was still assigned by the smoke. Current head deletes that single stale assignment; no runtime implementation changed.