torchmonarch-nightly 2025.8.2__cp311-cp311-manylinux2014_x86_64.whl → 2025.9.3__cp311-cp311-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 (63) hide show
  1. monarch/_rust_bindings.so +0 -0
  2. monarch/_src/actor/actor_mesh.py +414 -216
  3. monarch/_src/actor/allocator.py +75 -6
  4. monarch/_src/actor/bootstrap_main.py +7 -4
  5. monarch/_src/actor/code_sync/__init__.py +2 -0
  6. monarch/_src/actor/debugger/__init__.py +7 -0
  7. monarch/_src/actor/{debugger.py → debugger/debugger.py} +246 -135
  8. monarch/_src/actor/{pdb_wrapper.py → debugger/pdb_wrapper.py} +62 -23
  9. monarch/_src/actor/endpoint.py +27 -45
  10. monarch/_src/actor/future.py +86 -24
  11. monarch/_src/actor/host_mesh.py +125 -0
  12. monarch/_src/actor/logging.py +94 -0
  13. monarch/_src/actor/pickle.py +25 -0
  14. monarch/_src/actor/proc_mesh.py +423 -156
  15. monarch/_src/actor/python_extension_methods.py +90 -0
  16. monarch/_src/actor/shape.py +8 -1
  17. monarch/_src/actor/source_loader.py +45 -0
  18. monarch/_src/actor/telemetry/__init__.py +172 -0
  19. monarch/_src/actor/telemetry/rust_span_tracing.py +6 -39
  20. monarch/_src/debug_cli/__init__.py +7 -0
  21. monarch/_src/debug_cli/debug_cli.py +43 -0
  22. monarch/_src/tensor_engine/rdma.py +64 -9
  23. monarch/_testing.py +1 -3
  24. monarch/actor/__init__.py +24 -4
  25. monarch/common/_C.so +0 -0
  26. monarch/common/device_mesh.py +14 -0
  27. monarch/common/future.py +10 -0
  28. monarch/common/remote.py +14 -25
  29. monarch/common/tensor.py +12 -0
  30. monarch/debug_cli/__init__.py +7 -0
  31. monarch/debug_cli/__main__.py +12 -0
  32. monarch/fetch.py +2 -2
  33. monarch/gradient/_gradient_generator.so +0 -0
  34. monarch/gradient_generator.py +4 -2
  35. monarch/mesh_controller.py +34 -14
  36. monarch/monarch_controller +0 -0
  37. monarch/tools/colors.py +25 -0
  38. monarch/tools/commands.py +42 -7
  39. monarch/tools/components/hyperactor.py +1 -1
  40. monarch/tools/config/__init__.py +31 -4
  41. monarch/tools/config/defaults.py +13 -3
  42. monarch/tools/config/environment.py +45 -0
  43. monarch/tools/config/workspace.py +165 -0
  44. monarch/tools/mesh_spec.py +2 -0
  45. monarch/utils/__init__.py +9 -0
  46. monarch/utils/utils.py +78 -0
  47. tests/error_test_binary.py +5 -3
  48. tests/python_actor_test_binary.py +52 -0
  49. tests/test_actor_error.py +142 -14
  50. tests/test_alloc.py +1 -1
  51. tests/test_allocator.py +59 -72
  52. tests/test_debugger.py +639 -45
  53. tests/test_env_before_cuda.py +4 -4
  54. tests/test_mesh_trait.py +38 -0
  55. tests/test_python_actors.py +965 -75
  56. tests/test_rdma.py +7 -6
  57. tests/test_tensor_engine.py +6 -6
  58. {torchmonarch_nightly-2025.8.2.dist-info → torchmonarch_nightly-2025.9.3.dist-info}/METADATA +82 -4
  59. {torchmonarch_nightly-2025.8.2.dist-info → torchmonarch_nightly-2025.9.3.dist-info}/RECORD +63 -47
  60. {torchmonarch_nightly-2025.8.2.dist-info → torchmonarch_nightly-2025.9.3.dist-info}/WHEEL +0 -0
  61. {torchmonarch_nightly-2025.8.2.dist-info → torchmonarch_nightly-2025.9.3.dist-info}/entry_points.txt +0 -0
  62. {torchmonarch_nightly-2025.8.2.dist-info → torchmonarch_nightly-2025.9.3.dist-info}/licenses/LICENSE +0 -0
  63. {torchmonarch_nightly-2025.8.2.dist-info → torchmonarch_nightly-2025.9.3.dist-info}/top_level.txt +0 -0
