Skip to content

Commit

Permalink
Merge pull request #3262 from autonomys/improve-cluster-plotting-gpu-…
Browse files Browse the repository at this point in the history
…utilization

Improve cluster plotting GPU utilization
  • Loading branch information
nazar-pc authored Nov 27, 2024
2 parents 239d791 + 4728e4b commit b1900bb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/subspace-farmer/src/cluster/plotter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use std::time::{Duration, Instant};
use subspace_core_primitives::sectors::SectorIndex;
use subspace_core_primitives::PublicKey;
use subspace_farmer_components::plotting::PlottedSector;
use subspace_farmer_components::sector::sector_size;
use subspace_farmer_components::FarmerProtocolInfo;
use tokio::sync::{OwnedSemaphorePermit, Semaphore};
use tokio::time::MissedTickBehavior;
Expand Down Expand Up @@ -380,7 +381,12 @@ impl ClusterPlotter {
}
};

let (mut sector_sender, sector_receiver) = mpsc::channel(1);
// 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())
.max(1),
);
let mut maybe_sector_receiver = Some(sector_receiver);
loop {
match tokio::time::timeout(PING_TIMEOUT, response_stream.next()).await {
Expand Down

0 comments on commit b1900bb

Please sign in to comment.