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

Improve cluster plotting GPU utilization #3262

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

nazar-pc
Copy link
Member

This allows farmer to buffer the whole sector in memory in case disk is not fast enough to write, which will release plotting resources on the other end and allow plotter to start plotting other sectors, potentially for a completely different machine.

Code contributor checklist:

@nazar-pc nazar-pc requested a review from rg3l3dr as a code owner November 26, 2024 14:57
Base automatically changed from improve-piece-downloading to main November 26, 2024 22:39
teor2345
teor2345 previously approved these changes Nov 26, 2024
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

I think this is ok, but can you double-check that the channel size will always be 1 or more?

// Allow to buffer up to the whole sector in memory to not block plotter on the
// other side
let (mut sector_sender, sector_receiver) = mpsc::channel(
sector_size(pieces_in_sector) / nats_client.approximate_max_message_size(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there an edge case here where the sector size is very small, and the message size is very large?

I didn’t do the calculations in detail, but I think that we can get a situation where sector size is around 1 MB, and message size is 2 MB? Which would panic due to a zero-sized channel.

If the minimum number of pieces per sector is high enough, and the upper limit on the message size is low enough, this won’t be a problem, but I’m not familiar enough with this code to know.

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 is unlikely, but possible. Good catch, thanks!

@nazar-pc nazar-pc added this pull request to the merge queue Nov 27, 2024
Merged via the queue into main with commit b1900bb Nov 27, 2024
8 checks passed
@nazar-pc nazar-pc deleted the improve-cluster-plotting-gpu-utilization branch November 27, 2024 11:09
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.

3 participants