Skip to content

refactor(distributed): make handle_fn and launch_nowait share the call halves - #297

Closed
haonan3 wants to merge 1 commit into
mainfrom
refactor/handle-call-halves
Closed

refactor(distributed): make handle_fn and launch_nowait share the call halves#297
haonan3 wants to merge 1 commit into
mainfrom
refactor/handle-call-halves

Conversation

@haonan3

@haonan3 haonan3 commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Extract _launch_half (dispatch → localize → execute) and _collect_half (ray.get → rebind → collect) on Handle; handle_fn, launch_nowait, and PendingHandleCall.result now sequence the same two methods instead of carrying keep-in-parity copies — the "keep the halves in parity" comment convention (#287's own listed follow-up) is deleted. No behavior change: the grad-context preamble/postamble stays in handle_fn; launch_nowait stays grad_mode=False/call_id=None.

Split out of #295 per review: this is a distributed-RPC-layer change with its own reviewers and regression surface, independent of the rollout refactor that consumes the seam.

Related Issue

N/A (follow-up to #287).

Test Plan

  • ruff format --check + ruff check over unirl/distributed/group/handle.py — clean; python3 -m compileall — clean.
  • Pure extraction verified by line-diff: both halves are byte-identical to the previous inline bodies; call sites are thin sequencing.
  • GPU: Not run; reason: CPU-only dev box. Any sync + async smoke exercises both entries (handle_fn on every @distributed call; launch_nowait on the async trainers); the refactor(rollout): dedup async driver plumbing; extract ToolAgentHarness #295 validation trio covers it.

Compatibility / Risk

No public surface change; _execute_all/_rebind_tree/_method_configs untouched. Riskiest spot: none identified — the halves are verbatim relocations.

Reviewer Notes

AI-assisted (Claude Code). Suggested land order: this → #294#295 (all touch adjacent layers; each rebases mechanically).

Checklist

  • I reviewed the changed code and removed unrelated/generated artifacts.
  • I updated tests, docs, and configs where needed, or explained why not.

…l halves

Extract _launch_half (dispatch -> localize -> execute) and _collect_half
(ray.get -> rebind -> collect) on Handle; handle_fn, launch_nowait, and
PendingHandleCall.result now sequence the same two methods instead of
carrying keep-in-parity copies. No behavior change: the grad-context
preamble/postamble stays in handle_fn, launch_nowait stays
grad_mode=False/call_id=None.
@github-actions github-actions Bot added the wip Draft / work in progress label Aug 2, 2026
@haonan3

haonan3 commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator Author

Folding back into #295 per team decision — the handle-halves commit stays cleanly separated as that PR's first commit; reviewers can review it per-commit there.

@haonan3 haonan3 closed this Aug 2, 2026
@github-actions github-actions Bot removed the wip Draft / work in progress label Aug 2, 2026
@haonan3
haonan3 deleted the refactor/handle-call-halves branch August 2, 2026 15:05
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