mplang-nightly 0.1.dev278__py3-none-any.whl → 0.1.dev280__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 +32 -8
- mplang/backends/channel.py +1 -1
- mplang/backends/simp_driver/http.py +1 -1
- mplang/backends/simp_worker/http.py +8 -5
- mplang/backends/spu_impl.py +1 -1
- mplang/backends/table_impl.py +1 -1
- mplang/backends/tensor_impl.py +1 -1
- mplang/cli.py +1 -1
- mplang/edsl/__init__.py +3 -0
- mplang/edsl/jit.py +1 -1
- mplang/edsl/primitive.py +1 -1
- mplang/edsl/program.py +134 -0
- mplang/edsl/tracer.py +1 -1
- mplang/libs/device/api.py +1 -1
- mplang/runtime/interpreter.py +1 -1
- mplang/tool/__init__.py +46 -0
- mplang/tool/program.py +335 -0
- mplang/utils/__init__.py +4 -0
- mplang/{logging_config.py → utils/logging.py} +6 -19
- {mplang_nightly-0.1.dev278.dist-info → mplang_nightly-0.1.dev280.dist-info}/METADATA +1 -1
- {mplang_nightly-0.1.dev278.dist-info → mplang_nightly-0.1.dev280.dist-info}/RECORD +24 -21
- {mplang_nightly-0.1.dev278.dist-info → mplang_nightly-0.1.dev280.dist-info}/WHEEL +0 -0
- {mplang_nightly-0.1.dev278.dist-info → mplang_nightly-0.1.dev280.dist-info}/entry_points.txt +0 -0
- {mplang_nightly-0.1.dev278.dist-info → mplang_nightly-0.1.dev280.dist-info}/licenses/LICENSE +0 -0
mplang/__init__.py
CHANGED
|
@@ -34,6 +34,7 @@ except Exception:
|
|
|
34
34
|
# Fallback for development/editable installs when package is not installed
|
|
35
35
|
__version__ = "0.0.0-dev"
|
|
36
36
|
|
|
37
|
+
import mplang.tool as tool
|
|
37
38
|
from mplang import dialects
|
|
38
39
|
from mplang.backends.simp_driver.ops import DRIVER_HANDLERS
|
|
39
40
|
from mplang.backends.simp_worker import SimpWorker
|
|
@@ -41,6 +42,8 @@ from mplang.backends.simp_worker.mem import LocalMesh
|
|
|
41
42
|
from mplang.backends.simp_worker.ops import WORKER_HANDLERS
|
|
42
43
|
from mplang.dialects.simp import make_driver, make_simulator
|
|
43
44
|
from mplang.edsl import (
|
|
45
|
+
CompiledProgram,
|
|
46
|
+
FlatIOSignature,
|
|
44
47
|
Graph,
|
|
45
48
|
GraphPrinter,
|
|
46
49
|
Object,
|
|
@@ -91,10 +94,10 @@ from mplang.libs.device import (
|
|
|
91
94
|
set_dev_attr,
|
|
92
95
|
)
|
|
93
96
|
from mplang.libs.device import fetch as device_fetch
|
|
97
|
+
from mplang.runtime.interpreter import Interpreter
|
|
94
98
|
|
|
95
99
|
# Logging configuration
|
|
96
|
-
from mplang.
|
|
97
|
-
from mplang.runtime.interpreter import Interpreter
|
|
100
|
+
from mplang.utils.logging import disable_logging, get_logger, setup_logging
|
|
98
101
|
|
|
99
102
|
# =============================================================================
|
|
100
103
|
# Context Management API (JAX-like pattern)
|
|
@@ -125,7 +128,7 @@ def _get_context(context: Interpreter | None) -> Interpreter:
|
|
|
125
128
|
|
|
126
129
|
|
|
127
130
|
def evaluate(
|
|
128
|
-
fn: Callable[..., Any] | TracedFunction,
|
|
131
|
+
fn: Callable[..., Any] | TracedFunction | CompiledProgram,
|
|
129
132
|
*args: Any,
|
|
130
133
|
context: Interpreter | None = None,
|
|
131
134
|
**kwargs: Any,
|
|
@@ -158,15 +161,33 @@ def evaluate(
|
|
|
158
161
|
return val.runtime_obj
|
|
159
162
|
return val
|
|
160
163
|
|
|
164
|
+
def eval_graph(graph: Graph, inputs: list[Any]) -> list[InterpObject]:
|
|
165
|
+
runtime_inputs = [unwrap_if_interp(v) for v in inputs]
|
|
166
|
+
raw_result = interp.evaluate_graph(graph, runtime_inputs)
|
|
167
|
+
return [
|
|
168
|
+
InterpObject(v, graph.outputs[i].type, interp)
|
|
169
|
+
for i, v in enumerate(raw_result)
|
|
170
|
+
]
|
|
171
|
+
|
|
161
172
|
with interp:
|
|
173
|
+
if isinstance(fn, CompiledProgram):
|
|
174
|
+
if kwargs:
|
|
175
|
+
raise TypeError(
|
|
176
|
+
"mp.evaluate(CompiledProgram, ...) does not accept keyword arguments; "
|
|
177
|
+
"pass flat positional inputs only."
|
|
178
|
+
)
|
|
179
|
+
if len(args) != fn.signature.input_arity:
|
|
180
|
+
raise ValueError(
|
|
181
|
+
"CompiledProgram requires flat positional inputs matching its signature; "
|
|
182
|
+
f"expected {fn.signature.input_arity}, got {len(args)}."
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
return eval_graph(fn.graph, list(args))
|
|
186
|
+
|
|
162
187
|
if isinstance(fn, TracedFunction):
|
|
163
188
|
inputs = fn.prepare_inputs(*args, **kwargs)
|
|
164
189
|
inputs = [unwrap_if_interp(v) for v in inputs]
|
|
165
|
-
|
|
166
|
-
wrapped = [
|
|
167
|
-
InterpObject(v, fn.graph.outputs[i].type, interp)
|
|
168
|
-
for i, v in enumerate(raw_result)
|
|
169
|
-
]
|
|
190
|
+
wrapped = eval_graph(fn.graph, inputs)
|
|
170
191
|
return fn.reconstruct_outputs(wrapped)
|
|
171
192
|
|
|
172
193
|
return fn(*args, **kwargs)
|
|
@@ -417,6 +438,9 @@ __all__ = [ # noqa: RUF022
|
|
|
417
438
|
"WORKER_HANDLERS",
|
|
418
439
|
"make_driver",
|
|
419
440
|
"make_simulator",
|
|
441
|
+
"tool",
|
|
442
|
+
"CompiledProgram",
|
|
443
|
+
"FlatIOSignature",
|
|
420
444
|
# Dialects
|
|
421
445
|
"dialects",
|
|
422
446
|
"register_default_context_factory",
|
mplang/backends/channel.py
CHANGED
|
@@ -25,9 +25,9 @@ import httpx
|
|
|
25
25
|
|
|
26
26
|
from mplang.backends.simp_driver.state import SimpDriver
|
|
27
27
|
from mplang.edsl import serde
|
|
28
|
-
from mplang.logging_config import get_logger
|
|
29
28
|
from mplang.runtime.interpreter import Interpreter
|
|
30
29
|
from mplang.runtime.object_store import ObjectStore
|
|
30
|
+
from mplang.utils.logging import get_logger
|
|
31
31
|
|
|
32
32
|
logger = get_logger(__name__)
|
|
33
33
|
|
|
@@ -54,9 +54,9 @@ from mplang.backends.simp_worker import SimpWorker
|
|
|
54
54
|
from mplang.backends.simp_worker import ops as _simp_worker_ops # noqa: F401
|
|
55
55
|
from mplang.edsl import serde
|
|
56
56
|
from mplang.edsl.graph import Graph
|
|
57
|
-
from mplang.logging_config import get_logger
|
|
58
57
|
from mplang.runtime.interpreter import ExecutionTracer, Interpreter
|
|
59
58
|
from mplang.runtime.object_store import ObjectStore
|
|
59
|
+
from mplang.utils.logging import get_logger
|
|
60
60
|
|
|
61
61
|
logger = get_logger(__name__)
|
|
62
62
|
|
|
@@ -212,6 +212,7 @@ def create_worker_app(
|
|
|
212
212
|
world_size: int,
|
|
213
213
|
endpoints: list[str],
|
|
214
214
|
spu_endpoints: dict[int, str] | None = None,
|
|
215
|
+
enable_tracing: bool = False,
|
|
215
216
|
) -> FastAPI:
|
|
216
217
|
"""Create a FastAPI app for the worker.
|
|
217
218
|
|
|
@@ -224,6 +225,7 @@ def create_worker_app(
|
|
|
224
225
|
world_size: Total number of workers.
|
|
225
226
|
endpoints: HTTP endpoints for all workers (for shuffle communication).
|
|
226
227
|
spu_endpoints: Optional dict mapping global_rank -> BRPC endpoint for SPU.
|
|
228
|
+
enable_tracing: Whether to enable execution tracing for profiler.
|
|
227
229
|
|
|
228
230
|
Returns:
|
|
229
231
|
FastAPI application instance
|
|
@@ -236,11 +238,12 @@ def create_worker_app(
|
|
|
236
238
|
data_root = pathlib.Path(os.environ.get("MPLANG_DATA_ROOT", ".mpl"))
|
|
237
239
|
cluster_id = os.environ.get("MPLANG_CLUSTER_ID", f"__http_{world_size}")
|
|
238
240
|
root_dir = data_root / cluster_id / f"node{rank}"
|
|
239
|
-
trace_dir = root_dir / "trace"
|
|
240
241
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
tracer = None
|
|
243
|
+
if enable_tracing:
|
|
244
|
+
trace_dir = root_dir / "trace"
|
|
245
|
+
tracer = ExecutionTracer(enabled=True, trace_dir=trace_dir)
|
|
246
|
+
tracer.start()
|
|
244
247
|
|
|
245
248
|
comm = HttpCommunicator(rank, world_size, endpoints, tracer=tracer)
|
|
246
249
|
store = ObjectStore(fs_root=str(root_dir))
|
mplang/backends/spu_impl.py
CHANGED
|
@@ -31,9 +31,9 @@ from mplang.backends.tensor_impl import TensorValue
|
|
|
31
31
|
from mplang.dialects import spu
|
|
32
32
|
from mplang.edsl import serde
|
|
33
33
|
from mplang.edsl.graph import Operation
|
|
34
|
-
from mplang.logging_config import get_logger
|
|
35
34
|
from mplang.runtime.interpreter import Interpreter
|
|
36
35
|
from mplang.runtime.value import WrapValue
|
|
36
|
+
from mplang.utils.logging import get_logger
|
|
37
37
|
|
|
38
38
|
logger = get_logger(__name__)
|
|
39
39
|
|
mplang/backends/table_impl.py
CHANGED
|
@@ -33,9 +33,9 @@ from mplang.backends.tensor_impl import TensorValue
|
|
|
33
33
|
from mplang.dialects import table
|
|
34
34
|
from mplang.edsl import serde
|
|
35
35
|
from mplang.edsl.graph import Operation
|
|
36
|
-
from mplang.logging_config import get_logger
|
|
37
36
|
from mplang.runtime.interpreter import Interpreter
|
|
38
37
|
from mplang.runtime.value import WrapValue
|
|
38
|
+
from mplang.utils.logging import get_logger
|
|
39
39
|
|
|
40
40
|
logger = get_logger(__name__)
|
|
41
41
|
|
mplang/backends/tensor_impl.py
CHANGED
|
@@ -36,9 +36,9 @@ import mplang.edsl.typing as elt
|
|
|
36
36
|
from mplang.dialects import dtypes, tensor
|
|
37
37
|
from mplang.edsl import serde
|
|
38
38
|
from mplang.edsl.graph import Operation
|
|
39
|
-
from mplang.logging_config import get_logger
|
|
40
39
|
from mplang.runtime.interpreter import Interpreter
|
|
41
40
|
from mplang.runtime.value import Value, WrapValue
|
|
41
|
+
from mplang.utils.logging import get_logger
|
|
42
42
|
|
|
43
43
|
logger = get_logger(__name__)
|
|
44
44
|
|
mplang/cli.py
CHANGED
mplang/edsl/__init__.py
CHANGED
|
@@ -53,6 +53,7 @@ from .jit import jit
|
|
|
53
53
|
from .object import Object
|
|
54
54
|
from .primitive import Primitive, primitive
|
|
55
55
|
from .printer import GraphPrinter, format_graph
|
|
56
|
+
from .program import CompiledProgram, FlatIOSignature
|
|
56
57
|
from .tracer import TracedFunction, TraceObject, Tracer, trace
|
|
57
58
|
from .typing import MPType, ScalarType, SSType, TableType, TensorType, VectorType
|
|
58
59
|
|
|
@@ -65,7 +66,9 @@ TensorObject = Object[TensorType]
|
|
|
65
66
|
VectorObject = Object[VectorType]
|
|
66
67
|
|
|
67
68
|
__all__ = [
|
|
69
|
+
"CompiledProgram",
|
|
68
70
|
"Context",
|
|
71
|
+
"FlatIOSignature",
|
|
69
72
|
"Graph",
|
|
70
73
|
"GraphPrinter",
|
|
71
74
|
"MPObject",
|
mplang/edsl/jit.py
CHANGED
mplang/edsl/primitive.py
CHANGED
|
@@ -29,7 +29,7 @@ from jax.tree_util import tree_map
|
|
|
29
29
|
|
|
30
30
|
from mplang.edsl.context import get_current_context, get_default_context
|
|
31
31
|
from mplang.edsl.object import Object
|
|
32
|
-
from mplang.
|
|
32
|
+
from mplang.utils.logging import get_logger
|
|
33
33
|
|
|
34
34
|
if TYPE_CHECKING:
|
|
35
35
|
from mplang.edsl.typing import BaseType
|
mplang/edsl/program.py
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Copyright 2026 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
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import hashlib
|
|
18
|
+
import json
|
|
19
|
+
from dataclasses import dataclass
|
|
20
|
+
from typing import Any, ClassVar
|
|
21
|
+
|
|
22
|
+
from mplang.edsl import serde
|
|
23
|
+
from mplang.edsl.graph import Graph
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@dataclass(frozen=True)
|
|
27
|
+
class FlatIOSignature:
|
|
28
|
+
"""Portable I/O signature for source-free execution.
|
|
29
|
+
|
|
30
|
+
Only supports flat positional inputs/outputs corresponding to
|
|
31
|
+
`graph.inputs` / `graph.outputs`.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
kind: ClassVar[str] = "flat_list_v0"
|
|
35
|
+
input_arity: int
|
|
36
|
+
output_arity: int
|
|
37
|
+
|
|
38
|
+
def to_json(self) -> dict[str, Any]:
|
|
39
|
+
return {
|
|
40
|
+
"kind": self.kind,
|
|
41
|
+
"input_arity": self.input_arity,
|
|
42
|
+
"output_arity": self.output_arity,
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@classmethod
|
|
46
|
+
def from_json(cls, data: dict[str, Any]) -> FlatIOSignature:
|
|
47
|
+
if data.get("kind") != cls.kind:
|
|
48
|
+
raise ValueError(f"Unsupported signature kind: {data.get('kind')}")
|
|
49
|
+
return cls(
|
|
50
|
+
input_arity=int(data["input_arity"]),
|
|
51
|
+
output_arity=int(data["output_arity"]),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
@serde.register_class
|
|
56
|
+
@dataclass
|
|
57
|
+
class CompiledProgram:
|
|
58
|
+
"""Executable program decoupled from user source.
|
|
59
|
+
|
|
60
|
+
This is a *logical model*; packaging (file/zip/etc.) is handled by tool layer.
|
|
61
|
+
|
|
62
|
+
Current constraints:
|
|
63
|
+
- signature is flat positional list I/O.
|
|
64
|
+
- no closure captures.
|
|
65
|
+
- no constant outputs (out_imms) unless future signature captures them.
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
_serde_kind: ClassVar[str] = "mplang.CompiledProgram"
|
|
69
|
+
|
|
70
|
+
graph: Graph
|
|
71
|
+
signature: FlatIOSignature
|
|
72
|
+
required_opcodes: list[str]
|
|
73
|
+
graph_digest: str
|
|
74
|
+
required_world_size: int | None = None
|
|
75
|
+
created_at: str | None = None
|
|
76
|
+
mplang_version: str | None = None
|
|
77
|
+
schema_version: int = 1
|
|
78
|
+
name: str | None = None
|
|
79
|
+
|
|
80
|
+
def to_json(self) -> dict[str, Any]:
|
|
81
|
+
return {
|
|
82
|
+
"schema_version": self.schema_version,
|
|
83
|
+
"name": self.name,
|
|
84
|
+
"graph": serde.to_json(self.graph),
|
|
85
|
+
"signature": self.signature.to_json(),
|
|
86
|
+
"required_opcodes": list(self.required_opcodes),
|
|
87
|
+
"graph_digest": self.graph_digest,
|
|
88
|
+
"required_world_size": self.required_world_size,
|
|
89
|
+
"created_at": self.created_at,
|
|
90
|
+
"mplang_version": self.mplang_version,
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@classmethod
|
|
94
|
+
def from_json(cls, data: dict[str, Any]) -> CompiledProgram:
|
|
95
|
+
if "schema_version" not in data:
|
|
96
|
+
raise KeyError("Missing required field: schema_version")
|
|
97
|
+
schema_version = int(data["schema_version"])
|
|
98
|
+
if schema_version != 1:
|
|
99
|
+
raise ValueError(
|
|
100
|
+
f"Unsupported CompiledProgram schema_version: {schema_version}"
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
graph = serde.from_json(data["graph"])
|
|
104
|
+
if not isinstance(graph, Graph):
|
|
105
|
+
raise TypeError(
|
|
106
|
+
f"Expected graph to deserialize to Graph, got {type(graph).__name__}"
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
signature = FlatIOSignature.from_json(data["signature"])
|
|
110
|
+
|
|
111
|
+
required_world_size = data.get("required_world_size")
|
|
112
|
+
if required_world_size is not None:
|
|
113
|
+
required_world_size = int(required_world_size)
|
|
114
|
+
return cls(
|
|
115
|
+
graph=graph,
|
|
116
|
+
signature=signature,
|
|
117
|
+
required_opcodes=list(data.get("required_opcodes", [])),
|
|
118
|
+
graph_digest=str(data["graph_digest"]),
|
|
119
|
+
required_world_size=required_world_size,
|
|
120
|
+
created_at=data.get("created_at"),
|
|
121
|
+
mplang_version=data.get("mplang_version"),
|
|
122
|
+
schema_version=schema_version,
|
|
123
|
+
name=data.get("name"),
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def compute_graph_digest(graph: Graph) -> str:
|
|
128
|
+
"""Compute a deterministic digest for a Graph.
|
|
129
|
+
|
|
130
|
+
We intentionally avoid `serde.dumps()` because it doesn't sort keys.
|
|
131
|
+
"""
|
|
132
|
+
|
|
133
|
+
canonical = json.dumps(serde.to_json(graph), sort_keys=True, separators=(",", ":"))
|
|
134
|
+
return hashlib.sha256(canonical.encode("utf-8")).hexdigest()
|
mplang/edsl/tracer.py
CHANGED
|
@@ -36,7 +36,7 @@ from mplang.edsl.graph import Graph
|
|
|
36
36
|
from mplang.edsl.graph import Value as GraphValue
|
|
37
37
|
from mplang.edsl.object import Object
|
|
38
38
|
from mplang.edsl.typing import BaseType
|
|
39
|
-
from mplang.
|
|
39
|
+
from mplang.utils.logging import get_logger
|
|
40
40
|
|
|
41
41
|
if TYPE_CHECKING:
|
|
42
42
|
from mplang.edsl.primitive import Primitive
|
mplang/libs/device/api.py
CHANGED
|
@@ -32,7 +32,7 @@ from mplang.backends import load_builtins
|
|
|
32
32
|
from mplang.dialects import crypto, simp, spu, tee
|
|
33
33
|
from mplang.edsl.object import Object
|
|
34
34
|
from mplang.libs.device.cluster import Device
|
|
35
|
-
from mplang.
|
|
35
|
+
from mplang.utils.logging import get_logger
|
|
36
36
|
|
|
37
37
|
load_builtins()
|
|
38
38
|
|
mplang/runtime/interpreter.py
CHANGED
|
@@ -40,9 +40,9 @@ from mplang.edsl.graph import Graph, Value
|
|
|
40
40
|
from mplang.edsl.object import Object
|
|
41
41
|
from mplang.edsl.registry import get_impl
|
|
42
42
|
from mplang.edsl.typing import BaseType
|
|
43
|
-
from mplang.logging_config import get_logger
|
|
44
43
|
from mplang.runtime.dialect_state import DialectState
|
|
45
44
|
from mplang.runtime.object_store import ObjectStore
|
|
45
|
+
from mplang.utils.logging import get_logger
|
|
46
46
|
|
|
47
47
|
if TYPE_CHECKING:
|
|
48
48
|
from mplang.edsl.primitive import Primitive
|
mplang/tool/__init__.py
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Copyright 2026 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
|
+
"""Tool-layer APIs for MPLang.
|
|
16
|
+
|
|
17
|
+
This package contains utilities that are intentionally *not* part of the core
|
|
18
|
+
EDSL execution surface. In particular, compile/execute decoupling lives here:
|
|
19
|
+
- build a portable `CompiledProgram`
|
|
20
|
+
- pack/unpack to a container format
|
|
21
|
+
|
|
22
|
+
These helpers must not depend on user source code being available at execution.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
from __future__ import annotations
|
|
26
|
+
|
|
27
|
+
from mplang.edsl.program import CompiledProgram, FlatIOSignature
|
|
28
|
+
from mplang.tool.program import (
|
|
29
|
+
compile_program,
|
|
30
|
+
inspect_artifact,
|
|
31
|
+
pack,
|
|
32
|
+
pack_to_path,
|
|
33
|
+
unpack,
|
|
34
|
+
unpack_path,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
__all__ = [
|
|
38
|
+
"CompiledProgram",
|
|
39
|
+
"FlatIOSignature",
|
|
40
|
+
"compile_program",
|
|
41
|
+
"inspect_artifact",
|
|
42
|
+
"pack",
|
|
43
|
+
"pack_to_path",
|
|
44
|
+
"unpack",
|
|
45
|
+
"unpack_path",
|
|
46
|
+
]
|
mplang/tool/program.py
ADDED
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
# Copyright 2026 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
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import io
|
|
18
|
+
import json
|
|
19
|
+
import tarfile
|
|
20
|
+
from datetime import UTC, datetime
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
from typing import Any, Literal
|
|
23
|
+
|
|
24
|
+
import mplang
|
|
25
|
+
from mplang.edsl import serde
|
|
26
|
+
from mplang.edsl.graph import Graph
|
|
27
|
+
from mplang.edsl.program import (
|
|
28
|
+
CompiledProgram,
|
|
29
|
+
FlatIOSignature,
|
|
30
|
+
compute_graph_digest,
|
|
31
|
+
)
|
|
32
|
+
from mplang.edsl.tracer import TracedFunction, trace
|
|
33
|
+
|
|
34
|
+
DEFAULT_MAX_ARTIFACT_JSON_BYTES = 512 * 1024 * 1024 # 512 MiB
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _utc_now_iso() -> str:
|
|
38
|
+
return datetime.now(UTC).isoformat()
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def _iter_graphs(root: Graph) -> list[Graph]:
|
|
42
|
+
# Use an explicit stack to avoid Python recursion limits.
|
|
43
|
+
# Also guard against potential region graph cycles.
|
|
44
|
+
out: list[Graph] = []
|
|
45
|
+
stack: list[Graph] = [root]
|
|
46
|
+
visited: set[int] = set()
|
|
47
|
+
while stack:
|
|
48
|
+
graph = stack.pop()
|
|
49
|
+
graph_id = id(graph)
|
|
50
|
+
if graph_id in visited:
|
|
51
|
+
continue
|
|
52
|
+
visited.add(graph_id)
|
|
53
|
+
out.append(graph)
|
|
54
|
+
|
|
55
|
+
for op in graph.operations:
|
|
56
|
+
if op.regions:
|
|
57
|
+
stack.extend(op.regions)
|
|
58
|
+
|
|
59
|
+
return out
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def _collect_opcodes(graph: Graph) -> set[str]:
|
|
63
|
+
opcodes: set[str] = set()
|
|
64
|
+
for g in _iter_graphs(graph):
|
|
65
|
+
for op in g.operations:
|
|
66
|
+
opcodes.add(op.opcode)
|
|
67
|
+
return opcodes
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def _collect_parties(graph: Graph) -> set[int]:
|
|
71
|
+
parties: set[int] = set()
|
|
72
|
+
for g in _iter_graphs(graph):
|
|
73
|
+
for op in g.operations:
|
|
74
|
+
raw = op.attrs.get("parties")
|
|
75
|
+
if raw is None:
|
|
76
|
+
continue
|
|
77
|
+
|
|
78
|
+
if not isinstance(raw, (list, tuple, set)):
|
|
79
|
+
raise TypeError(
|
|
80
|
+
"Invalid 'parties' attribute: expected list/tuple/set of ints, "
|
|
81
|
+
f"got {type(raw).__name__}"
|
|
82
|
+
)
|
|
83
|
+
for p in raw:
|
|
84
|
+
p_int = int(p)
|
|
85
|
+
if p_int < 0:
|
|
86
|
+
raise ValueError("Invalid 'parties' attribute: negative party id")
|
|
87
|
+
parties.add(p_int)
|
|
88
|
+
return parties
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def _compute_required_world_size(graph: Graph) -> int:
|
|
92
|
+
parties = _collect_parties(graph)
|
|
93
|
+
if not parties:
|
|
94
|
+
return 0
|
|
95
|
+
return max(parties) + 1
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def _validate_traced_for_artifact(traced: TracedFunction) -> None:
|
|
99
|
+
# Restriction: no closure captures
|
|
100
|
+
if traced.captured:
|
|
101
|
+
raise ValueError(
|
|
102
|
+
"CompiledProgram does not support closure captures; "
|
|
103
|
+
"please refactor to pass all values explicitly."
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
# Restriction: no constant outputs (out_imms)
|
|
107
|
+
if traced.out_imms:
|
|
108
|
+
raise ValueError(
|
|
109
|
+
"CompiledProgram does not support constant outputs (out_imms); "
|
|
110
|
+
"return only traced values (graph outputs)."
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
# Restriction: signature is flat positional list I/O.
|
|
114
|
+
# We do not preserve (args, kwargs) pytree metadata.
|
|
115
|
+
# We therefore require all runtime-provided inputs correspond exactly to graph.inputs.
|
|
116
|
+
if len(traced.graph.inputs) != len(traced.in_var_pos):
|
|
117
|
+
raise ValueError(
|
|
118
|
+
"CompiledProgram requires flat positional inputs that map 1:1 to graph.inputs; "
|
|
119
|
+
f"got graph.inputs={len(traced.graph.inputs)} but in_var_pos={len(traced.in_var_pos)}."
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def _validate_program(program: CompiledProgram) -> None:
|
|
124
|
+
if program.signature.kind != FlatIOSignature.kind:
|
|
125
|
+
raise ValueError(f"Unsupported signature kind: {program.signature.kind}")
|
|
126
|
+
|
|
127
|
+
if program.signature.input_arity != len(program.graph.inputs):
|
|
128
|
+
raise ValueError(
|
|
129
|
+
"Signature input_arity does not match graph.inputs: "
|
|
130
|
+
f"input_arity={program.signature.input_arity}, inputs={len(program.graph.inputs)}"
|
|
131
|
+
)
|
|
132
|
+
if program.signature.output_arity != len(program.graph.outputs):
|
|
133
|
+
raise ValueError(
|
|
134
|
+
"Signature output_arity does not match graph.outputs: "
|
|
135
|
+
f"output_arity={program.signature.output_arity}, outputs={len(program.graph.outputs)}"
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
expected_opcodes = sorted(_collect_opcodes(program.graph))
|
|
139
|
+
if sorted(program.required_opcodes) != expected_opcodes:
|
|
140
|
+
raise ValueError(
|
|
141
|
+
"required_opcodes mismatch with graph content; "
|
|
142
|
+
"artifact may be corrupted or constructed inconsistently."
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
actual_digest = compute_graph_digest(program.graph)
|
|
146
|
+
if program.graph_digest and program.graph_digest != actual_digest:
|
|
147
|
+
raise ValueError(
|
|
148
|
+
"Graph digest mismatch: "
|
|
149
|
+
f"expected={program.graph_digest}, actual={actual_digest}"
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
expected_world_size = _compute_required_world_size(program.graph)
|
|
153
|
+
if (
|
|
154
|
+
program.required_world_size is not None
|
|
155
|
+
and program.required_world_size != expected_world_size
|
|
156
|
+
):
|
|
157
|
+
raise ValueError(
|
|
158
|
+
"required_world_size mismatch with graph content; "
|
|
159
|
+
f"expected={expected_world_size}, got={program.required_world_size}."
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
# Ensure JSON serialization works (fail fast for non-serde attrs).
|
|
163
|
+
serde.to_json(program)
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
def compile_program(
|
|
167
|
+
fn_or_traced: Any,
|
|
168
|
+
*args: Any,
|
|
169
|
+
context: Any | None = None,
|
|
170
|
+
name: str | None = None,
|
|
171
|
+
**kwargs: Any,
|
|
172
|
+
) -> CompiledProgram:
|
|
173
|
+
"""Compile (trace) into a source-free executable `CompiledProgram`.
|
|
174
|
+
|
|
175
|
+
Restrictions (enforced):
|
|
176
|
+
- no closure captures
|
|
177
|
+
- no constant outputs (`out_imms` must be empty)
|
|
178
|
+
- signature is flat list (positional) I/O
|
|
179
|
+
|
|
180
|
+
Note: `in_imms` (compile-time constants) are allowed: they are baked into the graph.
|
|
181
|
+
"""
|
|
182
|
+
|
|
183
|
+
traced: TracedFunction
|
|
184
|
+
if isinstance(fn_or_traced, TracedFunction):
|
|
185
|
+
traced = fn_or_traced
|
|
186
|
+
else:
|
|
187
|
+
if context is not None:
|
|
188
|
+
with context:
|
|
189
|
+
traced = trace(fn_or_traced, *args, **kwargs)
|
|
190
|
+
else:
|
|
191
|
+
traced = trace(fn_or_traced, *args, **kwargs)
|
|
192
|
+
|
|
193
|
+
_validate_traced_for_artifact(traced)
|
|
194
|
+
|
|
195
|
+
signature = FlatIOSignature(
|
|
196
|
+
input_arity=len(traced.graph.inputs),
|
|
197
|
+
output_arity=len(traced.graph.outputs),
|
|
198
|
+
)
|
|
199
|
+
|
|
200
|
+
required_opcodes = sorted(_collect_opcodes(traced.graph))
|
|
201
|
+
graph_digest = compute_graph_digest(traced.graph)
|
|
202
|
+
required_world_size = _compute_required_world_size(traced.graph)
|
|
203
|
+
|
|
204
|
+
program = CompiledProgram(
|
|
205
|
+
graph=traced.graph,
|
|
206
|
+
signature=signature,
|
|
207
|
+
required_opcodes=required_opcodes,
|
|
208
|
+
graph_digest=graph_digest,
|
|
209
|
+
required_world_size=required_world_size,
|
|
210
|
+
created_at=_utc_now_iso(),
|
|
211
|
+
mplang_version=getattr(mplang, "__version__", None),
|
|
212
|
+
name=name or traced.name,
|
|
213
|
+
)
|
|
214
|
+
return program
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
def pack(program: CompiledProgram, *, compress: bool = True) -> bytes:
|
|
218
|
+
"""Pack a `CompiledProgram` into portable bytes.
|
|
219
|
+
|
|
220
|
+
Container format (recommended): a `tar.gz` archive containing a single
|
|
221
|
+
human-readable JSON file `artifact.json`.
|
|
222
|
+
|
|
223
|
+
This allows users to inspect artifacts via:
|
|
224
|
+
`tar -xzf program.tar.gz && cat artifact.json`
|
|
225
|
+
|
|
226
|
+
If `compress=False`, returns an uncompressed tar archive (still extractable
|
|
227
|
+
via `tar -xf`).
|
|
228
|
+
"""
|
|
229
|
+
|
|
230
|
+
artifact_json = json.dumps(
|
|
231
|
+
serde.to_json(program),
|
|
232
|
+
ensure_ascii=False,
|
|
233
|
+
indent=2,
|
|
234
|
+
sort_keys=True,
|
|
235
|
+
).encode("utf-8")
|
|
236
|
+
|
|
237
|
+
buf = io.BytesIO()
|
|
238
|
+
mode: Literal["w:gz", "w"] = "w:gz" if compress else "w"
|
|
239
|
+
with tarfile.open(fileobj=buf, mode=mode) as tf:
|
|
240
|
+
info = tarfile.TarInfo(name="artifact.json")
|
|
241
|
+
info.size = len(artifact_json)
|
|
242
|
+
tf.addfile(info, io.BytesIO(artifact_json))
|
|
243
|
+
|
|
244
|
+
return buf.getvalue()
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
def pack_to_path(
|
|
248
|
+
program: CompiledProgram, path: str | Path, *, compress: bool = True
|
|
249
|
+
) -> Path:
|
|
250
|
+
"""Pack and write artifact to disk.
|
|
251
|
+
|
|
252
|
+
Args:
|
|
253
|
+
program: Program to pack.
|
|
254
|
+
path: Output path (typically ends with `.tar.gz`).
|
|
255
|
+
compress: Whether to gzip the tar archive.
|
|
256
|
+
|
|
257
|
+
Returns:
|
|
258
|
+
The resolved output path.
|
|
259
|
+
"""
|
|
260
|
+
|
|
261
|
+
out_path = Path(path).expanduser().resolve()
|
|
262
|
+
out_path.write_bytes(pack(program, compress=compress))
|
|
263
|
+
return out_path
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
def unpack(
|
|
267
|
+
data: bytes, *, max_artifact_json_bytes: int = DEFAULT_MAX_ARTIFACT_JSON_BYTES
|
|
268
|
+
) -> CompiledProgram:
|
|
269
|
+
"""Unpack bytes into a `CompiledProgram`.
|
|
270
|
+
|
|
271
|
+
Supported container format: tar(.gz) containing `artifact.json`.
|
|
272
|
+
"""
|
|
273
|
+
|
|
274
|
+
try:
|
|
275
|
+
with tarfile.open(fileobj=io.BytesIO(data), mode="r:*") as tf:
|
|
276
|
+
member = tf.getmember("artifact.json")
|
|
277
|
+
|
|
278
|
+
if not member.isfile():
|
|
279
|
+
raise ValueError("artifact.json is not a regular file")
|
|
280
|
+
|
|
281
|
+
if member.size < 0:
|
|
282
|
+
raise ValueError("Invalid artifact.json size in tar header")
|
|
283
|
+
|
|
284
|
+
if member.size > max_artifact_json_bytes:
|
|
285
|
+
raise ValueError(
|
|
286
|
+
"artifact.json is too large to unpack safely: "
|
|
287
|
+
f"size={member.size} bytes, limit={max_artifact_json_bytes} bytes"
|
|
288
|
+
)
|
|
289
|
+
|
|
290
|
+
f = tf.extractfile(member)
|
|
291
|
+
if f is None:
|
|
292
|
+
raise ValueError("artifact.json not found in tar archive")
|
|
293
|
+
payload = json.loads(f.read().decode("utf-8"))
|
|
294
|
+
except (tarfile.ReadError, KeyError, OSError, json.JSONDecodeError) as exc:
|
|
295
|
+
raise ValueError(
|
|
296
|
+
"Invalid artifact container: expected tar(.gz) with artifact.json"
|
|
297
|
+
) from exc
|
|
298
|
+
|
|
299
|
+
program = serde.from_json(payload)
|
|
300
|
+
if not isinstance(program, CompiledProgram):
|
|
301
|
+
raise TypeError(
|
|
302
|
+
f"Expected artifact.json to deserialize to CompiledProgram, got {type(program).__name__}"
|
|
303
|
+
)
|
|
304
|
+
|
|
305
|
+
_validate_program(program)
|
|
306
|
+
return program
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
def unpack_path(path: str | Path) -> CompiledProgram:
|
|
310
|
+
"""Read an artifact from disk and unpack it."""
|
|
311
|
+
|
|
312
|
+
in_path = Path(path).expanduser().resolve()
|
|
313
|
+
return unpack(in_path.read_bytes())
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
def inspect_artifact(data: bytes) -> dict[str, Any]:
|
|
317
|
+
"""Return a JSON-friendly inspection report without executing."""
|
|
318
|
+
|
|
319
|
+
program = unpack(data)
|
|
320
|
+
return {
|
|
321
|
+
"schema_version": program.schema_version,
|
|
322
|
+
"name": program.name,
|
|
323
|
+
"mplang_version": program.mplang_version,
|
|
324
|
+
"created_at": program.created_at,
|
|
325
|
+
"graph_digest": program.graph_digest,
|
|
326
|
+
"required_world_size": program.required_world_size,
|
|
327
|
+
"signature": program.signature.to_json(),
|
|
328
|
+
"required_opcodes": program.required_opcodes,
|
|
329
|
+
"graph": {
|
|
330
|
+
"inputs": len(program.graph.inputs),
|
|
331
|
+
"ops": len(program.graph.operations),
|
|
332
|
+
"outputs": len(program.graph.outputs),
|
|
333
|
+
"region_count": sum(len(op.regions) for op in program.graph.operations),
|
|
334
|
+
},
|
|
335
|
+
}
|
mplang/utils/__init__.py
CHANGED
|
@@ -22,13 +22,17 @@ from .func_utils import (
|
|
|
22
22
|
var_demorph,
|
|
23
23
|
var_morph,
|
|
24
24
|
)
|
|
25
|
+
from .logging import disable_logging, get_logger, setup_logging
|
|
25
26
|
|
|
26
27
|
__all__ = [
|
|
27
28
|
"MorphStruct",
|
|
29
|
+
"disable_logging",
|
|
30
|
+
"get_logger",
|
|
28
31
|
"is_treedef_list",
|
|
29
32
|
"list_reconstruct",
|
|
30
33
|
"list_split",
|
|
31
34
|
"normalize_fn",
|
|
35
|
+
"setup_logging",
|
|
32
36
|
"validate_morph_struct",
|
|
33
37
|
"var_demorph",
|
|
34
38
|
"var_morph",
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
"""
|
|
16
|
-
Logging configuration for MPLang.
|
|
15
|
+
"""Logging configuration for MPLang.
|
|
17
16
|
|
|
18
17
|
This module provides a unified logging setup for the MPLang library.
|
|
19
18
|
When MPLang is used as a library, logging is disabled by default (NullHandler),
|
|
@@ -31,6 +30,8 @@ Example usage:
|
|
|
31
30
|
... )
|
|
32
31
|
"""
|
|
33
32
|
|
|
33
|
+
from __future__ import annotations
|
|
34
|
+
|
|
34
35
|
import logging
|
|
35
36
|
import sys
|
|
36
37
|
from typing import Any, Literal
|
|
@@ -52,8 +53,7 @@ def setup_logging(
|
|
|
52
53
|
force: bool = False,
|
|
53
54
|
propagate: bool = False,
|
|
54
55
|
) -> None:
|
|
55
|
-
"""
|
|
56
|
-
Configure logging for MPLang.
|
|
56
|
+
"""Configure logging for MPLang.
|
|
57
57
|
|
|
58
58
|
This function sets up a logger for all MPLang components. By default,
|
|
59
59
|
MPLang uses a NullHandler to suppress log output when used as a library.
|
|
@@ -143,8 +143,7 @@ def setup_logging(
|
|
|
143
143
|
|
|
144
144
|
|
|
145
145
|
def disable_logging() -> None:
|
|
146
|
-
"""
|
|
147
|
-
Disable all MPLang logging by adding a NullHandler.
|
|
146
|
+
"""Disable all MPLang logging by adding a NullHandler.
|
|
148
147
|
|
|
149
148
|
This is useful for testing or when you want to completely suppress
|
|
150
149
|
MPLang log output.
|
|
@@ -163,21 +162,9 @@ def disable_logging() -> None:
|
|
|
163
162
|
|
|
164
163
|
|
|
165
164
|
def get_logger(name: str) -> logging.Logger:
|
|
166
|
-
"""
|
|
167
|
-
Get a logger for a specific MPLang module.
|
|
165
|
+
"""Get a logger for a specific MPLang module.
|
|
168
166
|
|
|
169
|
-
This function should be used by all MPLang modules to create their loggers.
|
|
170
167
|
The logger name will be prefixed with 'mplang' automatically if not already.
|
|
171
|
-
|
|
172
|
-
Args:
|
|
173
|
-
name: Module name, typically __name__ from the calling module.
|
|
174
|
-
|
|
175
|
-
Returns:
|
|
176
|
-
A logger instance for the specified module.
|
|
177
|
-
|
|
178
|
-
Example:
|
|
179
|
-
>>> # In mplang/edsl/tracer.py
|
|
180
|
-
>>> logger = get_logger(__name__) # Creates 'mplang.edsl.tracer' logger
|
|
181
168
|
"""
|
|
182
169
|
# Ensure the logger name is under mplang hierarchy
|
|
183
170
|
if not name.startswith(MPLANG_LOGGER_NAME):
|
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
mplang/__init__.py,sha256=
|
|
2
|
-
mplang/cli.py,sha256=
|
|
1
|
+
mplang/__init__.py,sha256=RQ0z5slM6eNgWlTqGkn67tYDvq8ZzZBfMD2XCdQR86c,14518
|
|
2
|
+
mplang/cli.py,sha256=JQRdLlbycK7awumcY60F4Nw7ozRebfe5cpNEDyRQ3jw,20316
|
|
3
3
|
mplang/cli_guide.md,sha256=hKC6AKgJn-lM_wZ0CzZIP2QUBxGPnT0Op_1YyeUhCfI,3581
|
|
4
|
-
mplang/logging_config.py,sha256=6Zm1Z_EBnzxAfeKr94xiLpWYDD8fa4ZEs2g_kMoH8eI,7579
|
|
5
4
|
mplang/py.typed,sha256=RyhZV7Yxo8BvEoBiFz5fH3IWVqQKTcBBE-bzjx_N5GQ,583
|
|
6
5
|
mplang/backends/__init__.py,sha256=EnKHmOX4YgvNVA42k_KfiS-Vn860yN7Rj9XkUU0g9ys,2042
|
|
7
6
|
mplang/backends/bfv_impl.py,sha256=qobGXe7ldWvYVcqdkNsTcVdNV-hUVE9-Ks5pd3X0Mvc,25691
|
|
8
|
-
mplang/backends/channel.py,sha256=
|
|
7
|
+
mplang/backends/channel.py,sha256=MZwaF0DkkBF_98xdQ8ri0kROJmnCS1ldbwdZUi-sWAU,6876
|
|
9
8
|
mplang/backends/crypto_impl.py,sha256=m5tbZpedn4McG5t6HIaEjhTQUFOIaEDMdyEG0499S0Y,23187
|
|
10
9
|
mplang/backends/field_impl.py,sha256=lIghppy0i8QL7aTNCr8tNWjC_bvOXBIKLnavaO0fIOA,14773
|
|
11
10
|
mplang/backends/func_impl.py,sha256=vhkSJnvgSzvQWXqOE40O8npqOmtNqLxefzv9ETuQODQ,3573
|
|
12
11
|
mplang/backends/phe_impl.py,sha256=CefRpFrRJvbZm3X58OYOFAyNZXKDp081Q6CT8fhdreE,4118
|
|
13
12
|
mplang/backends/simp_design.md,sha256=u4YeDLKk5avsueXhzPtt4OUBToBmurOVK_BWTKTJ7w0,5246
|
|
14
|
-
mplang/backends/spu_impl.py,sha256=
|
|
13
|
+
mplang/backends/spu_impl.py,sha256=mkyNCwHC4N7zZ23mCRdOqJWbKv8dxH-Tqi14cTyhGSA,9526
|
|
15
14
|
mplang/backends/spu_state.py,sha256=tgwOiWN6zfP-fBx2rN2cNnC-Y9GrSArqU-ZBT3NdXls,6557
|
|
16
15
|
mplang/backends/store_impl.py,sha256=BdrCfNhFbcjswIvfxD2XKGYeBfBrmEQA3pj2-EDzFcI,2213
|
|
17
|
-
mplang/backends/table_impl.py,sha256=
|
|
16
|
+
mplang/backends/table_impl.py,sha256=SFbZJpZS1SdRxxlYfQjc69qcy-2hVfVAYEapNRaTTiI,27617
|
|
18
17
|
mplang/backends/tee_impl.py,sha256=5yed94Lr55hgSDT6j3FjdTboqzhl4HpJ9lGk1YGZBXQ,7026
|
|
19
|
-
mplang/backends/tensor_impl.py,sha256=
|
|
18
|
+
mplang/backends/tensor_impl.py,sha256=iIOsvSXiRsQWbC8BBfPUpOUhAXJW8VY11l0BxsMVYPo,18963
|
|
20
19
|
mplang/backends/simp_driver/__init__.py,sha256=pQkHGR8HagnPB4OqagPZY-Ul19y6HjIJ5dY6QXZrBH8,1243
|
|
21
|
-
mplang/backends/simp_driver/http.py,sha256=
|
|
20
|
+
mplang/backends/simp_driver/http.py,sha256=isZvDHrrCgi07u5_sFfTYvR4p2CI3vs8zwnk9u6O3Ko,5601
|
|
22
21
|
mplang/backends/simp_driver/mem.py,sha256=EAsDO4Zl2pHf8TY4K_whluhbAwaT1NhktBM9u4g5yYE,9101
|
|
23
22
|
mplang/backends/simp_driver/ops.py,sha256=WYObWDRCsiXH0UBWZX5vD5W98ZPkd88U_qBV8SE5rA8,4503
|
|
24
23
|
mplang/backends/simp_driver/state.py,sha256=dNmYMFN2D2BBdgs6C0YLaHrfaBRMgs05UNxMWw6tZIs,1713
|
|
25
24
|
mplang/backends/simp_driver/values.py,sha256=Lz1utNSIzH-dCzZAEjU6JRcxPsfKGfUJrYl6gIuMOGw,1509
|
|
26
25
|
mplang/backends/simp_worker/__init__.py,sha256=gdrSY1-MDkupCoJ8xwwH7em7fgVWv3J4gBJ45uHdzgg,961
|
|
27
|
-
mplang/backends/simp_worker/http.py,sha256=
|
|
26
|
+
mplang/backends/simp_worker/http.py,sha256=y5qpDpfM6vKBsicr2wCkgn-RHnED-b5J0r9hBJxrgN8,12746
|
|
28
27
|
mplang/backends/simp_worker/mem.py,sha256=tMGiRppeca0TnY8WdqYQMQvsx5UVswCqdeOhiDlLQBs,3574
|
|
29
28
|
mplang/backends/simp_worker/ops.py,sha256=ntxfkD4e6Il4w7FshK1ODcUCUPMlipt33pDY_x5iC0U,5661
|
|
30
29
|
mplang/backends/simp_worker/state.py,sha256=nIu0ybvdYqRqp0TkoSneUF2u31evDHucCRduVBaDals,1445
|
|
@@ -42,16 +41,17 @@ mplang/dialects/table.py,sha256=i9ruyh91_tSWu9rsLomrBUfqRdbHiZMMMJzNKfMrAUc,1353
|
|
|
42
41
|
mplang/dialects/tee.py,sha256=BMFSbeK-Ck2jQP4qY9bZeNYTxEa7uEtUWLZLC4BPQxk,10111
|
|
43
42
|
mplang/dialects/tensor.py,sha256=7aAYKaMaFjJ8N25yPFnmVhUuUdKJYy-M-a4NsZGE7kY,39893
|
|
44
43
|
mplang/edsl/README.md,sha256=viflvdRojOa6Xk_UMRPqpuPGXcPGmdlv2-XR6LO7B58,7592
|
|
45
|
-
mplang/edsl/__init__.py,sha256=
|
|
44
|
+
mplang/edsl/__init__.py,sha256=WL4efo6uY1br781_8IaCkSi7yCUldcfJfbtFsn6Fdj4,2698
|
|
46
45
|
mplang/edsl/context.py,sha256=Ln8n3bDe8_ISe42TAGzUuz8fw57-tu1APuihMfAtW1Y,10075
|
|
47
46
|
mplang/edsl/graph.py,sha256=nCeCN7-bxfzyv40fmxcEXOaVUx14cOCaHfFb7A9OBnE,14968
|
|
48
|
-
mplang/edsl/jit.py,sha256=
|
|
47
|
+
mplang/edsl/jit.py,sha256=urXV68sQ-CjYuWGQSLj9ZAxP3YieISt2tfr2GEo-vCQ,2392
|
|
49
48
|
mplang/edsl/object.py,sha256=dBl58q-ondjpjPNBh8zZvIEj6pJw2yEoz6TCaM_oleA,1906
|
|
50
|
-
mplang/edsl/primitive.py,sha256=
|
|
49
|
+
mplang/edsl/primitive.py,sha256=N9HEsXJuQTx_haLafUluL4EuIS2AKHNekZvCRWu5o-0,10858
|
|
51
50
|
mplang/edsl/printer.py,sha256=drmfRkdCNqbkRfSDmejxtO-rEAaM13QyHB3AbAmKVFk,4393
|
|
51
|
+
mplang/edsl/program.py,sha256=_JdEU2-nb79VlFLcgMJf4JS30TARBeUIzno0y0SFVsg,4467
|
|
52
52
|
mplang/edsl/registry.py,sha256=hudXZPUrUUueEwgksDKN0cnE3iiXucuTaDdDK8uSPmk,6822
|
|
53
53
|
mplang/edsl/serde.py,sha256=8K94laE8ObeGuBoF6m7g3A-xEe98EvqQ_6ZPPspddAY,11641
|
|
54
|
-
mplang/edsl/tracer.py,sha256=
|
|
54
|
+
mplang/edsl/tracer.py,sha256=WQFNL2ZgXSLjxD4JA7cXIDUKIQXe3aZ94qer57IKPXc,23128
|
|
55
55
|
mplang/edsl/typing.py,sha256=Vp0r_oTyFrOhwwpVD_6XAX0sSsKvR04X-KdihkmD4QA,29287
|
|
56
56
|
mplang/kernels/Makefile,sha256=5PoPpajcb_8ByPGNHzVytmovXUwkjJs_K8MbXX9qDYs,1033
|
|
57
57
|
mplang/kernels/__init__.py,sha256=J_rDl9lAXd7QL3Nt_P3YX6j9yge7ssguSaHuafPZNKE,876
|
|
@@ -62,7 +62,7 @@ mplang/kernels/okvs_opt.cpp,sha256=qKkwHGGv7ayvIRW46PrQZZ7ej4b58Drbr3BlqEK506U,1
|
|
|
62
62
|
mplang/kernels/py_kernels.py,sha256=EXK2ByfRsVpBqp1etDyCb_qExT0obiytcNFXYpRyxpo,12070
|
|
63
63
|
mplang/libs/collective.py,sha256=1RhwnpKwjLvbZ5UgmCMkO6brwqHEIdkW_zymRawwTW4,10668
|
|
64
64
|
mplang/libs/device/__init__.py,sha256=UHPGQ9JVedXy6AQo-ixQooS2R8eTwJEu7-p8A5_po78,1248
|
|
65
|
-
mplang/libs/device/api.py,sha256=
|
|
65
|
+
mplang/libs/device/api.py,sha256=vkwoHjIlwEivSUn1_NLf47pOq34gO6yCXTWRDYdgN2I,28869
|
|
66
66
|
mplang/libs/device/cluster.py,sha256=YUqYZ_IBS6rpV5ejUFP3kTxcTQHSyeDeuaJcsiFY_Js,12508
|
|
67
67
|
mplang/libs/ml/__init__.py,sha256=kUR6V74kWmGnOUdmLuGAP1xebW7y-NBOmHyHK-kdqWg,784
|
|
68
68
|
mplang/libs/ml/sgb.py,sha256=g5x1PQnV7oRzheyu6PiDooqmBWI9jMvLHkIHrNnMoDk,60211
|
|
@@ -91,13 +91,16 @@ mplang/libs/mpc/vole/ldpc.py,sha256=gOmIbyOjkGE5lewyatl3p6FizNNH8LZ_1oOhp_-TOck,
|
|
|
91
91
|
mplang/libs/mpc/vole/silver.py,sha256=EIxhpFIVNBemgeIZzCu5Cz_4wysxRm9b1Xfu0xiweVQ,12218
|
|
92
92
|
mplang/runtime/__init__.py,sha256=VdUwJ3kDaI46FvGw7iMGwcsjt0HTGmmRmaBwj99xKIw,620
|
|
93
93
|
mplang/runtime/dialect_state.py,sha256=HxO1i4kSOujS2tQzAF9-WmI3nChSaGgupf2_07dHetY,1277
|
|
94
|
-
mplang/runtime/interpreter.py,sha256=
|
|
94
|
+
mplang/runtime/interpreter.py,sha256=yWcUDbAfjKgkx09rYTHrIcrs4KzbV3y8tkC7VrqQRJ4,43592
|
|
95
95
|
mplang/runtime/object_store.py,sha256=yT6jtKG2GUEJVmpq3gnQ8mCMvUFYzgBciC5A-J5KRdk,5998
|
|
96
96
|
mplang/runtime/value.py,sha256=EqlhSgxLTJi_FF3ppyKjMe4eHS6-ROx-zK1YesG1U4o,4311
|
|
97
|
-
mplang/
|
|
97
|
+
mplang/tool/__init__.py,sha256=9K-T50W_vClUlyERcVx5xGZaeyv0Ts63SaQX6AZtjIs,1341
|
|
98
|
+
mplang/tool/program.py,sha256=W3H8bpPirnoJ4ZrmyPYuMCPadJis20o__n_1MKqCsWU,11058
|
|
99
|
+
mplang/utils/__init__.py,sha256=Hwrwti2nfPxWUXV8DN6T1QaqXH_Jsd27k8UMSdBGUns,1073
|
|
98
100
|
mplang/utils/func_utils.py,sha256=aZ-X43w8JKJgiF-IUMS0G7QqrNeoTM5ZPzRNd-tKxpw,5180
|
|
99
|
-
|
|
100
|
-
mplang_nightly-0.1.
|
|
101
|
-
mplang_nightly-0.1.
|
|
102
|
-
mplang_nightly-0.1.
|
|
103
|
-
mplang_nightly-0.1.
|
|
101
|
+
mplang/utils/logging.py,sha256=9dMhwprVbx1WMGJrgoQbWmV50vyYuLU4NSPnetcl1Go,7237
|
|
102
|
+
mplang_nightly-0.1.dev280.dist-info/METADATA,sha256=IG4D8STIc2G7ZtQAz3OlKptLansk_hvB03-2M2HNZCw,16783
|
|
103
|
+
mplang_nightly-0.1.dev280.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
104
|
+
mplang_nightly-0.1.dev280.dist-info/entry_points.txt,sha256=mG1oJT-GAjQR834a62_QIWb7litzWPPyVnwFqm-rWuY,55
|
|
105
|
+
mplang_nightly-0.1.dev280.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
106
|
+
mplang_nightly-0.1.dev280.dist-info/RECORD,,
|
|
File without changes
|
{mplang_nightly-0.1.dev278.dist-info → mplang_nightly-0.1.dev280.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{mplang_nightly-0.1.dev278.dist-info → mplang_nightly-0.1.dev280.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|