mplang-nightly 0.1.dev255__py3-none-any.whl → 0.1.dev257__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/v2/__init__.py CHANGED
@@ -268,7 +268,8 @@ def fetch(
268
268
  # Plain values pass through
269
269
  return var
270
270
 
271
- return tree_map(_fetch_single, result)
271
+ with interp:
272
+ return tree_map(_fetch_single, result)
272
273
 
273
274
 
274
275
  # Alias for compatibility
@@ -47,18 +47,15 @@ def _pcall_static_worker_impl(
47
47
 
48
48
  if worker.rank in parties:
49
49
  fn_graph = op.regions[0]
50
- prev_parties = getattr(interpreter, "current_parties", None)
51
- interpreter.current_parties = parties # type: ignore[attr-defined]
50
+ prev_parties = worker.current_parties
51
+ worker.current_parties = parties
52
52
 
53
53
  try:
54
54
  result = interpreter.evaluate_graph(fn_graph, list(args))
55
55
  # Return single value for single output (interpreter expects this)
56
56
  return result[0] if len(op.outputs) == 1 else result
57
57
  finally:
58
- if prev_parties is None:
59
- del interpreter.current_parties # type: ignore[attr-defined]
60
- else:
61
- interpreter.current_parties = prev_parties # type: ignore[attr-defined]
58
+ worker.current_parties = prev_parties
62
59
  else:
63
60
  # No data for this rank
64
61
  return None if len(op.outputs) == 1 else [None] * len(op.outputs)
@@ -164,26 +164,19 @@ def exec_impl(interpreter: Interpreter, op: Operation, *args: Any) -> Any:
164
164
  # Get SPU config from attrs (passed through from run_jax)
165
165
  config: spu.SPUConfig = op.attrs["config"]
166
166
 
167
- # Get parties from interpreter context (injected by pcall_static_impl)
168
- parties = getattr(interpreter, "current_parties", None)
167
+ # Get parties from SimpWorker state (injected by pcall_static_impl)
168
+ context = interpreter.get_dialect_state("simp")
169
+ if not isinstance(context, SimpWorker):
170
+ raise RuntimeError(f"spu.exec requires SimpWorker, got {type(context)}")
171
+
172
+ parties = context.current_parties
169
173
  if parties is None:
170
174
  raise RuntimeError(
171
- "spu.exec requires 'current_parties' in interpreter context. "
175
+ "spu.exec requires 'current_parties' in SimpWorker state. "
172
176
  "Ensure it is called within a pcall_static block."
173
177
  )
174
178
 
175
- # Get global rank from interpreter or its context
176
- # Use SimpWorker if available
177
- context = interpreter.get_dialect_state("simp")
178
- if isinstance(context, SimpWorker):
179
- global_rank = context.rank
180
- else:
181
- # Fallback for other contexts or direct interpreter usage?
182
- # User said: "directly ensure simp_context is there"
183
- # If not SimpWorker, we can't run spu.exec?
184
- # But maybe integration tests run differently?
185
- # Let's trust user: "ensure simp_context is there"
186
- raise RuntimeError(f"spu.exec requires SimpWorker, got {type(context)}")
179
+ global_rank = context.rank
187
180
 
188
181
  if global_rank not in parties:
189
182
  raise RuntimeError(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mplang-nightly
3
- Version: 0.1.dev255
3
+ Version: 0.1.dev257
4
4
  Summary: Multi-Party Programming Language
5
5
  Author-email: SecretFlow Team <secretflow-contact@service.alipay.com>
6
6
  License: Apache License
@@ -77,7 +77,7 @@ mplang/v1/utils/crypto.py,sha256=rvPomBFtznRHc3RPi6Aip9lsU8zW2oxBqGv1K3vn7Rs,105
77
77
  mplang/v1/utils/func_utils.py,sha256=vCJcZmu0bEbqhOQKdpttV2_MBllIcPSN0b8U4WjNGGo,5164
78
78
  mplang/v1/utils/spu_utils.py,sha256=S3L9RBkBe2AvSuMSQQ12cBY5Y1NPthubvErSX_7nj1A,4158
79
79
  mplang/v1/utils/table_utils.py,sha256=1fDgZLrRf2bvKvA45egT6RtMPgwE1cI2BokMHUU_xv4,5945
80
- mplang/v2/__init__.py,sha256=SqVxDiRvA9W49NaXaT70spf6-xSbat1ZfIdI4j8KgFk,13816
80
+ mplang/v2/__init__.py,sha256=rX_DXuAu8IG_2-toMWtLB3UL0YDvXCPoxNoekVmhJG0,13837
81
81
  mplang/v2/cli.py,sha256=QtiTFG418k26opRy4GhVV8fwFqRS11xTLH3xRCIIm6M,19665
82
82
  mplang/v2/cli_guide.md,sha256=kyoCaqkvIJJ1vsvCyBu3qgOuRSb0txu9BDZoy9GU5S0,3617
83
83
  mplang/v2/backends/__init__.py,sha256=H-4-jBEPWBZl6XT7AxBShRINnruF_f_2lB4iaiQoXME,1988
@@ -87,7 +87,7 @@ mplang/v2/backends/field_impl.py,sha256=50sKGOlkUiaTj_IAola86uQeoi-fxV0o7G91BdTC
87
87
  mplang/v2/backends/func_impl.py,sha256=R0662cC0gSSfkjuLyevJ_g4bJDJirY76LTFYqEimCkE,3585
88
88
  mplang/v2/backends/phe_impl.py,sha256=r836e_qBHGrHhfnFail5IaUDzvS7bABjdEQmJmAtBVI,4127
89
89
  mplang/v2/backends/simp_design.md,sha256=CXvfxrvV1TmKlFm8IbKTbcHHwLl6AhwlY_cNqMdff_Y,5250
90
- mplang/v2/backends/spu_impl.py,sha256=gKyueQZQXRQhJ_7q3EQ74ItJntzeFdgTnPtU2mJRqF8,9466
90
+ mplang/v2/backends/spu_impl.py,sha256=nDmpntXMKlFhaOUMXAOO_-RZTzqGLsgxEvwJuVA6h1g,9047
91
91
  mplang/v2/backends/spu_state.py,sha256=wj876IvNPhKyWISN6WwKBYoaDQFFJ8jemdJUVeH5IfA,4144
92
92
  mplang/v2/backends/store_impl.py,sha256=RyhADTNsnnNnwsatAMr7eeewXkVXtfNWA1oFiLXg8H0,2222
93
93
  mplang/v2/backends/table_impl.py,sha256=c36gyBCWLQbV3g0hkJeTnMXUqT0nxgu74k2sLondTio,8784
@@ -102,7 +102,7 @@ mplang/v2/backends/simp_driver/values.py,sha256=OQ_7Kt6l7Pcfx5eB6GVbpunS6CG60Lj0
102
102
  mplang/v2/backends/simp_worker/__init__.py,sha256=93VMzntLN1kpePK1KoLsU3J3RU-krgV3smCRRRo-xKA,970
103
103
  mplang/v2/backends/simp_worker/http.py,sha256=ZISNYsYSXr5a4wtC59vGfGV9vVOR_pZF39pZgzLx8zk,11630
104
104
  mplang/v2/backends/simp_worker/mem.py,sha256=aigiER6t8H8MHVKm2Trw0CXQks24qgpAh_wEvLGPA28,3389
105
- mplang/v2/backends/simp_worker/ops.py,sha256=pgUa_aQ_tfqJgf71HA-hUHidTducW8A9zVD_6PUT4lk,5755
105
+ mplang/v2/backends/simp_worker/ops.py,sha256=DMQCsKeoMtemy5ozsVZt2eoF8NZlhLeHZMDgnBSP29I,5525
106
106
  mplang/v2/backends/simp_worker/state.py,sha256=eRUI7MP6gU8KPC9-H5fwcoAPKOsfW2ODWvpoKWbecMk,1554
107
107
  mplang/v2/dialects/__init__.py,sha256=hvzAvz6_brfFyDGgKknoPdgh5EY033YNYwotuJK_zoA,1493
108
108
  mplang/v2/dialects/bfv.py,sha256=XrE3FX9DHWqNzUVzY0tuwPvNVVRZYpD51JZIZF-q-l4,22350
@@ -170,8 +170,8 @@ mplang/v2/runtime/dialect_state.py,sha256=HxO1i4kSOujS2tQzAF9-WmI3nChSaGgupf2_07
170
170
  mplang/v2/runtime/interpreter.py,sha256=UzrM5oepka6H0YKRZncNXhsuwKVm4pliG5J92fFRZMI,32300
171
171
  mplang/v2/runtime/object_store.py,sha256=yT6jtKG2GUEJVmpq3gnQ8mCMvUFYzgBciC5A-J5KRdk,5998
172
172
  mplang/v2/runtime/value.py,sha256=CMOxElJP78v7pjasPhEpbxWbSgB2KsLbpPmzz0mQX0E,4317
173
- mplang_nightly-0.1.dev255.dist-info/METADATA,sha256=k-_Pe_IksZD0UsPf-oPxMv_FlGNEKKfWwz4BjCVqC00,16768
174
- mplang_nightly-0.1.dev255.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
175
- mplang_nightly-0.1.dev255.dist-info/entry_points.txt,sha256=mG1oJT-GAjQR834a62_QIWb7litzWPPyVnwFqm-rWuY,55
176
- mplang_nightly-0.1.dev255.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
177
- mplang_nightly-0.1.dev255.dist-info/RECORD,,
173
+ mplang_nightly-0.1.dev257.dist-info/METADATA,sha256=spNke3n3Zt8v4eDo6KRiC9-m0j2e0kDRKHEHXzBxVek,16768
174
+ mplang_nightly-0.1.dev257.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
175
+ mplang_nightly-0.1.dev257.dist-info/entry_points.txt,sha256=mG1oJT-GAjQR834a62_QIWb7litzWPPyVnwFqm-rWuY,55
176
+ mplang_nightly-0.1.dev257.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
177
+ mplang_nightly-0.1.dev257.dist-info/RECORD,,