Skip to content

Commit d761e0a

Browse files
committed
[hyperactor] mesh: v0 shims for v1 meshes
Pull Request resolved: #1453 In this change, we implement: ``` From<v1::ProcMeshRef> for ProcMesh ``` and ``` From<v1::ActorMeshRef<A>> for RootActorMesh<A> ``` This will allow us to temporarily use v1 instances through a v0 API, while we transition the usage sites. ghstack-source-id: 314644713 Differential Revision: [D84081478](https://our.internmc.facebook.com/intern/diff/D84081478/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D84081478/)!
1 parent 9754552 commit d761e0a

File tree

11 files changed

+643
-206
lines changed

11 files changed

+643
-206
lines changed

hyperactor_mesh/src/actor_mesh.rs

Lines changed: 262 additions & 63 deletions
Large diffs are not rendered by default.

hyperactor_mesh/src/alloc/sim.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,13 @@ mod tests {
199199
})
200200
.await
201201
.unwrap();
202+
let instance = crate::v1::testing::instance().await;
202203

203204
let proc_mesh = ProcMesh::allocate(alloc).await.unwrap();
204205

205206
let handle = hyperactor::simnet::simnet_handle().unwrap();
206-
let actor_mesh: RootActorMesh<TestActor> = proc_mesh.spawn("echo", &()).await.unwrap();
207+
let actor_mesh: RootActorMesh<TestActor> =
208+
proc_mesh.spawn(&instance, "echo", &()).await.unwrap();
207209
let actors = actor_mesh.iter_actor_refs().collect::<Vec<_>>();
208210
assert_eq!(
209211
handle.sample_latency(

hyperactor_mesh/src/comm.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -830,9 +830,9 @@ mod tests {
830830
let params = TestActorParams {
831831
forward_port: tx.bind(),
832832
};
833-
let actor_mesh = proc_mesh
834-
.clone()
835-
.spawn::<TestActor>(dest_actor_name, &params)
833+
let instance = crate::v1::testing::instance().await;
834+
let actor_mesh = Arc::clone(&proc_mesh)
835+
.spawn::<TestActor>(&instance, dest_actor_name, &params)
836836
.await
837837
.unwrap();
838838

@@ -968,7 +968,7 @@ mod tests {
968968
} = setup_mesh::<NoneAccumulator>(None).await;
969969
let proc_mesh_client = actor_mesh.proc_mesh().client();
970970

971-
let ranks = actor_mesh.ranks.clone();
971+
let ranks = actor_mesh.ranks().clone();
972972
execute_cast_and_reply(ranks, proc_mesh_client, reply1_rx, reply2_rx, reply_tos).await;
973973
}
974974

@@ -1032,7 +1032,7 @@ mod tests {
10321032
..
10331033
} = setup_mesh(Some(accum::sum::<u64>())).await;
10341034
let proc_mesh_client = actor_mesh.proc_mesh().client();
1035-
let ranks = actor_mesh.ranks.clone();
1035+
let ranks = actor_mesh.ranks().clone();
10361036
execute_cast_and_accum(ranks, proc_mesh_client, reply1_rx, reply_tos).await;
10371037
}
10381038

0 commit comments

Comments
 (0)