mplang-nightly 0.1.dev192__py3-none-any.whl → 0.1.dev268__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.
- mplang/__init__.py +21 -130
- mplang/py.typed +13 -0
- mplang/v1/__init__.py +157 -0
- mplang/v1/_device.py +602 -0
- mplang/{analysis → v1/analysis}/__init__.py +1 -1
- mplang/{analysis → v1/analysis}/diagram.py +4 -4
- mplang/{core → v1/core}/__init__.py +20 -14
- mplang/{core → v1/core}/cluster.py +6 -1
- mplang/{core → v1/core}/comm.py +1 -1
- mplang/{core → v1/core}/context_mgr.py +1 -1
- mplang/{core → v1/core}/dtypes.py +38 -0
- mplang/{core → v1/core}/expr/__init__.py +7 -7
- mplang/{core → v1/core}/expr/ast.py +11 -13
- mplang/{core → v1/core}/expr/evaluator.py +8 -8
- mplang/{core → v1/core}/expr/printer.py +6 -6
- mplang/{core → v1/core}/expr/transformer.py +2 -2
- mplang/{core → v1/core}/expr/utils.py +2 -2
- mplang/{core → v1/core}/expr/visitor.py +1 -1
- mplang/{core → v1/core}/expr/walk.py +1 -1
- mplang/{core → v1/core}/interp.py +6 -6
- mplang/{core → v1/core}/mpir.py +13 -11
- mplang/{core → v1/core}/mpobject.py +6 -6
- mplang/{core → v1/core}/mptype.py +13 -10
- mplang/{core → v1/core}/pfunc.py +2 -2
- mplang/{core → v1/core}/primitive.py +12 -12
- mplang/{core → v1/core}/table.py +36 -8
- mplang/{core → v1/core}/tensor.py +1 -1
- mplang/{core → v1/core}/tracer.py +9 -9
- mplang/{host.py → v1/host.py} +5 -5
- mplang/{kernels → v1/kernels}/__init__.py +1 -1
- mplang/{kernels → v1/kernels}/base.py +1 -1
- mplang/{kernels → v1/kernels}/basic.py +15 -15
- mplang/{kernels → v1/kernels}/context.py +19 -16
- mplang/{kernels → v1/kernels}/crypto.py +8 -10
- mplang/{kernels → v1/kernels}/fhe.py +9 -7
- mplang/{kernels → v1/kernels}/mock_tee.py +3 -3
- mplang/{kernels → v1/kernels}/phe.py +26 -18
- mplang/{kernels → v1/kernels}/spu.py +5 -5
- mplang/{kernels → v1/kernels}/sql_duckdb.py +5 -3
- mplang/{kernels → v1/kernels}/stablehlo.py +18 -17
- mplang/{kernels → v1/kernels}/value.py +2 -2
- mplang/{ops → v1/ops}/__init__.py +3 -3
- mplang/{ops → v1/ops}/base.py +1 -1
- mplang/{ops → v1/ops}/basic.py +6 -5
- mplang/v1/ops/crypto.py +262 -0
- mplang/{ops → v1/ops}/fhe.py +2 -2
- mplang/{ops → v1/ops}/jax_cc.py +26 -59
- mplang/v1/ops/nnx_cc.py +168 -0
- mplang/{ops → v1/ops}/phe.py +16 -3
- mplang/{ops → v1/ops}/spu.py +3 -3
- mplang/v1/ops/sql_cc.py +303 -0
- mplang/{ops → v1/ops}/tee.py +2 -2
- mplang/{runtime → v1/runtime}/__init__.py +2 -2
- mplang/v1/runtime/channel.py +230 -0
- mplang/{runtime → v1/runtime}/cli.py +3 -3
- mplang/{runtime → v1/runtime}/client.py +1 -1
- mplang/{runtime → v1/runtime}/communicator.py +39 -15
- mplang/{runtime → v1/runtime}/data_providers.py +80 -19
- mplang/{runtime → v1/runtime}/driver.py +4 -4
- mplang/v1/runtime/link_comm.py +196 -0
- mplang/{runtime → v1/runtime}/server.py +22 -9
- mplang/{runtime → v1/runtime}/session.py +24 -51
- mplang/{runtime → v1/runtime}/simulation.py +36 -14
- mplang/{simp → v1/simp}/api.py +72 -14
- mplang/{simp → v1/simp}/mpi.py +1 -1
- mplang/{simp → v1/simp}/party.py +5 -5
- mplang/{simp → v1/simp}/random.py +2 -2
- mplang/v1/simp/smpc.py +238 -0
- mplang/v1/utils/table_utils.py +185 -0
- mplang/v2/__init__.py +424 -0
- mplang/v2/backends/__init__.py +57 -0
- mplang/v2/backends/bfv_impl.py +705 -0
- mplang/v2/backends/channel.py +217 -0
- mplang/v2/backends/crypto_impl.py +723 -0
- mplang/v2/backends/field_impl.py +454 -0
- mplang/v2/backends/func_impl.py +107 -0
- mplang/v2/backends/phe_impl.py +148 -0
- mplang/v2/backends/simp_design.md +136 -0
- mplang/v2/backends/simp_driver/__init__.py +41 -0
- mplang/v2/backends/simp_driver/http.py +168 -0
- mplang/v2/backends/simp_driver/mem.py +280 -0
- mplang/v2/backends/simp_driver/ops.py +135 -0
- mplang/v2/backends/simp_driver/state.py +60 -0
- mplang/v2/backends/simp_driver/values.py +52 -0
- mplang/v2/backends/simp_worker/__init__.py +29 -0
- mplang/v2/backends/simp_worker/http.py +354 -0
- mplang/v2/backends/simp_worker/mem.py +102 -0
- mplang/v2/backends/simp_worker/ops.py +167 -0
- mplang/v2/backends/simp_worker/state.py +49 -0
- mplang/v2/backends/spu_impl.py +275 -0
- mplang/v2/backends/spu_state.py +187 -0
- mplang/v2/backends/store_impl.py +62 -0
- mplang/v2/backends/table_impl.py +838 -0
- mplang/v2/backends/tee_impl.py +215 -0
- mplang/v2/backends/tensor_impl.py +519 -0
- mplang/v2/cli.py +603 -0
- mplang/v2/cli_guide.md +122 -0
- mplang/v2/dialects/__init__.py +36 -0
- mplang/v2/dialects/bfv.py +665 -0
- mplang/v2/dialects/crypto.py +689 -0
- mplang/v2/dialects/dtypes.py +378 -0
- mplang/v2/dialects/field.py +210 -0
- mplang/v2/dialects/func.py +135 -0
- mplang/v2/dialects/phe.py +723 -0
- mplang/v2/dialects/simp.py +944 -0
- mplang/v2/dialects/spu.py +349 -0
- mplang/v2/dialects/store.py +63 -0
- mplang/v2/dialects/table.py +407 -0
- mplang/v2/dialects/tee.py +346 -0
- mplang/v2/dialects/tensor.py +1175 -0
- mplang/v2/edsl/README.md +279 -0
- mplang/v2/edsl/__init__.py +99 -0
- mplang/v2/edsl/context.py +311 -0
- mplang/v2/edsl/graph.py +463 -0
- mplang/v2/edsl/jit.py +62 -0
- mplang/v2/edsl/object.py +53 -0
- mplang/v2/edsl/primitive.py +284 -0
- mplang/v2/edsl/printer.py +119 -0
- mplang/v2/edsl/registry.py +207 -0
- mplang/v2/edsl/serde.py +375 -0
- mplang/v2/edsl/tracer.py +614 -0
- mplang/v2/edsl/typing.py +816 -0
- mplang/v2/kernels/Makefile +30 -0
- mplang/v2/kernels/__init__.py +23 -0
- mplang/v2/kernels/gf128.cpp +148 -0
- mplang/v2/kernels/ldpc.cpp +82 -0
- mplang/v2/kernels/okvs.cpp +283 -0
- mplang/v2/kernels/okvs_opt.cpp +291 -0
- mplang/v2/kernels/py_kernels.py +398 -0
- mplang/v2/libs/collective.py +330 -0
- mplang/v2/libs/device/__init__.py +51 -0
- mplang/v2/libs/device/api.py +813 -0
- mplang/v2/libs/device/cluster.py +352 -0
- mplang/v2/libs/ml/__init__.py +23 -0
- mplang/v2/libs/ml/sgb.py +1861 -0
- mplang/v2/libs/mpc/__init__.py +41 -0
- mplang/v2/libs/mpc/_utils.py +99 -0
- mplang/v2/libs/mpc/analytics/__init__.py +35 -0
- mplang/v2/libs/mpc/analytics/aggregation.py +372 -0
- mplang/v2/libs/mpc/analytics/groupby.md +99 -0
- mplang/v2/libs/mpc/analytics/groupby.py +331 -0
- mplang/v2/libs/mpc/analytics/permutation.py +386 -0
- mplang/v2/libs/mpc/common/constants.py +39 -0
- mplang/v2/libs/mpc/ot/__init__.py +32 -0
- mplang/v2/libs/mpc/ot/base.py +222 -0
- mplang/v2/libs/mpc/ot/extension.py +477 -0
- mplang/v2/libs/mpc/ot/silent.py +217 -0
- mplang/v2/libs/mpc/psi/__init__.py +40 -0
- mplang/v2/libs/mpc/psi/cuckoo.py +228 -0
- mplang/v2/libs/mpc/psi/okvs.py +49 -0
- mplang/v2/libs/mpc/psi/okvs_gct.py +79 -0
- mplang/v2/libs/mpc/psi/oprf.py +310 -0
- mplang/v2/libs/mpc/psi/rr22.py +344 -0
- mplang/v2/libs/mpc/psi/unbalanced.py +200 -0
- mplang/v2/libs/mpc/vole/__init__.py +31 -0
- mplang/v2/libs/mpc/vole/gilboa.py +327 -0
- mplang/v2/libs/mpc/vole/ldpc.py +383 -0
- mplang/v2/libs/mpc/vole/silver.py +336 -0
- mplang/v2/runtime/__init__.py +15 -0
- mplang/v2/runtime/dialect_state.py +41 -0
- mplang/v2/runtime/interpreter.py +871 -0
- mplang/v2/runtime/object_store.py +194 -0
- mplang/v2/runtime/value.py +141 -0
- {mplang_nightly-0.1.dev192.dist-info → mplang_nightly-0.1.dev268.dist-info}/METADATA +22 -16
- mplang_nightly-0.1.dev268.dist-info/RECORD +180 -0
- {mplang_nightly-0.1.dev192.dist-info → mplang_nightly-0.1.dev268.dist-info}/WHEEL +1 -1
- mplang/device.py +0 -327
- mplang/ops/crypto.py +0 -108
- mplang/ops/ibis_cc.py +0 -136
- mplang/ops/sql_cc.py +0 -62
- mplang/runtime/link_comm.py +0 -78
- mplang/simp/smpc.py +0 -201
- mplang/utils/table_utils.py +0 -85
- mplang_nightly-0.1.dev192.dist-info/RECORD +0 -83
- /mplang/{core → v1/core}/mask.py +0 -0
- /mplang/{protos → v1/protos}/v1alpha1/mpir_pb2.py +0 -0
- /mplang/{protos → v1/protos}/v1alpha1/mpir_pb2.pyi +0 -0
- /mplang/{protos → v1/protos}/v1alpha1/value_pb2.py +0 -0
- /mplang/{protos → v1/protos}/v1alpha1/value_pb2.pyi +0 -0
- /mplang/{runtime → v1/runtime}/exceptions.py +0 -0
- /mplang/{runtime → v1/runtime}/http_api.md +0 -0
- /mplang/{simp → v1/simp}/__init__.py +0 -0
- /mplang/{utils → v1/utils}/__init__.py +0 -0
- /mplang/{utils → v1/utils}/crypto.py +0 -0
- /mplang/{utils → v1/utils}/func_utils.py +0 -0
- /mplang/{utils → v1/utils}/spu_utils.py +0 -0
- {mplang_nightly-0.1.dev192.dist-info → mplang_nightly-0.1.dev268.dist-info}/entry_points.txt +0 -0
- {mplang_nightly-0.1.dev192.dist-info → mplang_nightly-0.1.dev268.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,194 @@
|
|
|
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
|
+
"""ObjectStore implementation for MPLang v2 runtime."""
|
|
16
|
+
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
import os
|
|
20
|
+
import pickle
|
|
21
|
+
import uuid
|
|
22
|
+
from abc import ABC, abstractmethod
|
|
23
|
+
from typing import Any
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class StoreBackend(ABC):
|
|
27
|
+
"""Abstract base class for storage backends."""
|
|
28
|
+
|
|
29
|
+
@abstractmethod
|
|
30
|
+
def put(self, key: str, value: Any) -> None:
|
|
31
|
+
"""Store a value with the given key."""
|
|
32
|
+
...
|
|
33
|
+
|
|
34
|
+
@abstractmethod
|
|
35
|
+
def get(self, key: str) -> Any:
|
|
36
|
+
"""Retrieve a value by key."""
|
|
37
|
+
...
|
|
38
|
+
|
|
39
|
+
@abstractmethod
|
|
40
|
+
def delete(self, key: str) -> None:
|
|
41
|
+
"""Delete a value by key."""
|
|
42
|
+
...
|
|
43
|
+
|
|
44
|
+
@abstractmethod
|
|
45
|
+
def exists(self, key: str) -> bool:
|
|
46
|
+
"""Check if a key exists."""
|
|
47
|
+
...
|
|
48
|
+
|
|
49
|
+
@abstractmethod
|
|
50
|
+
def list_keys(self) -> list[str]:
|
|
51
|
+
"""List all keys in the backend."""
|
|
52
|
+
...
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class MemoryBackend(StoreBackend):
|
|
56
|
+
"""In-memory storage backend."""
|
|
57
|
+
|
|
58
|
+
def __init__(self) -> None:
|
|
59
|
+
self._data: dict[str, Any] = {}
|
|
60
|
+
|
|
61
|
+
def put(self, key: str, value: Any) -> None:
|
|
62
|
+
self._data[key] = value
|
|
63
|
+
|
|
64
|
+
def get(self, key: str) -> Any:
|
|
65
|
+
if key not in self._data:
|
|
66
|
+
raise KeyError(f"Key not found in MemoryBackend: {key}")
|
|
67
|
+
return self._data[key]
|
|
68
|
+
|
|
69
|
+
def delete(self, key: str) -> None:
|
|
70
|
+
self._data.pop(key, None)
|
|
71
|
+
|
|
72
|
+
def exists(self, key: str) -> bool:
|
|
73
|
+
return key in self._data
|
|
74
|
+
|
|
75
|
+
def list_keys(self) -> list[str]:
|
|
76
|
+
return list(self._data.keys())
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class FileSystemBackend(StoreBackend):
|
|
80
|
+
"""File system storage backend using pickle."""
|
|
81
|
+
|
|
82
|
+
def __init__(self, root_dir: str) -> None:
|
|
83
|
+
self._root = os.path.abspath(root_dir)
|
|
84
|
+
os.makedirs(self._root, exist_ok=True)
|
|
85
|
+
|
|
86
|
+
def _get_path(self, key: str) -> str:
|
|
87
|
+
# Security check: prevent directory traversal
|
|
88
|
+
# We assume key is a relative path from root
|
|
89
|
+
# If key starts with /, strip it to make it relative
|
|
90
|
+
clean_key = key.lstrip("/")
|
|
91
|
+
path = os.path.abspath(os.path.join(self._root, clean_key))
|
|
92
|
+
if not path.startswith(self._root):
|
|
93
|
+
raise ValueError(f"Invalid key (traversal attempt): {key}")
|
|
94
|
+
return path
|
|
95
|
+
|
|
96
|
+
def put(self, key: str, value: Any) -> None:
|
|
97
|
+
path = self._get_path(key)
|
|
98
|
+
os.makedirs(os.path.dirname(path), exist_ok=True)
|
|
99
|
+
with open(path, "wb") as f:
|
|
100
|
+
pickle.dump(value, f)
|
|
101
|
+
|
|
102
|
+
def get(self, key: str) -> Any:
|
|
103
|
+
path = self._get_path(key)
|
|
104
|
+
if not os.path.exists(path):
|
|
105
|
+
raise KeyError(f"Key not found: {key}")
|
|
106
|
+
with open(path, "rb") as f:
|
|
107
|
+
return pickle.load(f)
|
|
108
|
+
|
|
109
|
+
def delete(self, key: str) -> None:
|
|
110
|
+
path = self._get_path(key)
|
|
111
|
+
if os.path.exists(path):
|
|
112
|
+
os.remove(path)
|
|
113
|
+
|
|
114
|
+
def exists(self, key: str) -> bool:
|
|
115
|
+
return os.path.exists(self._get_path(key))
|
|
116
|
+
|
|
117
|
+
def list_keys(self) -> list[str]:
|
|
118
|
+
keys = []
|
|
119
|
+
for root, _, files in os.walk(self._root):
|
|
120
|
+
for file in files:
|
|
121
|
+
full_path = os.path.join(root, file)
|
|
122
|
+
rel_path = os.path.relpath(full_path, self._root)
|
|
123
|
+
keys.append(rel_path)
|
|
124
|
+
return keys
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
class ObjectStore:
|
|
128
|
+
"""Distributed Object Store dispatcher."""
|
|
129
|
+
|
|
130
|
+
def __init__(self, fs_root: str) -> None:
|
|
131
|
+
self._backends: dict[str, StoreBackend] = {}
|
|
132
|
+
# Register default memory backend
|
|
133
|
+
self.register_backend("mem", MemoryBackend())
|
|
134
|
+
# Register file system backend
|
|
135
|
+
self.register_backend("fs", FileSystemBackend(root_dir=fs_root))
|
|
136
|
+
|
|
137
|
+
def register_backend(self, scheme: str, backend: StoreBackend) -> None:
|
|
138
|
+
"""Register a storage backend for a specific URI scheme."""
|
|
139
|
+
self._backends[scheme] = backend
|
|
140
|
+
|
|
141
|
+
def _parse_uri(self, uri: str) -> tuple[StoreBackend, str]:
|
|
142
|
+
"""Parse URI and return (backend, key)."""
|
|
143
|
+
if "://" not in uri:
|
|
144
|
+
raise ValueError(f"Invalid URI format: {uri}")
|
|
145
|
+
|
|
146
|
+
scheme, _, key = uri.partition("://")
|
|
147
|
+
if scheme not in self._backends:
|
|
148
|
+
raise ValueError(f"No backend registered for scheme: {scheme}")
|
|
149
|
+
|
|
150
|
+
return self._backends[scheme], key
|
|
151
|
+
|
|
152
|
+
def put(self, value: Any, uri: str | None = None) -> str:
|
|
153
|
+
"""
|
|
154
|
+
Store a value.
|
|
155
|
+
|
|
156
|
+
Args:
|
|
157
|
+
value: The object to store.
|
|
158
|
+
uri: Optional URI. If None, generates 'mem://<uuid>'.
|
|
159
|
+
|
|
160
|
+
Returns:
|
|
161
|
+
The URI where the object is stored.
|
|
162
|
+
"""
|
|
163
|
+
if uri is None:
|
|
164
|
+
uri = f"mem://{uuid.uuid4()}"
|
|
165
|
+
|
|
166
|
+
backend, key = self._parse_uri(uri)
|
|
167
|
+
backend.put(key, value)
|
|
168
|
+
return uri
|
|
169
|
+
|
|
170
|
+
def get(self, uri: str) -> Any:
|
|
171
|
+
"""Retrieve a value by URI."""
|
|
172
|
+
backend, key = self._parse_uri(uri)
|
|
173
|
+
return backend.get(key)
|
|
174
|
+
|
|
175
|
+
def delete(self, uri: str) -> None:
|
|
176
|
+
"""Delete a value by URI."""
|
|
177
|
+
backend, key = self._parse_uri(uri)
|
|
178
|
+
backend.delete(key)
|
|
179
|
+
|
|
180
|
+
def exists(self, uri: str) -> bool:
|
|
181
|
+
"""Check if a URI exists."""
|
|
182
|
+
backend, key = self._parse_uri(uri)
|
|
183
|
+
return backend.exists(key)
|
|
184
|
+
|
|
185
|
+
def list_objects(self) -> list[str]:
|
|
186
|
+
"""List all objects in all backends."""
|
|
187
|
+
uris: list[str] = []
|
|
188
|
+
for scheme, backend in self._backends.items():
|
|
189
|
+
try:
|
|
190
|
+
keys = backend.list_keys()
|
|
191
|
+
uris.extend(f"{scheme}://{key}" for key in keys)
|
|
192
|
+
except NotImplementedError:
|
|
193
|
+
pass
|
|
194
|
+
return uris
|
|
@@ -0,0 +1,141 @@
|
|
|
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
|
+
"""Base classes for runtime values in MPLang backends.
|
|
16
|
+
|
|
17
|
+
This module defines:
|
|
18
|
+
1. `Value`: The abstract base class for all backend runtime values. It provides
|
|
19
|
+
a unified serialization interface via `to_json`/`from_json`.
|
|
20
|
+
2. `WrapValue`: A generic base class for values that simply wrap an external
|
|
21
|
+
type (like numpy arrays, arrow tables, or cryptographic objects). It
|
|
22
|
+
implements the "wrap/unwrap" pattern with automatic type conversion.
|
|
23
|
+
|
|
24
|
+
Usage:
|
|
25
|
+
from mplang.v2.runtime.value import Value
|
|
26
|
+
from mplang.v2.edsl import serde
|
|
27
|
+
|
|
28
|
+
@serde.register_class
|
|
29
|
+
class MyValue(Value):
|
|
30
|
+
_serde_kind = "mymodule.MyValue"
|
|
31
|
+
|
|
32
|
+
def __init__(self, data: bytes):
|
|
33
|
+
self._data = data
|
|
34
|
+
|
|
35
|
+
@property
|
|
36
|
+
def data(self) -> bytes:
|
|
37
|
+
return self._data
|
|
38
|
+
|
|
39
|
+
def to_json(self) -> dict:
|
|
40
|
+
return {"data": base64.b64encode(self._data).decode("ascii")}
|
|
41
|
+
|
|
42
|
+
@classmethod
|
|
43
|
+
def from_json(cls, data: dict) -> "MyValue":
|
|
44
|
+
return cls(data=base64.b64decode(data["data"]))
|
|
45
|
+
|
|
46
|
+
@classmethod
|
|
47
|
+
def wrap(cls, val: bytes | MyValue) -> MyValue:
|
|
48
|
+
if isinstance(val, cls):
|
|
49
|
+
return val
|
|
50
|
+
return cls(val)
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
from __future__ import annotations
|
|
54
|
+
|
|
55
|
+
from abc import ABC, abstractmethod
|
|
56
|
+
from typing import TYPE_CHECKING, Any, ClassVar, Generic, TypeVar
|
|
57
|
+
|
|
58
|
+
if TYPE_CHECKING:
|
|
59
|
+
from typing import Self
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class Value(ABC):
|
|
63
|
+
"""Base class for all runtime values in MPLang backends.
|
|
64
|
+
|
|
65
|
+
Subclasses must define:
|
|
66
|
+
- `_serde_kind: ClassVar[str]` - unique identifier for serialization
|
|
67
|
+
- `to_json(self) -> dict` - serialize to JSON-compatible dict
|
|
68
|
+
- `from_json(cls, data: dict) -> Self` - deserialize from dict
|
|
69
|
+
|
|
70
|
+
And should use the `@serde.register_class` decorator for registration.
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
# Class-level type identifier for serde dispatch.
|
|
74
|
+
# Subclasses must define this.
|
|
75
|
+
_serde_kind: ClassVar[str]
|
|
76
|
+
|
|
77
|
+
# =========== Serialization Interface ===========
|
|
78
|
+
|
|
79
|
+
@abstractmethod
|
|
80
|
+
def to_json(self) -> dict[str, Any]:
|
|
81
|
+
"""Serialize to JSON-compatible dict.
|
|
82
|
+
|
|
83
|
+
Note: Do NOT include `_kind` in the returned dict;
|
|
84
|
+
`serde.to_json` adds it automatically based on `_serde_kind`.
|
|
85
|
+
"""
|
|
86
|
+
...
|
|
87
|
+
|
|
88
|
+
@classmethod
|
|
89
|
+
@abstractmethod
|
|
90
|
+
def from_json(cls, data: dict[str, Any]) -> Self:
|
|
91
|
+
"""Deserialize from JSON-compatible dict."""
|
|
92
|
+
...
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
T = TypeVar("T")
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
class WrapValue(Value, Generic[T]):
|
|
99
|
+
"""Base class for values that wrap a specific native object.
|
|
100
|
+
|
|
101
|
+
Provides standard implementation for:
|
|
102
|
+
- `__init__` (calls `_convert` and stores data in `_data`)
|
|
103
|
+
- `data` property
|
|
104
|
+
- `unwrap` (returns `_data`)
|
|
105
|
+
- `wrap` (factory method with idempotency check)
|
|
106
|
+
"""
|
|
107
|
+
|
|
108
|
+
_data: T
|
|
109
|
+
|
|
110
|
+
def __init__(self, data: Any):
|
|
111
|
+
self._data = self._convert(data)
|
|
112
|
+
|
|
113
|
+
def _convert(self, data: Any) -> T:
|
|
114
|
+
"""Convert input data to the underlying type T.
|
|
115
|
+
|
|
116
|
+
Default implementation: assume data is already T.
|
|
117
|
+
Subclasses should override this to handle type coercion.
|
|
118
|
+
"""
|
|
119
|
+
if isinstance(data, WrapValue):
|
|
120
|
+
return data.unwrap() # type: ignore
|
|
121
|
+
return data # type: ignore
|
|
122
|
+
|
|
123
|
+
@property
|
|
124
|
+
def data(self) -> T:
|
|
125
|
+
"""Get the underlying raw data (read-only)."""
|
|
126
|
+
return self._data
|
|
127
|
+
|
|
128
|
+
@classmethod
|
|
129
|
+
def wrap(cls, val: Any) -> Self:
|
|
130
|
+
"""Factory method: wrap a value into this Value type.
|
|
131
|
+
|
|
132
|
+
Idempotent: if val is already this type, returns it as-is.
|
|
133
|
+
Otherwise, calls constructor which triggers `_convert`.
|
|
134
|
+
"""
|
|
135
|
+
if isinstance(val, cls):
|
|
136
|
+
return val
|
|
137
|
+
return cls(val)
|
|
138
|
+
|
|
139
|
+
def unwrap(self) -> T:
|
|
140
|
+
"""Get the underlying raw data."""
|
|
141
|
+
return self._data
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mplang-nightly
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.dev268
|
|
4
4
|
Summary: Multi-Party Programming Language
|
|
5
5
|
Author-email: SecretFlow Team <secretflow-contact@service.alipay.com>
|
|
6
6
|
License: Apache License
|
|
@@ -205,15 +205,22 @@ License: Apache License
|
|
|
205
205
|
See the License for the specific language governing permissions and
|
|
206
206
|
limitations under the License.
|
|
207
207
|
License-File: LICENSE
|
|
208
|
-
Requires-Python:
|
|
208
|
+
Requires-Python: <3.13,>=3.11
|
|
209
|
+
Requires-Dist: coincurve>=20.0.0
|
|
210
|
+
Requires-Dist: cryptography>=43.0.0
|
|
209
211
|
Requires-Dist: duckdb>=1.0.0
|
|
210
212
|
Requires-Dist: fastapi
|
|
211
|
-
Requires-Dist:
|
|
212
|
-
Requires-Dist:
|
|
213
|
+
Requires-Dist: flax>=0.12.0
|
|
214
|
+
Requires-Dist: httpx<1.0.0,>=0.27.0
|
|
215
|
+
Requires-Dist: jax[cpu]==0.8.0
|
|
213
216
|
Requires-Dist: lightphe<0.1.0,>=0.0.15
|
|
217
|
+
Requires-Dist: numpy>=2.0.0
|
|
214
218
|
Requires-Dist: pandas>=2.0.0
|
|
215
219
|
Requires-Dist: protobuf<6.0,>=5.0
|
|
216
|
-
Requires-Dist:
|
|
220
|
+
Requires-Dist: pyarrow>=14.0.0
|
|
221
|
+
Requires-Dist: pyyaml>=6.0
|
|
222
|
+
Requires-Dist: spu>=0.10.0.dev20251211
|
|
223
|
+
Requires-Dist: sqlglot>=23.0.0
|
|
217
224
|
Requires-Dist: tenseal==0.3.16
|
|
218
225
|
Requires-Dist: typing-extensions
|
|
219
226
|
Requires-Dist: uvicorn[standard]
|
|
@@ -235,13 +242,13 @@ multiple parties in a synchronous, SPMD (Single Program, Multiple Data) fashion.
|
|
|
235
242
|
- **Single-Controller SPMD**: Write one program that runs across multiple parties in lockstep.
|
|
236
243
|
- **Explicit Device Placement**: Clearly annotate and control where data lives and computation happens (e.g., on party `P0`, `P1`, or a secure `SPU`).
|
|
237
244
|
- **Function-Level Compilation**: Use the `@mplang.function` decorator to compile Python functions into an auditable, optimizable graph representation.
|
|
238
|
-
- **Pluggable Architecture**: Easily extend MPLang with new frontends (like JAX
|
|
245
|
+
- **Pluggable Architecture**: Easily extend MPLang with new frontends (like JAX) and backends (like StableHLO, SPU).
|
|
239
246
|
|
|
240
247
|
## Getting Started
|
|
241
248
|
|
|
242
249
|
### Installation
|
|
243
250
|
|
|
244
|
-
You'll need a modern Python environment (3.
|
|
251
|
+
You'll need a modern Python environment (3.11+). We recommend using `uv` for fast installation.
|
|
245
252
|
|
|
246
253
|
```bash
|
|
247
254
|
# Install uv (if not already installed)
|
|
@@ -256,29 +263,28 @@ uv pip install mplang
|
|
|
256
263
|
Here's a taste of what MPLang looks like. This example shows a "millionaire's problem" where two parties compare their wealth without revealing it.
|
|
257
264
|
|
|
258
265
|
```python
|
|
259
|
-
import mplang
|
|
260
|
-
import mplang.device as mpd
|
|
266
|
+
import mplang as mp
|
|
261
267
|
from numpy.random import randint
|
|
262
268
|
|
|
263
269
|
# Use a decorator to compile this function for multi-party execution
|
|
264
|
-
@
|
|
270
|
+
@mp.function
|
|
265
271
|
def millionaire():
|
|
266
272
|
# Alice's value, placed on device P0
|
|
267
|
-
x =
|
|
273
|
+
x = mp.device("P0")(randint)(0, 1000000)
|
|
268
274
|
# Bob's value, placed on device P1
|
|
269
|
-
y =
|
|
275
|
+
y = mp.device("P1")(randint)(0, 1000000)
|
|
270
276
|
# The comparison happens on a secure device (SPU)
|
|
271
|
-
z =
|
|
277
|
+
z = mp.device("SP0")(lambda a, b: a < b)(x, y)
|
|
272
278
|
return z
|
|
273
279
|
|
|
274
280
|
# Set up a local simulator with 2 parties
|
|
275
|
-
sim =
|
|
281
|
+
sim = mp.Simulator.simple(2)
|
|
276
282
|
|
|
277
283
|
# Evaluate the compiled function
|
|
278
|
-
result =
|
|
284
|
+
result = mp.evaluate(sim, millionaire)
|
|
279
285
|
|
|
280
286
|
# Securely fetch the result (reveals SPU value)
|
|
281
|
-
print("Is Alice poorer than Bob?",
|
|
287
|
+
print("Is Alice poorer than Bob?", mp.fetch(sim, result))
|
|
282
288
|
```
|
|
283
289
|
|
|
284
290
|
## Learn More
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
mplang/__init__.py,sha256=CdfWOdeg-I1q6ULjdBxeLioVlplA4bgPTSn_2xSk5VY,1677
|
|
2
|
+
mplang/py.typed,sha256=RyhZV7Yxo8BvEoBiFz5fH3IWVqQKTcBBE-bzjx_N5GQ,583
|
|
3
|
+
mplang/v1/__init__.py,sha256=m7UQeAqYwQOzFt-lYqv9eKs9kdvutW025pxEG0h7eVs,3346
|
|
4
|
+
mplang/v1/_device.py,sha256=MY4OO7TJr2oxDXbvv_pnBweALxP2wvV0cvq3DMLHFuE,22971
|
|
5
|
+
mplang/v1/host.py,sha256=-daviW1W4HYFhBqMzkDkJoQap8HxNDFDop2FyI_mrak,4306
|
|
6
|
+
mplang/v1/analysis/__init__.py,sha256=RvgCE9TO_cmwHtunlhbTbzCtLc19Ym7vlmVCL2UAqCs,1059
|
|
7
|
+
mplang/v1/analysis/diagram.py,sha256=XZgq1sq25xxnJF84WVkPDTmC90VVVaj8x6Annn_Ipu0,19477
|
|
8
|
+
mplang/v1/core/__init__.py,sha256=RN4SugeL-Wkfhrryx_Cf1T-Ax3Ol0zrqbCxAD4Wj3JA,3375
|
|
9
|
+
mplang/v1/core/cluster.py,sha256=d23L12eHoNDO17eojxbI4EhWi6GtUDzKbl-R6U5K580,12102
|
|
10
|
+
mplang/v1/core/comm.py,sha256=6kQ5lnyodys_Ls_6BIrNo3E3DMwsr2z5IPn-pYh2HZs,8976
|
|
11
|
+
mplang/v1/core/context_mgr.py,sha256=87BPy02UF7ZOPxPieSxMV_OSfXK4HJmnSFXKFaFSnwk,1544
|
|
12
|
+
mplang/v1/core/dtypes.py,sha256=ZTXcQfcy5rKJp7JEkmE4rqqki7LalbKOplQ1bkMqpgM,11613
|
|
13
|
+
mplang/v1/core/interp.py,sha256=iigeVh1mmdt9PL_1RRoNWYSFpYnAjEKol8qrJ8cfXO4,5933
|
|
14
|
+
mplang/v1/core/mask.py,sha256=14DFxaA446lGjN4dzTuQgm9Shcn34rYI87YJHg0YGNQ,10693
|
|
15
|
+
mplang/v1/core/mpir.py,sha256=CKmNiv6Q_tvxSvFcmeaYXPl67-eQiVhe9EIXT2LDU9M,38421
|
|
16
|
+
mplang/v1/core/mpobject.py,sha256=qSRGvJ-3Vy9LLBYWQCcTYVh2EUx-pMOkFkVIQYVUwOA,3751
|
|
17
|
+
mplang/v1/core/mptype.py,sha256=i6J2s355P4MkM0R2S5DY1aj8tzUMeoCMYEU72R2cRSo,13972
|
|
18
|
+
mplang/v1/core/pfunc.py,sha256=TZpa15qeSxqPMacCH8UXQARoRqiR96sLYsPpJ_QIY6I,5108
|
|
19
|
+
mplang/v1/core/primitive.py,sha256=x-GykjaNqZzGTO-zcGZiknH7UC5YBxIem-xvFo2Jvig,36772
|
|
20
|
+
mplang/v1/core/table.py,sha256=-KcFotbhcWC1P87JeYs0ho22Fk8wWrqoVkpU9HooFFo,6626
|
|
21
|
+
mplang/v1/core/tensor.py,sha256=PejvflIz40THE789ft4KJHp4i8l9cOSQxxJx7HiuLOA,2365
|
|
22
|
+
mplang/v1/core/tracer.py,sha256=FI5fUCEw6Qth_poCNgu8LCHkAUDrBUMwrNW0_evSx14,14315
|
|
23
|
+
mplang/v1/core/expr/__init__.py,sha256=pIjDsy-PYCK0Vx1r_Y0Q_vD2XaHAwTyNDan34dE5Fro,2009
|
|
24
|
+
mplang/v1/core/expr/ast.py,sha256=w54nL371KWMK92agCmG9Pnfn8VaiK8mV2lXPKu4ff5w,20893
|
|
25
|
+
mplang/v1/core/expr/evaluator.py,sha256=HuzHzr1e84ijohhutW4ND7spIl0O4cbvUlMsGW6oBY0,23337
|
|
26
|
+
mplang/v1/core/expr/printer.py,sha256=3IR65WaiQBm0ITWRThRAZWgGRi3xB2SCZA34MhcaVXU,9679
|
|
27
|
+
mplang/v1/core/expr/transformer.py,sha256=KPOGavPxWF8FksvVY6iYqyJnvcJumvb2KVUwdc9DQwc,4910
|
|
28
|
+
mplang/v1/core/expr/utils.py,sha256=lkIM1GB9qUF0x46xVe4UGyeJH8qSB0qN2FjDpWoiGiY,2631
|
|
29
|
+
mplang/v1/core/expr/visitor.py,sha256=C1UWZbMtTPGOpi62oaYRjO3kVqSRJcJWn1ZZw-gxLaA,2047
|
|
30
|
+
mplang/v1/core/expr/walk.py,sha256=zhP2X_wQVgx3rMFIcq5F0o3byZ2lLpTZQTarnCkYwD4,11892
|
|
31
|
+
mplang/v1/kernels/__init__.py,sha256=-bZWsXDC7qYkbHZh_7AvX8wQ1dnokj5LZhR5KpeKrWg,1055
|
|
32
|
+
mplang/v1/kernels/base.py,sha256=a01tsvZSnlP2C7bdphJLIQPMI1-yFankIWansqByVVg,3829
|
|
33
|
+
mplang/v1/kernels/basic.py,sha256=ZC5dRUEt4jXUwfPCQj4geaAX3RxO0x8SYvf2PPgVito,8881
|
|
34
|
+
mplang/v1/kernels/context.py,sha256=vvuwwLaO8iNDCXi_Riw1DqjZvIV8QIuZ3bBJlnAyNAA,14080
|
|
35
|
+
mplang/v1/kernels/crypto.py,sha256=YsfaCYnwRZYVvetnT28G9GdqCxC7TNyka77ctIWzjmY,4260
|
|
36
|
+
mplang/v1/kernels/fhe.py,sha256=FY-Gs2Kqa_xF_LOWLOuFL6BLcP9gdGxZOvcU5U8ktNs,30916
|
|
37
|
+
mplang/v1/kernels/mock_tee.py,sha256=5O6HIl-lXYsRPBwu19QHDxnzARdSj5dbl-enYqQF6mo,2495
|
|
38
|
+
mplang/v1/kernels/phe.py,sha256=OA8Fy_xRN5KavTzt7tR0E5XDavu2PsEcGpUr2jXmvd4,73156
|
|
39
|
+
mplang/v1/kernels/spu.py,sha256=FsZpIyM5FltxeCXRaVuavo2VJeG-O0zQ3YGALCH36zM,12492
|
|
40
|
+
mplang/v1/kernels/sql_duckdb.py,sha256=J4wBwmh0tu1GDf9r5S-hb-Cm7sLubUpAuU4LIVoU5Fs,1718
|
|
41
|
+
mplang/v1/kernels/stablehlo.py,sha256=9HzfqiqyK5XCHPe3AhNN0IT4QrIUoLS44R8OLHF-pT0,3217
|
|
42
|
+
mplang/v1/kernels/value.py,sha256=7yPdbSHHFhBx4mizrYLzubBLkN6GVTkpcCLjCZAtCgA,20723
|
|
43
|
+
mplang/v1/ops/__init__.py,sha256=EqwD85heDk4xxoqowQqnUTZGJ8UGhgDVAxtURBi-O3M,1018
|
|
44
|
+
mplang/v1/ops/base.py,sha256=kZcRprWiRNHs5eKeBqYLoSruo-qMcNhmkGaQw_2mPfc,18162
|
|
45
|
+
mplang/v1/ops/basic.py,sha256=DjsMYhtJ-B69bXBAI3znvC00p7v0GALOBgJD8Q3L0kc,9260
|
|
46
|
+
mplang/v1/ops/crypto.py,sha256=YJGzXz6sXjBB6xnu3moLsirZWlOkGSPy4M8cakpvbRs,8952
|
|
47
|
+
mplang/v1/ops/fhe.py,sha256=IHMUT7D6GRu-X-gunMK593_9N88Jf3njsLrKflvck08,9518
|
|
48
|
+
mplang/v1/ops/jax_cc.py,sha256=O3y3bQitMbr448Uzz4ha02Jr3GZ2FhjWfuOOVcnGECQ,6112
|
|
49
|
+
mplang/v1/ops/nnx_cc.py,sha256=LkP1qMkNoeheyonsdreXNDMgQepesOXv4AaJn0SU8Gs,7323
|
|
50
|
+
mplang/v1/ops/phe.py,sha256=UulFSKEohmk66h9L5rsl5F1xPlRKTRxS7jb88cyCsag,7421
|
|
51
|
+
mplang/v1/ops/spu.py,sha256=VjdNEGtGC5M8q8qn82lAuwkKiNPGQvOiJyXz52d7-Sw,4930
|
|
52
|
+
mplang/v1/ops/sql_cc.py,sha256=EifWv-L8szHt7_baxsN69wMzu-yZi_OEIPJHxjWIAtg,9792
|
|
53
|
+
mplang/v1/ops/tee.py,sha256=7-xCbsZiDKAtnUOQ-o65Fj2Y9nkG5nbgH2qzDOdRbhM,1251
|
|
54
|
+
mplang/v1/protos/v1alpha1/mpir_pb2.py,sha256=Bros37t-4LMJbuUYVSM65rImUYTtZDhNTIADGbZCKp0,7522
|
|
55
|
+
mplang/v1/protos/v1alpha1/mpir_pb2.pyi,sha256=dLxAtFW7mgFR-HYxC4ExI4jbtEWUGTKBvcKhI3BJ8m0,20972
|
|
56
|
+
mplang/v1/protos/v1alpha1/value_pb2.py,sha256=V9fqQTqXNo2efYmlP9xOhC7EpjBUp5jL-05yrJsAvWU,2785
|
|
57
|
+
mplang/v1/protos/v1alpha1/value_pb2.pyi,sha256=47GVvuZfiV5oaVemwh0xTfns8OYTVBT8YnluIQeQPbs,7108
|
|
58
|
+
mplang/v1/runtime/__init__.py,sha256=if0QGJEJMw8PkNyxghzxOdWlNJOEE3UZUnkqU3q2Znc,954
|
|
59
|
+
mplang/v1/runtime/channel.py,sha256=yfy-sI8nQJkINePnzYLtOs2bg7vYqC412uyjrSeDet8,7583
|
|
60
|
+
mplang/v1/runtime/cli.py,sha256=xbnWqYoU35qJjgCk2M8dBg7hU1QqM7nKWbEKCKa_cz4,15343
|
|
61
|
+
mplang/v1/runtime/client.py,sha256=FsKXrBcI0AQmGmwX7BhIhtTNFRmEhTyfNk2ruitf2Gg,15861
|
|
62
|
+
mplang/v1/runtime/communicator.py,sha256=HukrYfnUihN4WfuURCKF8OF3vzelueGgMUEZGDMyhjE,5074
|
|
63
|
+
mplang/v1/runtime/data_providers.py,sha256=DCj-QqVAGf9jNInPoJS9KjsfF79OZXSDT9IRytseH4E,10633
|
|
64
|
+
mplang/v1/runtime/driver.py,sha256=2GONsWJG_USYXiqJMzHJkTwVCsJnsk9vu8bKuRQNk6g,11614
|
|
65
|
+
mplang/v1/runtime/exceptions.py,sha256=c18U0xK20dRmgZo0ogTf5vXlkix9y3VAFuzkHxaXPEk,981
|
|
66
|
+
mplang/v1/runtime/http_api.md,sha256=-re1DhEqMplAkv_wnqEU-PSs8tTzf4-Ml0Gq0f3Go6s,4883
|
|
67
|
+
mplang/v1/runtime/link_comm.py,sha256=4WMq-MTaXe5CboVV_HABxq_o2p863bOXg-E3vy4tKwU,6808
|
|
68
|
+
mplang/v1/runtime/server.py,sha256=1KSgwT0Lm1NNL_sLTf9Rr7EoIsN-gHARfs_h8dzdnLM,16997
|
|
69
|
+
mplang/v1/runtime/session.py,sha256=-H9W4yRatLC_feOFAorXQbR5vb1imkNoefWwjKUe4-k,9648
|
|
70
|
+
mplang/v1/runtime/simulation.py,sha256=S8_v6aHVzx3OI4w-VYLW3CmCjJslViBDPn5sVYcsOsQ,12179
|
|
71
|
+
mplang/v1/simp/__init__.py,sha256=2WE4cmW96Xkzyq2yRRYNww4kZ5o6u6NbPV0BxqZG698,581
|
|
72
|
+
mplang/v1/simp/api.py,sha256=X-NePnIoUfVpumYiffwNGIXnCXZ6zWzwSUmNju_fAbo,13906
|
|
73
|
+
mplang/v1/simp/mpi.py,sha256=EAVWH8vLSkXrobmgyNUrwbHqzL4F8wufoKQmTzXCR28,4751
|
|
74
|
+
mplang/v1/simp/party.py,sha256=_3cj6GctFzzex5_vOjsRrtOybxI9ekXFztfAy5OnOJw,8226
|
|
75
|
+
mplang/v1/simp/random.py,sha256=X1_IzA8C-Rt6bez4oJzTExW5XOKg_EIKlzXf1yJArt4,3843
|
|
76
|
+
mplang/v1/simp/smpc.py,sha256=JGB3zFkDyPcg-TdN77oxMfeiWNoxHkuZNpVoTO9me5Q,9267
|
|
77
|
+
mplang/v1/utils/__init__.py,sha256=2WE4cmW96Xkzyq2yRRYNww4kZ5o6u6NbPV0BxqZG698,581
|
|
78
|
+
mplang/v1/utils/crypto.py,sha256=rvPomBFtznRHc3RPi6Aip9lsU8zW2oxBqGv1K3vn7Rs,1052
|
|
79
|
+
mplang/v1/utils/func_utils.py,sha256=vCJcZmu0bEbqhOQKdpttV2_MBllIcPSN0b8U4WjNGGo,5164
|
|
80
|
+
mplang/v1/utils/spu_utils.py,sha256=S3L9RBkBe2AvSuMSQQ12cBY5Y1NPthubvErSX_7nj1A,4158
|
|
81
|
+
mplang/v1/utils/table_utils.py,sha256=1fDgZLrRf2bvKvA45egT6RtMPgwE1cI2BokMHUU_xv4,5945
|
|
82
|
+
mplang/v2/__init__.py,sha256=rX_DXuAu8IG_2-toMWtLB3UL0YDvXCPoxNoekVmhJG0,13837
|
|
83
|
+
mplang/v2/cli.py,sha256=QtiTFG418k26opRy4GhVV8fwFqRS11xTLH3xRCIIm6M,19665
|
|
84
|
+
mplang/v2/cli_guide.md,sha256=kyoCaqkvIJJ1vsvCyBu3qgOuRSb0txu9BDZoy9GU5S0,3617
|
|
85
|
+
mplang/v2/backends/__init__.py,sha256=H-4-jBEPWBZl6XT7AxBShRINnruF_f_2lB4iaiQoXME,1988
|
|
86
|
+
mplang/v2/backends/bfv_impl.py,sha256=cQPinze3c2xN4CmIIoXxZoIEhu9ynoGaXbdF95z_aTE,25709
|
|
87
|
+
mplang/v2/backends/channel.py,sha256=t8P7RphNnhvo3Zj08hX85d7PxgWQXiMGNYfZPK_4YoM,6622
|
|
88
|
+
mplang/v2/backends/crypto_impl.py,sha256=tU0KdI34hnYvYujKUkiA1XYpvy4lo_MKpidt0NSIKlk,23205
|
|
89
|
+
mplang/v2/backends/field_impl.py,sha256=50sKGOlkUiaTj_IAola86uQeoi-fxV0o7G91BdTCWZA,14788
|
|
90
|
+
mplang/v2/backends/func_impl.py,sha256=R0662cC0gSSfkjuLyevJ_g4bJDJirY76LTFYqEimCkE,3585
|
|
91
|
+
mplang/v2/backends/phe_impl.py,sha256=r836e_qBHGrHhfnFail5IaUDzvS7bABjdEQmJmAtBVI,4127
|
|
92
|
+
mplang/v2/backends/simp_design.md,sha256=CXvfxrvV1TmKlFm8IbKTbcHHwLl6AhwlY_cNqMdff_Y,5250
|
|
93
|
+
mplang/v2/backends/spu_impl.py,sha256=8F4oXmVEr-lt9mrT5fdNznrJZeznwOd7CrmB0-dVtx8,9475
|
|
94
|
+
mplang/v2/backends/spu_state.py,sha256=u84hgLhcCcpKvseXwtVa2hC9fj_HrLCVNHy6LMd37rE,6569
|
|
95
|
+
mplang/v2/backends/store_impl.py,sha256=RyhADTNsnnNnwsatAMr7eeewXkVXtfNWA1oFiLXg8H0,2222
|
|
96
|
+
mplang/v2/backends/table_impl.py,sha256=Qmd-Z_PLjSbDngWkHz0wc6VykoGHfS2-rCOk1aWudws,27566
|
|
97
|
+
mplang/v2/backends/tee_impl.py,sha256=Gp-vqqJPtEMNqP7y68tLhL3a-EW3BQwpo_qCJOSHqKs,7044
|
|
98
|
+
mplang/v2/backends/tensor_impl.py,sha256=8f9f4-_e-m4JWGZSbXLmSSHcgPykRBc1sAYrA3OIxEg,18906
|
|
99
|
+
mplang/v2/backends/simp_driver/__init__.py,sha256=ahOPYYvtFVwqxiFxkpSNP8BCTao_MfCXmtt5zsMaJxg,1258
|
|
100
|
+
mplang/v2/backends/simp_driver/http.py,sha256=Fm0M7BKf6Ddqec79btd-tJiuVaD92yghr1GJc84RXmg,5550
|
|
101
|
+
mplang/v2/backends/simp_driver/mem.py,sha256=kx3jDAYx3QkJa1UZDhhY_JjJAdT8u-r6Hsw8fYwFPKY,9128
|
|
102
|
+
mplang/v2/backends/simp_driver/ops.py,sha256=UeVC3eaCUwxrkN6OsJyMYj8qMDufMFQI0YogeSbhkjM,4515
|
|
103
|
+
mplang/v2/backends/simp_driver/state.py,sha256=6tQyQg_PNzHOJkjCoNm51Wvknl3XiJZzpQXuRB4qRtM,1719
|
|
104
|
+
mplang/v2/backends/simp_driver/values.py,sha256=OQ_7Kt6l7Pcfx5eB6GVbpunS6CG60Lj0AS6H9Wx9sKQ,1515
|
|
105
|
+
mplang/v2/backends/simp_worker/__init__.py,sha256=93VMzntLN1kpePK1KoLsU3J3RU-krgV3smCRRRo-xKA,970
|
|
106
|
+
mplang/v2/backends/simp_worker/http.py,sha256=HI4Kj8tsN8Z058m9D_8cU22d37VzQTlN4PW7d30dxSE,12656
|
|
107
|
+
mplang/v2/backends/simp_worker/mem.py,sha256=coDvztNDLlflCh2oGNuO0PSMILKZ28Fvyfhks4Vsnzc,3577
|
|
108
|
+
mplang/v2/backends/simp_worker/ops.py,sha256=DMQCsKeoMtemy5ozsVZt2eoF8NZlhLeHZMDgnBSP29I,5525
|
|
109
|
+
mplang/v2/backends/simp_worker/state.py,sha256=eRUI7MP6gU8KPC9-H5fwcoAPKOsfW2ODWvpoKWbecMk,1554
|
|
110
|
+
mplang/v2/dialects/__init__.py,sha256=hvzAvz6_brfFyDGgKknoPdgh5EY033YNYwotuJK_zoA,1493
|
|
111
|
+
mplang/v2/dialects/bfv.py,sha256=XrE3FX9DHWqNzUVzY0tuwPvNVVRZYpD51JZIZF-q-l4,22350
|
|
112
|
+
mplang/v2/dialects/crypto.py,sha256=dH_DtoE3pGAKeOLPHxeyGtXC-nGwBsOs62TKikJEaq0,22197
|
|
113
|
+
mplang/v2/dialects/dtypes.py,sha256=bGM3Jna3BnvE4MPOurWrEmQegGPxd26z1HIWox1rj0U,12104
|
|
114
|
+
mplang/v2/dialects/field.py,sha256=6nBJg08k5WHb2o5msr8XAnxMQLpoTej55VQ7iSRnC4o,6380
|
|
115
|
+
mplang/v2/dialects/func.py,sha256=UlaMof4NEG28VOtiRL7zBRYgFbIX74YTqqgvozbils0,4375
|
|
116
|
+
mplang/v2/dialects/phe.py,sha256=PkehfF2NVBOu05zXITZ87yl-YQa4hwLs7zmUPbk2XhY,22896
|
|
117
|
+
mplang/v2/dialects/simp.py,sha256=ON7iegkHp3um5UX8V4Y5I-fGgFJ3YVwmFsXsleiqqUE,32869
|
|
118
|
+
mplang/v2/dialects/spu.py,sha256=3JO-D394TKNH2VdFDRp5ohmG0uOcOHEs_ivFHbMZIgA,11385
|
|
119
|
+
mplang/v2/dialects/store.py,sha256=RqUBzMAgtEMBmdT8axV5lVCv1hp5w0ZZM0Tu4iOZt-c,2114
|
|
120
|
+
mplang/v2/dialects/table.py,sha256=jwNKHhpTRnpZVu_UhXGHKRAV0ekI8nXl5lLHa5PpxTE,13543
|
|
121
|
+
mplang/v2/dialects/tee.py,sha256=oj_G8ebhtuz9_HarK8rKoaJNJ9ZkRbqcIxhp3m0xsjQ,10129
|
|
122
|
+
mplang/v2/dialects/tensor.py,sha256=VVIlWtSHpeYFwGuKw7yWxwMQ_a35XJ-2ardeBed2HL8,39900
|
|
123
|
+
mplang/v2/edsl/README.md,sha256=viflvdRojOa6Xk_UMRPqpuPGXcPGmdlv2-XR6LO7B58,7592
|
|
124
|
+
mplang/v2/edsl/__init__.py,sha256=YqmtrJXD1NLKS-_Ofnxtiv77muokTZnrAiV7dXUZVyo,2607
|
|
125
|
+
mplang/v2/edsl/context.py,sha256=0RgQAt7cbPudt9kyBb7wjZ31HzGMnq81Ah5sgs_qU2U,10093
|
|
126
|
+
mplang/v2/edsl/graph.py,sha256=VXeE_9Oc9E0qfnwFDYBvFyDL79qvABLs1aFC-lheJ8M,14983
|
|
127
|
+
mplang/v2/edsl/jit.py,sha256=tofGAqNSUPuEmqy0flaZpNaR1Y425Pk2FdmCKxRPCM8,2069
|
|
128
|
+
mplang/v2/edsl/object.py,sha256=rijDu4yuG_Sitgfz5gk8-mJ1-3Bgor0QrQU04q9mkgo,1909
|
|
129
|
+
mplang/v2/edsl/primitive.py,sha256=rkKGYDa8qEOr2EmVn7GTfsCGHWL_3N-eIgD7QJ4UIW8,10575
|
|
130
|
+
mplang/v2/edsl/printer.py,sha256=x9vjhicqLvtZcrCkqQhF8QWAcvEArgyU6aqVLB9Ym2I,4396
|
|
131
|
+
mplang/v2/edsl/registry.py,sha256=hudXZPUrUUueEwgksDKN0cnE3iiXucuTaDdDK8uSPmk,6822
|
|
132
|
+
mplang/v2/edsl/serde.py,sha256=AKfryPMu9TiOqzkp5csck-wDHfksOgJEbndcH6tS6l0,11644
|
|
133
|
+
mplang/v2/edsl/tracer.py,sha256=HGrduMkEH8Cov19xCXmurVe46IMBjqdFxVP6C0zDoYI,22549
|
|
134
|
+
mplang/v2/edsl/typing.py,sha256=Ot2P8RNxVsE_sgsAFEPlH4l3MeVk3xrq0if6_8jf1nI,29290
|
|
135
|
+
mplang/v2/kernels/Makefile,sha256=5PoPpajcb_8ByPGNHzVytmovXUwkjJs_K8MbXX9qDYs,1033
|
|
136
|
+
mplang/v2/kernels/__init__.py,sha256=J_rDl9lAXd7QL3Nt_P3YX6j9yge7ssguSaHuafPZNKE,876
|
|
137
|
+
mplang/v2/kernels/gf128.cpp,sha256=WIvCr3MijzwJxMi1Wnfhm8aWT8oL0fia6FeyTmFJtPQ,5975
|
|
138
|
+
mplang/v2/kernels/ldpc.cpp,sha256=_zE90ZHQvrweRkBB3CEu80cXKG0a-QNJ59ZQ452gml8,2654
|
|
139
|
+
mplang/v2/kernels/okvs.cpp,sha256=Z_7oGHFAdLc5d5llUNujBO8HwDBh5yd3MpfmT8ZNf1o,10347
|
|
140
|
+
mplang/v2/kernels/okvs_opt.cpp,sha256=d_HhvMdcebYsG2x7kYzjuFgmEsh9WKLH6SHee3375Bg,10932
|
|
141
|
+
mplang/v2/kernels/py_kernels.py,sha256=FDsD86IHV-UBzxZLolhSOkrp24PuboHXeb1gBHLOfMo,12073
|
|
142
|
+
mplang/v2/libs/collective.py,sha256=pfXq9tmFUNKjeHhWMTjtzOi-m2Fn1lLru1G6txZVyic,10683
|
|
143
|
+
mplang/v2/libs/device/__init__.py,sha256=mXsSvXrWmlHu6Ch87Vcd85m4L_qdDkbSvJyHyuai2fc,1251
|
|
144
|
+
mplang/v2/libs/device/api.py,sha256=d_Wbka8bxxXsRMW6zDhjzL9LPtChSk2-ryfi-c4Mqsk,28830
|
|
145
|
+
mplang/v2/libs/device/cluster.py,sha256=YUqYZ_IBS6rpV5ejUFP3kTxcTQHSyeDeuaJcsiFY_Js,12508
|
|
146
|
+
mplang/v2/libs/ml/__init__.py,sha256=xTxhC_YwHP32muUEFCEwOjc-3Ml-vmO48NNECU90zm4,787
|
|
147
|
+
mplang/v2/libs/ml/sgb.py,sha256=T6GF9kYMHvuoffB567UlcwDoDCJ2SH7vttAABmgdmvU,60223
|
|
148
|
+
mplang/v2/libs/mpc/__init__.py,sha256=znADXBv0cATTvNN9pVOH8V47O5vmYZnR1Y7tfh1QVjw,1405
|
|
149
|
+
mplang/v2/libs/mpc/_utils.py,sha256=Xzt5jIQSm2e8_xFC6zrdKL93IqbTDb40apk2JBbEgBI,3215
|
|
150
|
+
mplang/v2/libs/mpc/analytics/__init__.py,sha256=8_1Sm05nrO2ISat1hNZT6UXHpKQ-SDBby1eeS-wm_fE,1204
|
|
151
|
+
mplang/v2/libs/mpc/analytics/aggregation.py,sha256=VPWwfcSV1kryG6EthjhOysh1RxH8xYczKnI_f7fmEgo,11648
|
|
152
|
+
mplang/v2/libs/mpc/analytics/groupby.md,sha256=_3oCouzGKlWt3OBMIFkhN25gyzJj6DlGpq-B78_PSlU,4679
|
|
153
|
+
mplang/v2/libs/mpc/analytics/groupby.py,sha256=3xXHYewJe28uu7BY1IwtsggKbU32LZkT81UZd67lmo4,11318
|
|
154
|
+
mplang/v2/libs/mpc/analytics/permutation.py,sha256=B-m9JtIMMc23C0AwfH_Yg5IF2XUIaMDT2IHluMNiiOM,13820
|
|
155
|
+
mplang/v2/libs/mpc/common/constants.py,sha256=YRRE8WkLGfdOZzicc976hPsPeZZkqho3aW41i5Mj72s,1316
|
|
156
|
+
mplang/v2/libs/mpc/ot/__init__.py,sha256=9Ivef7QnAzoCBtIohh2kzOSdfslcNftOwKV_d9Qv4z0,951
|
|
157
|
+
mplang/v2/libs/mpc/ot/base.py,sha256=J7jK8jwhXVlNIkIO9l7ZIRTPMYEDsuUQjP00nwPkMrs,7018
|
|
158
|
+
mplang/v2/libs/mpc/ot/extension.py,sha256=Z2br1HUin_wmosNPskx9o0bVGR5TF_pUIyp7lz7vPDI,17458
|
|
159
|
+
mplang/v2/libs/mpc/ot/silent.py,sha256=9J3sMsz3XzxPbIk91IpfAvvdGeZw-Tt0kElyPsNlnac,7879
|
|
160
|
+
mplang/v2/libs/mpc/psi/__init__.py,sha256=mpevlx3Z5_u9Q1McDZBBIGHApeO9julgiM09GToxxEA,1231
|
|
161
|
+
mplang/v2/libs/mpc/psi/cuckoo.py,sha256=GQvLi7BtaPZyk96xwVCwpQPGlcGhOUX6kdsEn8P80l0,7752
|
|
162
|
+
mplang/v2/libs/mpc/psi/okvs.py,sha256=a1Q4ILrsLII9K-BJRSX8iKkpkxJsMxFEj7cTId-XGCE,1576
|
|
163
|
+
mplang/v2/libs/mpc/psi/okvs_gct.py,sha256=wRxBEZw-dnYXHWng-1eRsnnP6k6wKySSUxigN9eq08k,3023
|
|
164
|
+
mplang/v2/libs/mpc/psi/oprf.py,sha256=YXD-I9P3t1YuqHVxOD9JUpLTZUu-HjgvOaEOQ3hhxMM,13772
|
|
165
|
+
mplang/v2/libs/mpc/psi/rr22.py,sha256=2mN1zbjrBUgaWCsF3Lj8ohtK6gcG95PtBb3EseS-Nsg,12614
|
|
166
|
+
mplang/v2/libs/mpc/psi/unbalanced.py,sha256=hC84TVsgnlJDg6hpUrx8kbUbmFb27T9wrHG0zv3FXLc,7433
|
|
167
|
+
mplang/v2/libs/mpc/vole/__init__.py,sha256=2dU4X6n73HoK-YCiCl4b36SkLRKR6rofe2xxLxBz6Rc,968
|
|
168
|
+
mplang/v2/libs/mpc/vole/gilboa.py,sha256=apnKOYR4_dJ2wkzGq7PBlwauA-W5i5MPESdetCWTegU,9951
|
|
169
|
+
mplang/v2/libs/mpc/vole/ldpc.py,sha256=1H_Dz1xdZTN2f3V6lz9NKBaY-How9Qu1GgwN0IJZero,12786
|
|
170
|
+
mplang/v2/libs/mpc/vole/silver.py,sha256=Qnk3EiA18i6RJl-iDCMHOwNdf0Zvkmxq_57O3Y0HPFw,12236
|
|
171
|
+
mplang/v2/runtime/__init__.py,sha256=VdUwJ3kDaI46FvGw7iMGwcsjt0HTGmmRmaBwj99xKIw,620
|
|
172
|
+
mplang/v2/runtime/dialect_state.py,sha256=HxO1i4kSOujS2tQzAF9-WmI3nChSaGgupf2_07dHetY,1277
|
|
173
|
+
mplang/v2/runtime/interpreter.py,sha256=UzrM5oepka6H0YKRZncNXhsuwKVm4pliG5J92fFRZMI,32300
|
|
174
|
+
mplang/v2/runtime/object_store.py,sha256=yT6jtKG2GUEJVmpq3gnQ8mCMvUFYzgBciC5A-J5KRdk,5998
|
|
175
|
+
mplang/v2/runtime/value.py,sha256=CMOxElJP78v7pjasPhEpbxWbSgB2KsLbpPmzz0mQX0E,4317
|
|
176
|
+
mplang_nightly-0.1.dev268.dist-info/METADATA,sha256=pIMljunrFh1RJ_3JlBim3jyAGc2GBkuXPwZH2LWfTlY,16775
|
|
177
|
+
mplang_nightly-0.1.dev268.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
178
|
+
mplang_nightly-0.1.dev268.dist-info/entry_points.txt,sha256=mG1oJT-GAjQR834a62_QIWb7litzWPPyVnwFqm-rWuY,55
|
|
179
|
+
mplang_nightly-0.1.dev268.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
180
|
+
mplang_nightly-0.1.dev268.dist-info/RECORD,,
|