torchmonarch-nightly 2025.7.1__cp312-cp312-manylinux2014_x86_64.whl → 2025.7.26__cp312-cp312-manylinux2014_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. monarch/__init__.py +13 -9
  2. monarch/_rust_bindings.so +0 -0
  3. monarch/{_monarch/selection → _src/actor}/__init__.py +3 -7
  4. monarch/_src/actor/actor_mesh.py +878 -0
  5. monarch/{allocator.py → _src/actor/allocator.py} +26 -17
  6. monarch/_src/actor/bootstrap_main.py +73 -0
  7. monarch/{code_sync.py → _src/actor/code_sync/__init__.py} +3 -1
  8. monarch/_src/actor/code_sync/auto_reload.py +223 -0
  9. monarch/_src/actor/debugger.py +565 -0
  10. monarch/_src/actor/endpoint.py +303 -0
  11. monarch/_src/actor/event_loop.py +97 -0
  12. monarch/_src/actor/future.py +100 -0
  13. monarch/{pdb_wrapper.py → _src/actor/pdb_wrapper.py} +47 -46
  14. monarch/{common/pickle_flatten.py → _src/actor/pickle.py} +26 -2
  15. monarch/_src/actor/proc_mesh.py +508 -0
  16. monarch/_src/actor/sync_state.py +18 -0
  17. monarch/{telemetry.py → _src/actor/telemetry/__init__.py} +1 -1
  18. monarch/_src/actor/telemetry/rust_span_tracing.py +159 -0
  19. monarch/_src/actor/tensor_engine_shim.py +59 -0
  20. monarch/_src/tensor_engine/rdma.py +180 -0
  21. monarch/_testing.py +3 -2
  22. monarch/actor/__init__.py +53 -0
  23. monarch/actor_mesh.py +6 -765
  24. monarch/bootstrap_main.py +8 -47
  25. monarch/common/client.py +1 -1
  26. monarch/common/controller_api.py +2 -1
  27. monarch/common/device_mesh.py +12 -2
  28. monarch/common/messages.py +21 -1
  29. monarch/common/recording.py +4 -3
  30. monarch/common/remote.py +135 -52
  31. monarch/common/tensor.py +2 -1
  32. monarch/controller/backend.py +2 -2
  33. monarch/controller/controller.py +2 -1
  34. monarch/controller/rust_backend/controller.py +2 -1
  35. monarch/fetch.py +3 -5
  36. monarch/gradient/_gradient_generator.so +0 -0
  37. monarch/mesh_controller.py +263 -139
  38. monarch/monarch_controller +0 -0
  39. monarch/opaque_module.py +4 -6
  40. monarch/opaque_object.py +3 -3
  41. monarch/proc_mesh.py +6 -309
  42. monarch/python_local_mesh.py +1 -1
  43. monarch/rust_backend_mesh.py +2 -1
  44. monarch/rust_local_mesh.py +4 -2
  45. monarch/sim_mesh.py +10 -19
  46. monarch/simulator/command_history.py +1 -1
  47. monarch/simulator/interface.py +2 -1
  48. monarch/simulator/mock_controller.py +1 -1
  49. monarch/simulator/simulator.py +1 -1
  50. monarch/tensor_engine/__init__.py +23 -0
  51. monarch/tensor_worker_main.py +3 -1
  52. monarch/tools/cli.py +3 -1
  53. monarch/tools/commands.py +129 -47
  54. monarch/tools/components/hyperactor.py +5 -3
  55. monarch/tools/config/__init__.py +18 -1
  56. monarch/tools/config/defaults.py +2 -2
  57. monarch/tools/mesh_spec.py +59 -1
  58. monarch/tools/utils.py +38 -0
  59. monarch/worker/worker.py +1 -1
  60. monarch/world_mesh.py +2 -1
  61. monarch_supervisor/python_executable.py +6 -3
  62. tests/error_test_binary.py +48 -10
  63. tests/test_actor_error.py +370 -21
  64. tests/test_alloc.py +1 -1
  65. tests/test_allocator.py +369 -17
  66. tests/test_controller.py +2 -0
  67. tests/test_debugger.py +416 -0
  68. tests/test_env_before_cuda.py +161 -0
  69. tests/test_python_actors.py +184 -333
  70. tests/test_rdma.py +198 -0
  71. tests/test_remote_functions.py +40 -12
  72. tests/test_rust_backend.py +7 -5
  73. tests/test_sim_backend.py +1 -4
  74. tests/test_tensor_engine.py +81 -1
  75. {torchmonarch_nightly-2025.7.1.dist-info → torchmonarch_nightly-2025.7.26.dist-info}/METADATA +39 -1
  76. {torchmonarch_nightly-2025.7.1.dist-info → torchmonarch_nightly-2025.7.26.dist-info}/RECORD +84 -72
  77. torchmonarch_nightly-2025.7.26.dist-info/entry_points.txt +3 -0
  78. monarch/_monarch/hyperactor/__init__.py +0 -58
  79. monarch/_monarch/worker/debugger.py +0 -117
  80. monarch/_monarch/worker/logging.py +0 -107
  81. monarch/debugger.py +0 -379
  82. monarch/future.py +0 -76
  83. monarch/rdma.py +0 -162
  84. torchmonarch_nightly-2025.7.1.dist-info/entry_points.txt +0 -3
  85. /monarch/{_monarch/worker → _src}/__init__.py +0 -0
  86. /monarch/{common/_device_utils.py → _src/actor/device_utils.py} +0 -0
  87. /monarch/{common → _src/actor}/shape.py +0 -0
  88. /monarch/{_monarch → _src/tensor_engine}/__init__.py +0 -0
  89. {torchmonarch_nightly-2025.7.1.dist-info → torchmonarch_nightly-2025.7.26.dist-info}/WHEEL +0 -0
  90. {torchmonarch_nightly-2025.7.1.dist-info → torchmonarch_nightly-2025.7.26.dist-info}/licenses/LICENSE +0 -0
  91. {torchmonarch_nightly-2025.7.1.dist-info → torchmonarch_nightly-2025.7.26.dist-info}/top_level.txt +0 -0
