-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[https://nvbugs/6428092][fix] Forward use_host_stop_criteria alongside host and py_result_diffs in the PP… #16133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3335,10 +3335,14 @@ def _ring_broadcast_sample_state( | |
| if not self.dist.is_last_pp_rank: | ||
| # Receive tokens from previous pp rank (w.r.t model forward direction) | ||
| with nvtx_range("recv_sample_state"): | ||
| sample_state.host, py_result_diffs = self.dist.recv_object( | ||
| src=self.dist.prev_pp_rank, | ||
| tag=tag, | ||
| ) | ||
| sample_state.host, py_result_diffs, use_host_stop_criteria = \ | ||
| self.dist.recv_object(src=self.dist.prev_pp_rank, tag=tag) | ||
|
|
||
| # Propagate use_host_stop_criteria: the last rank's fast host-stop | ||
| # path leaves host.finish_reasons=None, so non-last ranks must | ||
| # know to skip the finish_reasons indexing in update_requests. | ||
| if hasattr(sample_state, "use_host_stop_criteria"): | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| sample_state.use_host_stop_criteria = use_host_stop_criteria | ||
|
|
||
| for request, py_result_diff in zip(requests, py_result_diffs): | ||
| request.py_result.apply_diff(py_result_diff) | ||
|
|
@@ -3356,7 +3360,8 @@ def _ring_broadcast_sample_state( | |
| self.wait_on_pp_send_handles(self.send_handles, microbatch_id) | ||
| with nvtx_range("send_sample_state"): | ||
| self.send_handles[microbatch_id] = self.dist.isend_object( | ||
| (sample_state.host, py_result_diffs), | ||
| (sample_state.host, py_result_diffs, | ||
| getattr(sample_state, "use_host_stop_criteria", False)), | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need for that check |
||
| dest=self.dist.next_pp_rank, | ||
| tag=tag, | ||
| ) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for that check