Skip to content

Commit 0578574

Browse files
pablorfb-metafacebook-github-bot
authored andcommitted
Fix number of messages being waited on (#855)
Summary: Pull Request resolved: #855 Previously we were not waiting for all messages being casted (missing GPU) Suprisingly this caused the job to hang Differential Revision: D80187064
1 parent 8c62bec commit 0578574

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

hyperactor_mesh/benches/main.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use criterion::Criterion;
1313
use criterion::Throughput;
1414
use criterion::criterion_group;
1515
use criterion::criterion_main;
16+
use hyperactor::proc;
1617
use hyperactor_mesh::ProcMesh;
1718
use hyperactor_mesh::actor_mesh::ActorMesh;
1819
use hyperactor_mesh::actor_mesh::RootActorMesh;
@@ -74,8 +75,13 @@ fn bench_actor_scaling(c: &mut Criterion) {
7475
.unwrap();
7576

7677
let mut msg_rcv = 0;
77-
while msg_rcv < host_count {
78-
let _ = rx.recv().await.unwrap();
78+
while msg_rcv < host_count * 8 {
79+
tokio::select! {
80+
_ = rx.recv() => {}
81+
_ = tokio::time::sleep(Duration::from_secs(10)) => {
82+
panic!("Timed out. Expected {} messages but got {}", host_count, msg_rcv);
83+
}
84+
}
7985
msg_rcv += 1;
8086
}
8187
}
@@ -89,7 +95,7 @@ fn bench_actor_scaling(c: &mut Criterion) {
8995
.await
9096
.expect("Failed to stop allocator");
9197
elapsed
92-
});
98+
})
9399
});
94100
}
95101

@@ -154,6 +160,7 @@ fn bench_actor_mesh_message_sizes(c: &mut Criterion) {
154160
let payload = vec![0u8; message_size];
155161

156162
actor_mesh
163+
157164
.cast(
158165
client,
159166
all(true_()),
@@ -167,7 +174,12 @@ fn bench_actor_mesh_message_sizes(c: &mut Criterion) {
167174

168175
let mut msg_rcv = 0;
169176
while msg_rcv < actor_count {
170-
let _ = rx.recv().await.unwrap();
177+
tokio::select! {
178+
_ = rx.recv() => {}
179+
_ = tokio::time::sleep(Duration::from_secs(10)) => {
180+
panic!("Timed out. Expected {} messages but got {}", actor_count, msg_rcv);
181+
}
182+
}
171183
msg_rcv += 1;
172184
}
173185
}

0 commit comments

Comments
 (0)