monarch/__init__.py CHANGED
@@ -11,7 +11,10 @@ from typing import TYPE_CHECKING
11
11
 
12
12
  # Import before monarch to pre-load torch DSOs as, in exploded wheel flows,
13
13
  # our RPATHs won't correctly find them.
14
- import torch # noqa: F401
14
+ try:
15
+ import torch # noqa: F401
16
+ except ImportError:
17
+ pass
15
18
 
16
19
  # submodules of monarch should not be imported in this
17
20
  # top-level file because it will cause them to get
@@ -29,7 +32,8 @@ import torch # noqa: F401
29
32
 
30
33
  if TYPE_CHECKING:
31
34
  from monarch import timer
32
- from monarch.allocator import LocalAllocator, ProcessAllocator
35
+ from monarch._src.actor.allocator import LocalAllocator, ProcessAllocator
36
+ from monarch._src.actor.shape import NDSlice, Shape
33
37
  from monarch.common._coalescing import coalescing
34
38
 
35
39
  from monarch.common.device_mesh import (
@@ -50,11 +54,9 @@ if TYPE_CHECKING:
50
54
  from monarch.common.pipe import create_pipe, Pipe, remote_generator
51
55
  from monarch.common.remote import remote
52
56
  from monarch.common.selection import Selection
53
- from monarch.common.shape import NDSlice, Shape
54
57
  from monarch.common.stream import get_active_stream, Stream
55
58
  from monarch.common.tensor import reduce, reduce_, Tensor
56
59
  from monarch.fetch import fetch_shard, inspect, show
57
- from monarch.future import ActorFuture
58
60
  from monarch.gradient_generator import grad_function, grad_generator
59
61
  from monarch.notebook import mast_mesh, reserve_torchx as mast_reserve
60
62
  from monarch.python_local_mesh import python_local_mesh
@@ -79,8 +81,8 @@ _public_api = {
79
81
  "function_resolvers": ("monarch.common.function", "resolvers"),
80
82
  "Future": ("monarch.common.future", "Future"),
81
83
  "RemoteException": ("monarch.common.invocation", "RemoteException"),
82
- "Shape": ("monarch.common.shape", "Shape"),
83
- "NDSlice": ("monarch.common.shape", "NDSlice"),
84
+ "Shape": ("monarch._src.actor.shape", "Shape"),
85
+ "NDSlice": ("monarch._src.actor.shape", "NDSlice"),
84
86
  "Selection": ("monarch.common.selection", "Selection"),
85
87
  "OpaqueRef": ("monarch.common.opaque_ref", "OpaqueRef"),
86
88
  "create_pipe": ("monarch.common.pipe", "create_pipe"),
@@ -112,8 +114,9 @@ _public_api = {
112
114
  "Simulator": ("monarch.simulator.interface", "Simulator"),
113
115
  "world_mesh": ("monarch.world_mesh", "world_mesh"),
114
116
  "timer": ("monarch.timer", "timer"),
115
- "ProcessAllocator": ("monarch.allocator", "ProcessAllocator"),
116
- "LocalAllocator": ("monarch.allocator", "LocalAllocator"),
117
+ "ProcessAllocator": ("monarch._src.actor.allocator", "ProcessAllocator"),
118
+ "LocalAllocator": ("monarch._src.actor.allocator", "LocalAllocator"),
119
+ "SimAllocator": ("monarch._src_actor.allocator", "SimAllocator"),
117
120
  "ActorFuture": ("monarch.future", "ActorFuture"),
118
121
  "builtins": ("monarch.builtins", "builtins"),
119
122
  }
@@ -132,7 +135,7 @@ def __getattr__(name):
132
135
  try:
133
136
  from __manifest__ import fbmake # noqa
134
137
 
135
- IN_PAR = True
138
+ IN_PAR = bool(fbmake.get("par_style"))
136
139
  except ImportError:
137
140
  IN_PAR = False
138
141
 
@@ -183,6 +186,7 @@ __all__ = [
183
186
  "timer",
184
187
  "ProcessAllocator",
185
188
  "LocalAllocator",
189
+ "SimAllocator",
186
190
  "ActorFuture",
187
191
  "builtins",
188
192
  ]
monarch/_rust_bindings.so CHANGED
Binary file
@@ -4,10 +4,6 @@
4
4
  # This source code is licensed under the BSD-style license found in the
5
5
  # LICENSE file in the root directory of this source tree.
6
6
 
7
- from monarch._rust_bindings.monarch_hyperactor.selection import ( # @manual=//monarch/monarch_extension:monarch_extension
8
- Selection,
9
- )
10
-
11
- __all__ = [
12
- "Selection",
13
- ]
7
+ """
8
+ Monarch Actor API
9
+ """