Skip to content

Commit 0d75ddd

Browse files
samhsiameta-codesync[bot]
authored andcommitted
Remove deprecated await on proc_mesh/spawn calls in examples (#1406)
Summary: Pull Request resolved: #1406 Fix Monarch examples broken by removal of DeprecatedNotAFuture in D82835567. D82835567 removed the `DeprecatedNotAFuture` compatibility shim that provided fake `__await__()` methods on `ProcMesh` and `ActorMesh` objects. With the shim removal, these examples started failing with: ``` TypeError: object ActorMesh can't be used in 'await' expression ``` This diff removes the incorrect `await` keywords. Reviewed By: dulinriley Differential Revision: D83138346 fbshipit-source-id: 83b32110c5e68b180c593499684936ae5cc6ce9d
1 parent 601eeca commit 0d75ddd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/source/examples/ping_pong.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async def hello_world(self, msg):
4343
async def create_toy_actors():
4444
local_proc_mesh = proc_mesh(gpus=NUM_ACTORS)
4545
# This spawns 4 instances of 'ToyActor'
46-
toy_actor = await local_proc_mesh.spawn("toy_actor", ToyActor)
46+
toy_actor = local_proc_mesh.spawn("toy_actor", ToyActor)
4747
return toy_actor, local_proc_mesh
4848

4949

@@ -100,14 +100,14 @@ async def recv(self, msg):
100100
async def create_ping_pong_actors():
101101
# Spawn two different Actors in different meshes, with two instances each
102102
local_mesh_0 = proc_mesh(gpus=2)
103-
actor_0 = await local_mesh_0.spawn(
103+
actor_0 = local_mesh_0.spawn(
104104
"actor_0",
105105
ExampleActor,
106106
"actor_0", # this arg is passed to ExampleActor.__init__
107107
)
108108

109109
local_mesh_1 = proc_mesh(gpus=2)
110-
actor_1 = await local_mesh_1.spawn(
110+
actor_1 = local_mesh_1.spawn(
111111
"actor_1",
112112
ExampleActor,
113113
"actor_1", # this arg is passed to ExampleActor.__init__

0 commit comments

Comments
 (0)