@@ -75,9 +75,9 @@ class TestEnvBeforeCuda(unittest.IsolatedAsyncioTestCase):
75
75
 
76
76
  spec = AllocSpec(AllocConstraints(), gpus=1, hosts=1)
77
77
  allocator = LocalAllocator()
78
- alloc = await allocator.allocate(spec)
78
+ alloc = allocator.allocate(spec)
79
79
 
80
- proc_mesh = await ProcMesh.from_alloc(alloc, setup=setup_cuda_env)
80
+ proc_mesh = ProcMesh.from_alloc(alloc, setup=setup_cuda_env)
81
81
 
82
82
  try:
83
83
  actor = await proc_mesh.spawn("cuda_init", CudaInitTestActor)
@@ -110,7 +110,7 @@ class TestEnvBeforeCuda(unittest.IsolatedAsyncioTestCase):
110
110
  for name, value in cuda_env_vars.items():
111
111
  os.environ[name] = value
112
112
 
113
- proc_mesh_instance = await proc_mesh(gpus=1, hosts=1, setup=setup_cuda_env)
113
+ proc_mesh_instance = proc_mesh(gpus=1, hosts=1, setup=setup_cuda_env)
114
114
 
115
115
  try:
116
116
  actor = await proc_mesh_instance.spawn("cuda_init", CudaInitTestActor)
@@ -136,7 +136,7 @@ class TestEnvBeforeCuda(unittest.IsolatedAsyncioTestCase):
136
136
  "CUDA_DEVICE_MAX_CONNECTIONS": "1",
137
137
  }
138
138
 
139
- proc_mesh_instance = await proc_mesh(gpus=1, hosts=1, env=cuda_env_vars)
139
+ proc_mesh_instance = proc_mesh(gpus=1, hosts=1, env=cuda_env_vars)
140
140
 
141
141
  try:
142
142
  actor = await proc_mesh_instance.spawn("cuda_init", CudaInitTestActor)
@@ -0,0 +1,38 @@
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ # All rights reserved.
3
+ #
4
+ # This source code is licensed under the BSD-style license found in the
5
+ # LICENSE file in the root directory of this source tree.
6
+
7
+ from typing import Iterable
8
+
9
+ from monarch._src.actor.shape import MeshTrait, NDSlice, Shape, Slice
10
+
11
+
12
+ class Mesh(MeshTrait):
13
+ """
14
+ A simple implementor of MeshTrait.
15
+ """
16
+
17
+ def __init__(self, shape: Shape, values: list[int]) -> None:
18
+ self._shape = shape
19
+ self._values = values
20
+
21
+ def _new_with_shape(self, shape: Shape) -> "Mesh":
22
+ return Mesh(shape, self._values)
23
+
24
+ @property
25
+ def _ndslice(self) -> NDSlice:
26
+ return self._shape.ndslice
27
+
28
+ @property
29
+ def _labels(self) -> Iterable[str]:
30
+ return self._shape.labels
31
+
32
+
33
+ def test_len() -> None:
34
+ s = Slice(offset=0, sizes=[2, 3], strides=[3, 1])
35
+ shape = Shape(["label0", "label1"], s)
36
+
37
+ mesh = Mesh(shape, [1, 2, 3, 4, 5, 6])
38
+ assert 6 == len(mesh)