Commit fa573bf
committed
[hyperactor] remove
Pull Request resolved: #1962
We shouldn't mandate how an actor is actually instantiated. Rather, 'spawn' should just take over ownership of an `Actor` object directly, and run its loop from there. This helps to separate concerns and simplify the implementation. In this change:
1) We remote `new` from `Actor`, and only require it in `RemoteSpawn` (renamed from `RemotableActor`), in order to enable remote spawning
2) Change the spawn APIs to take ownership over an actor object
3) Remote the `derive(Actor)` macro, this can now be implemented with a simple `impl Actor for Foo{}` marker trait when no additonal behavior needs to be customized.
4) Simplify a bunch of actor construction, esp. in tests, where we like to just use simple objects.
Using this, in the next change, we will make `spawn` fully synchronous.
This leaves the #[export] attribute macro somewhat schizophrenic: `spawn = true` now only registers the actor in the remote registry. We should think about how to simplify this, too.
ghstack-source-id: 325278670
@exported-using-ghexport
Differential Revision: [D87575629](https://our.internmc.facebook.com/intern/diff/D87575629/)
**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D87575629/)!new from actor1 parent 4d2e334 commit fa573bf
File tree
59 files changed
+1270
-856
lines changed- docs/source/books/hyperactor-book/src
- actors
- macros
- hyperactor_macros/src
- hyperactor_mesh
- benches
- examples
- src
- alloc
- proc_mesh
- resource
- v1
- host_mesh
- test
- hyperactor_multiprocess/src
- hyperactor
- example
- src
- actor
- test_utils
- test
- monarch_extension/src
- monarch_hyperactor/src
- code_sync
- v1
- monarch_rdma/src
- monarch_tensor_worker/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
59 files changed
+1270
-856
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
Lines changed: 12 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
12 | | - | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
19 | | - | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
23 | | - | |
| 26 | + | |
| 27 | + | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
| |||
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
42 | | - | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 52 | + | |
61 | 53 | | |
62 | 54 | | |
| 55 | + | |
| 56 | + | |
63 | 57 | | |
64 | 58 | | |
65 | 59 | | |
| |||
140 | 134 | | |
141 | 135 | | |
142 | 136 | | |
143 | | - | |
| 137 | + | |
144 | 138 | | |
145 | 139 | | |
146 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| |||
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
62 | 61 | | |
| 62 | + | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| |||
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
84 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
88 | 93 | | |
89 | 94 | | |
90 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
91 | 99 | | |
92 | 100 | | |
93 | 101 | | |
| |||
0 commit comments