mplang-nightly 0.1.dev253__py3-none-any.whl → 0.1.dev254__py3-none-any.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.
@@ -154,6 +154,10 @@ class SimpMemDriver(SimpDriver):
154
154
  self._workers = workers
155
155
  self._mesh = mesh
156
156
 
157
+ def shutdown(self) -> None:
158
+ """Shutdown the local memory driver and its mesh."""
159
+ self._mesh.shutdown()
160
+
157
161
  @property
158
162
  def world_size(self) -> int:
159
163
  return self._world_size
mplang/v2/cli.py CHANGED
@@ -62,7 +62,7 @@ def run_worker(
62
62
  signal.signal(signal.SIGINT, signal.SIG_DFL)
63
63
  signal.signal(signal.SIGTERM, signal.SIG_DFL)
64
64
 
65
- from mplang.v2.backends.simp_http_worker import create_worker_app
65
+ from mplang.v2.backends.simp_worker.http import create_worker_app
66
66
 
67
67
  app = create_worker_app(rank, world_size, endpoints, spu_endpoints)
68
68
 
mplang/v2/edsl/context.py CHANGED
@@ -69,7 +69,7 @@ class Context(ABC):
69
69
  """
70
70
 
71
71
  def __init__(self) -> None:
72
- self._state: dict[str, Any] = {}
72
+ self._states: dict[str, Any] = {}
73
73
 
74
74
  # =========================================================================
75
75
  # State Management
@@ -82,7 +82,7 @@ class Context(ABC):
82
82
  key: State key (e.g., "dialect.simp", "device.cluster")
83
83
  value: State value
84
84
  """
85
- self._state[key] = value
85
+ self._states[key] = value
86
86
 
87
87
  def get_state(self, key: str, default: Any = None) -> Any:
88
88
  """Get attached state by key.
@@ -94,7 +94,7 @@ class Context(ABC):
94
94
  Returns:
95
95
  State value or default
96
96
  """
97
- return self._state.get(key, default)
97
+ return self._states.get(key, default)
98
98
 
99
99
  def has_state(self, key: str) -> bool:
100
100
  """Check if state exists.
@@ -105,7 +105,7 @@ class Context(ABC):
105
105
  Returns:
106
106
  True if state exists
107
107
  """
108
- return key in self._state
108
+ return key in self._states
109
109
 
110
110
  # =========================================================================
111
111
  # Abstract Methods
@@ -0,0 +1,23 @@
1
+ # Copyright 2025 Ant Group Co., Ltd.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """Machine Learning algorithms for secure multi-party computation."""
16
+
17
+ from mplang.v2.libs.ml.sgb import SecureBoost, Tree, TreeEnsemble
18
+
19
+ __all__ = [
20
+ "SecureBoost",
21
+ "Tree",
22
+ "TreeEnsemble",
23
+ ]