Skip to content

Commit d8213ae

Browse files
pablorfb-metafacebook-github-bot
authored andcommitted
Shutdown procs (#795)
Summary: Pull Request resolved: #795 Shutdown meshes at the end of bench Reviewed By: moonli Differential Revision: D79831799 fbshipit-source-id: 1c298d3a2d1538f3a9ff3fbd043dca575985ca20
1 parent 9bce756 commit d8213ae

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

hyperactor_mesh/benches/main.rs

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use tokio::runtime::Runtime;
3232
// Benchmark how long does it take to process 1KB message on 1, 10, 100, 1K hosts with 8 GPUs each
3333
fn bench_actor_scaling(c: &mut Criterion) {
3434
let mut group = c.benchmark_group("actor_scaling");
35-
let host_counts = vec![1, 10, 100, 1000];
35+
let host_counts = vec![1, 10, 100];
3636
let message_size = 1024; // Fixed message size (1KB)
3737
group.sample_size(10);
3838
group.sampling_mode(criterion::SamplingMode::Flat);
@@ -49,7 +49,7 @@ fn bench_actor_scaling(c: &mut Criterion) {
4949
.await
5050
.unwrap();
5151

52-
let proc_mesh = ProcMesh::allocate(alloc).await.unwrap();
52+
let mut proc_mesh = ProcMesh::allocate(alloc).await.unwrap();
5353
let actor_mesh: RootActorMesh<BenchActor> = proc_mesh
5454
.spawn("bench", &(Duration::from_millis(0)))
5555
.await
@@ -79,7 +79,15 @@ fn bench_actor_scaling(c: &mut Criterion) {
7979
}
8080
}
8181

82-
start.elapsed()
82+
let elapsed = start.elapsed();
83+
proc_mesh
84+
.events()
85+
.unwrap()
86+
.into_alloc()
87+
.stop_and_wait()
88+
.await
89+
.expect("Failed to stop allocator");
90+
elapsed
8391
});
8492
});
8593
}
@@ -131,7 +139,7 @@ fn bench_actor_mesh_message_sizes(c: &mut Criterion) {
131139
.await
132140
.unwrap();
133141

134-
let proc_mesh = ProcMesh::allocate(alloc).await.unwrap();
142+
let mut proc_mesh = ProcMesh::allocate(alloc).await.unwrap();
135143
let actor_mesh: RootActorMesh<BenchActor> = proc_mesh
136144
.spawn("bench", &(Duration::from_millis(0)))
137145
.await
@@ -161,8 +169,15 @@ fn bench_actor_mesh_message_sizes(c: &mut Criterion) {
161169
msg_rcv += 1;
162170
}
163171
}
164-
165-
start.elapsed()
172+
let elapsed = start.elapsed();
173+
proc_mesh
174+
.events()
175+
.unwrap()
176+
.into_alloc()
177+
.stop_and_wait()
178+
.await
179+
.expect("Failed to stop allocator");
180+
elapsed
166181
});
167182
},
168183
);

0 commit comments

Comments
 (0)