Skip to content
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

overhaul timeouts for Lighthouse, Manager, checkpoint server #73

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

d4l3k
Copy link
Member

@d4l3k d4l3k commented Jan 15, 2025

This overhauls the timeouts for all network operations to allow for long quorum timeouts in a safer way.

Notable changes:

  • removes timeout from the Endpoint/Channel/Client in favor of using keep alives + server based timeouts
  • adds timeouts to CheckpointServer
  • requires timeouts to be passed for all Rust operations
  • adds a new quorum_timeout field to Manager py so you can have a much longer quorum timeout

Test plan:

pytest
cargo test

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jan 15, 2025
@d4l3k d4l3k force-pushed the d4l3k/timeout_overhaul branch from e82057c to 663a292 Compare January 15, 2025 23:31
@d4l3k d4l3k marked this pull request as ready for review January 16, 2025 00:07
timeout.
timeout: the default timeout for all operations
Included:
* collectives such as allreduce
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesnt seem like it currently applies to allreduce

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does since the future from allreduce is wrapped via wrap_future which sets a timeout on the future

src/net.rs Outdated
max_backoff: Duration::from_secs(10),
timeout: connect_timeout,
factor: 1.5,
jitter: Duration::from_millis(100),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should jitter be random?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh this is max jitter

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed for clarity

Copy link
Collaborator

@Jackmin801 Jackmin801 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. try_parse_grpc_timeout still seems magic to me but all good if it works!

src/lib.rs Outdated
py.allow_threads(move || {
let runtime = Runtime::new()?;
let client = runtime
.block_on(manager::manager_client_new(addr, timeout))
.block_on(manager::manager_client_new(addr, Duration::from_secs(60)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you want to move these constants out or parameterize later?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a connect_timeout setting to Manager+ManagerClient, really should have done this a while back :)


self.send_response(200)
self.send_header(
"Content-type", "tensor"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

application/octet-stream?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just wrapped this in a try catch but changed

@d4l3k d4l3k force-pushed the d4l3k/timeout_overhaul branch from 663a292 to 4537a5a Compare January 16, 2025 18:54
@d4l3k d4l3k merged commit 3ee2360 into main Jan 16, 2025
6 checks passed
@d4l3k d4l3k deleted the d4l3k/timeout_overhaul branch January 16, 2025 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants