Feat/distributed adaptors - #7402
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdds a networking-gated distributed bulk sender adaptor, integrates it with ChangesDistributed bulk execution
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant distributed_scheduler
participant distributed_bulk_sender
participant UpstreamSender
participant DownstreamReceiver
Caller->>distributed_scheduler: query(bulk_t, sender, shape, f)
distributed_scheduler->>distributed_bulk_sender: construct with sender, shape, f, scheduler
Caller->>distributed_bulk_sender: connect(receiver)
distributed_bulk_sender->>UpstreamSender: connect(bulk_receiver)
UpstreamSender->>distributed_bulk_sender: set_value(Ts...)
distributed_bulk_sender->>distributed_bulk_sender: invoke f(index, Ts...) for each shape index
distributed_bulk_sender->>DownstreamReceiver: forward set_value(Ts...) or set_error(exception_ptr)
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
Can one of the admins verify this patch? |
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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
`@libs/full/execution_distributed/include/hpx/execution_distributed/distributed_bulk_sender.hpp`:
- Around line 195-198: Update the bulk invocation loop in the distributed
sender’s shape-handling code to support integral shapes by iterating indices
from zero up to shape_. Preserve the existing HPX_INVOKE(f_, ..., ts...) call
for each generated index, while retaining the range-based iteration behavior for
non-integral shapes if applicable.
In `@libs/full/execution_distributed/tests/unit/distributed_bulk_test.cpp`:
- Around line 103-112: Update the catch-all handler in the bulk exception test
to explicitly fail via the test framework instead of setting caught_exception to
true. Keep success limited to the std::runtime_error("bulk_error") branch in the
existing exception handling.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b7e4f987-daa2-4eee-9ae3-1d44bcac0afb
📒 Files selected for processing (5)
libs/full/execution_distributed/CMakeLists.txtlibs/full/execution_distributed/include/hpx/execution_distributed/distributed_bulk_sender.hpplibs/full/execution_distributed/include/hpx/execution_distributed/distributed_scheduler.hpplibs/full/execution_distributed/tests/unit/CMakeLists.txtlibs/full/execution_distributed/tests/unit/distributed_bulk_test.cpp
|
Please pay attention to the comments. Also, please rebase onto master to resolve the conflicts. |
feb46f3 to
40fb69f
Compare
Done |
|
@shivansh023023 Had a read through this. The part that is easy to get wrong is right: One note on wording: the description says you implemented "the My main comment is about the tests. All five construct That would be fine for a stub, except the file comment opens with "executes data-parallel work on a remote HPX locality via the distributed_scheduler" and the "Current Status" note saying it is a local fallback sits about twenty lines further down. PR descriptions get forgotten, doc comments do not, so I would move the stub caveat to the first paragraph of the file comment. Someone reading the header a month from now should not have to reach the bottom to learn the parcelport dispatch is not there yet. Test 4 is weaker than it looks: catch (std::runtime_error const& e) { caught_exception = true; ... }
catch (...) { caught_exception = true; }
HPX_TEST(caught_exception);The catch-all means any exception passes, including one thrown before the bulk loop ever runs. If the loop silently stopped working, this test would still go green. I would drop the catch-all, or set a separate flag inside it and assert that flag stayed false, so the test can only pass for the reason it claims. Smaller things:
P2300 allows There is no constraint that Last, a process point rather than a code one: the description says "This is a Draft PR" but the PR is not marked as draft, and |
@iemAnshuman Thanks! I've updated the PR description to use the correct query terminology and marked this as a Draft. I also applied all your code feedback: the stub warning is now at the very top of the file, I added static_assert checks for invocability to catch arity errors cleanly, and added the concurrency warning to the local loop. (The exception catch-all test was also fixed in a recent push!). Let me know if the baseline looks solid to start building the parcelport dispatch. |
baseline looks good! One thing did not make it into the push. The catch-all is still there: catch (...) Before the dispatch work, I would point one test at a remote locality. Every test still uses find_here(), so once the local loop is gone you will have nothing that can tell you whether real dispatch works. LOCALITIES 2 is already in the CMake entry. |
|
@iemAnshuman I've fixed it to explicitly fail the test now. I also updated test_bulk_integral_shape to target hpx::find_remote_localities()[0] instead of the local node, so it's ready to actually test the network dispatch once the stub is replaced. |
…00 interoperability Signed-off-by: Shivansh Singh <singhshivansh023@gmail.com>
Signed-off-by: Shivansh Singh <singhshivansh023@gmail.com>
…k_sender loop Signed-off-by: Shivansh Singh <singhshivansh023@gmail.com>
…lk_sender documentation and constraints Signed-off-by: Shivansh Singh <singhshivansh023@gmail.com>
…d remote locality target Signed-off-by: Shivansh Singh <singhshivansh023@gmail.com>
Signed-off-by: Shivansh Singh <singhshivansh023@gmail.com>
c43c356 to
d66bc0a
Compare
…xecute for action dispatch Signed-off-by: Shivansh Singh <singhshivansh023@gmail.com>
…ync dispatch for distributed_bulk_sender Signed-off-by: Shivansh Singh <singhshivansh023@gmail.com>
…dependency Signed-off-by: Shivansh Singh <singhshivansh023@gmail.com>
|
@hkaiser @iemAnshuman I got the remote network dispatch working for distributed_bulk. Since HPX_DEFINE_PLAIN_ACTION struggles with the variadic Ts... arguments, I ended up packing the upstream values into an hpx::tuple and manually defining the action struct using hpx::actions::make_action_t. Inside set_value, it now checks target_locality_ and either executes directly or dispatches over the network via hpx::async. Tested it locally with --hpx:localities=2 and it passes cleanly. Let me know if this architecture looks good to you! |
|
@shivansh023023 i would not move the whole receiver yet. The errors are all in 'get_env': its 'auto' return type forces Clang to instantiate the body while 'operation_state' is incomplete give 'get_env' an explicit return type and, if needed, define it after 'operation_state' is complete. The other cpo can remain inline. Moving the receiver while it still holds an 'operation_state&' would not break the cycle. |
Proposed Changes
distributed_bulk_senderwith standard P2300 environment queries and completion signatures.queryhook forex::bulkto intercept executions on thedistributed_scheduler.forloop inside the receiver as a fallback/stub for testing the CPO routing.distributed_bulk_test.cpp) covering shape iteration, value propagation, zero-shape handling, and exception forwarding.Any background context you want to provide?
This is a Draft PR to lay the foundation for
distributed_bulkwithin theexecution_distributedmodule. The current implementation successfully intercepts the CPO and processes the bulk execution locally. The immediate next step is to replace the local fallback loop with the actual parcelport dispatch logic usinghpx::actionsto achieve true remote distributed data-parallel execution.Checklist
Not all points below apply to all pull requests.