xoscar 0.7.0__cp310-cp310-win_amd64.whl → 0.7.1__cp310-cp310-win_amd64.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.

Potentially problematic release.


This version of xoscar might be problematic. Click here for more details.

xoscar/__init__.py CHANGED
@@ -33,6 +33,7 @@ from .api import (
33
33
  wait_actor_pool_recovered,
34
34
  get_pool_config,
35
35
  generator,
36
+ wait_for,
36
37
  )
37
38
  from .backends import allocate_strategy
38
39
  from .backends.pool import MainActorPoolType
Binary file
xoscar/api.py CHANGED
@@ -26,6 +26,7 @@ from numbers import Number
26
26
  from typing import (
27
27
  TYPE_CHECKING,
28
28
  Any,
29
+ Awaitable,
29
30
  Dict,
30
31
  Generic,
31
32
  List,
@@ -181,6 +182,39 @@ async def create_actor_pool(
181
182
  )
182
183
 
183
184
 
185
+ async def wait_for(fut: Awaitable[Any], timeout: int | float | None = None) -> Any:
186
+ # asyncio.wait_for() on Xoscar actor call cannot work as expected,
187
+ # because when time out, the future will be cancelled, but an actor call will catch this error,
188
+ # and send a CancelMessage to the dest pool, if the CancelMessage cannot be processed correctly(e.g. the dest pool hangs),
189
+ # the time out will never happen. Thus this PR added a new API so that no matter the CancelMessage delivered or not,
190
+ # the timeout will happen as expected.
191
+ loop = asyncio.get_running_loop()
192
+ new_fut = loop.create_future()
193
+ task = asyncio.ensure_future(fut)
194
+
195
+ def on_done(f: asyncio.Future):
196
+ if new_fut.done():
197
+ return
198
+ if f.cancelled():
199
+ new_fut.cancel()
200
+ elif f.exception():
201
+ new_fut.set_exception(f.exception()) # type: ignore
202
+ else:
203
+ new_fut.set_result(f.result())
204
+
205
+ task.add_done_callback(on_done)
206
+
207
+ try:
208
+ return await asyncio.wait_for(new_fut, timeout)
209
+ except asyncio.TimeoutError:
210
+ if not task.done():
211
+ try:
212
+ task.cancel() # Try to cancel without waiting
213
+ except Exception:
214
+ logger.warning("Failed to cancel task", exc_info=True)
215
+ raise
216
+
217
+
184
218
  def buffer_ref(address: str, buffer: Any) -> BufferRef:
185
219
  """
186
220
  Init buffer ref according address and buffer.
Binary file
xoscar/collective/uv.dll CHANGED
Binary file
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xoscar
3
- Version: 0.7.0
3
+ Version: 0.7.1
4
4
  Summary: Python actor framework for heterogeneous computing.
5
5
  Home-page: http://github.com/xorbitsai/xoscar
6
6
  Author: Qin Xuye
@@ -1,16 +1,16 @@
1
- xoscar/__init__.py,sha256=dlwtB7dnDp5WME6CZVQY7d9lk1yJ9s___H5UxjGlAd4,1668
2
- xoscar/_utils.cp310-win_amd64.pyd,sha256=SXJEX2yyqXGRruoaWQb8NxjmQdmoaviBxHZFXi6rv9A,110080
1
+ xoscar/__init__.py,sha256=lzCXUmkuIjcjkiNQFekysdJR_ZhlbjcfR5ka1bZZNQg,1683
2
+ xoscar/_utils.cp310-win_amd64.pyd,sha256=eGmqbv9t47r32KmdoDzpWfld-abvwXrmRAyNab3bcPU,110080
3
3
  xoscar/_utils.pxd,sha256=rlNbTg5lhXA-jCOLksqF4jhUlNn0xw2jx1HxdLa34pc,1193
4
4
  xoscar/_utils.pyx,sha256=TWScgqmJGYzjbWBOShBLkq07ldfYEQ5fw6V4OytX_IA,7626
5
5
  xoscar/_version.py,sha256=bsfCVAo_o9LkiP3AjPsP4SRRqhjuS0t4D1WGJPzbdls,24412
6
- xoscar/api.py,sha256=B5oXv4vgMxMteh1YNaBmNFDrUFmYa_dCdzfaWwwZnCo,13820
6
+ xoscar/api.py,sha256=QQDHn-_FiDExmOxEk8BUnq4Qrx13VX3shSlEEqPQJo0,15175
7
7
  xoscar/backend.py,sha256=8G5JwjoOT6Q2slb11eXNApxgcmvNQUCdQzkoIMDwLcQ,1917
8
8
  xoscar/batch.py,sha256=Jk5BSpvMFAV9DrRy0a9tgPvIo_dt8cbJReZBL0cnOPc,8128
9
9
  xoscar/constants.py,sha256=GJ1KEOxwnqksc9K_GH42TSWpQECeC6ti3KJmE3PUcTw,810
10
- xoscar/context.cp310-win_amd64.pyd,sha256=aOiUAUFES5f80Ijo1QIx_yZahXJ8fb8iFgrF4Cun434,153600
10
+ xoscar/context.cp310-win_amd64.pyd,sha256=va9klQkE6ab1Tv4fY27heRcqnhEvdcC3Xc0J0GDgyPg,153600
11
11
  xoscar/context.pxd,sha256=6n6IAbmArSRq8EjcsbS6npW8xP1jI0qOoS1fF0oyj-o,746
12
12
  xoscar/context.pyx,sha256=FOJVerGOvxe2USryXEQA0rpaFX_ScxISH6QWKUcahY8,11310
13
- xoscar/core.cp310-win_amd64.pyd,sha256=CHlZbdmcRlE1xJ2oOioyOguTWK12ksRoaG36f5uQcNE,304128
13
+ xoscar/core.cp310-win_amd64.pyd,sha256=tO5W18PNnn_hlFxM5jwktCygNM7nNLnq_3StlSV5z5g,304128
14
14
  xoscar/core.pxd,sha256=9IZP7dYGfnF1I-obIls8R8b6forxDOPbiM3v5nVslLk,1368
15
15
  xoscar/core.pyx,sha256=U6jCZN74MQHi7HkQRaVGm_w5q-FMsw0nnE3aU6533_Q,22756
16
16
  xoscar/debug.py,sha256=hrmxIH6zvTKasQo6PUUgXu5mgEsR0g87Fvpw7CoHipg,5257
@@ -30,7 +30,7 @@ xoscar/backends/allocate_strategy.py,sha256=DzvTlixwzTANURI2mDLHm3vcaugSPDxU6UQZ
30
30
  xoscar/backends/config.py,sha256=86j0g_Xrl8ENPzBWi296yWg9QEcljvdKK-yJbfYTvQ0,5532
31
31
  xoscar/backends/context.py,sha256=qWwksx8JxYcKR-LQA3PvXh4ReuuTTEyDaLbjpxGXcTA,16766
32
32
  xoscar/backends/core.py,sha256=fbekAxys_t1Dv7if-1R6uVvC_yAxNkXLeQ1V1ZSAfC0,11161
33
- xoscar/backends/message.cp310-win_amd64.pyd,sha256=-ymhwIYp5CrLVdRYq_iXnZh4XnTr0TRsUhMOrCpK3C8,247808
33
+ xoscar/backends/message.cp310-win_amd64.pyd,sha256=EmkmouNzy_2X_ZMO2bn_B2yo2V-9066yEuIh6EWk6lg,247808
34
34
  xoscar/backends/message.pyx,sha256=lBEjMJv4VyxmeO9lHXJJazOajbFnTLak4PSBcLoPZvU,20331
35
35
  xoscar/backends/pool.py,sha256=bS_m8XBkfQQsCOaLEzM6HkV5e78dPPp1bCH6yjvPEss,62153
36
36
  xoscar/backends/router.py,sha256=EjfNpQUrhFU15eYe1kRPueziHgI2gfDViUzm7ruvXDE,10817
@@ -57,8 +57,8 @@ xoscar/collective/common.py,sha256=9c7xq3IOUvfA0I9GnpalUqXZOzmF6IEILv4zL64BYVE,3
57
57
  xoscar/collective/core.py,sha256=191aPxbUgWpjzrqyozndImDAQhZFmqoQdBkHFLDfXN0,24239
58
58
  xoscar/collective/process_group.py,sha256=kTPbrLMJSGhqbiWvTIiz-X3W0rZWd_CFn_zUIlXbOlM,23286
59
59
  xoscar/collective/utils.py,sha256=p3WEVtXvnVhkuO5mRgQBhBRFr1dKHcDKMjrbMyuiyfg,1219
60
- xoscar/collective/uv.dll,sha256=X06_mZ6k-ORPlva1U5vger7O6OZ257XlIE5YIZC5jAk,620544
61
- xoscar/collective/xoscar_pygloo.cp310-win_amd64.pyd,sha256=6hr5evSoYdIW9AJyGOk6Ykga9sRZYMA7SdzEtnOE9r4,829952
60
+ xoscar/collective/uv.dll,sha256=Rr1vzHGkiOK-AGnXrZVKNA4Ir-tOaidGNj-d6_DexeU,620544
61
+ xoscar/collective/xoscar_pygloo.cp310-win_amd64.pyd,sha256=2-URIRt0xx_Gj-JSSdihP-sA_O1lr2cSFP2n5FHHxiY,829952
62
62
  xoscar/metrics/__init__.py,sha256=RjXuuYw4I2YYgD8UY2Z5yCZk0Z56xMJ1n40O80Dtxf8,726
63
63
  xoscar/metrics/api.py,sha256=dtJ4QrIqQNXhJedeqOPs4TXKgrRGZFFN50xAd9SCfec,9144
64
64
  xoscar/metrics/backends/__init__.py,sha256=ZHepfhCDRuK9yz4pAM7bjpWDvS3Ijp1YgyynoUFLeuU,594
@@ -69,7 +69,7 @@ xoscar/metrics/backends/prometheus/__init__.py,sha256=ZHepfhCDRuK9yz4pAM7bjpWDvS
69
69
  xoscar/metrics/backends/prometheus/prometheus_metric.py,sha256=65hb8O3tmsEJ7jgOrIwl_suj9SE5Tmqcfjuk0urkLvE,2120
70
70
  xoscar/serialization/__init__.py,sha256=tS8C49yrW_geWNEsbgW3phK1q4YN1ojI6CN-vroIFYM,876
71
71
  xoscar/serialization/aio.py,sha256=7YLXgkWpQ3ANy-TZ1qO8Mt4_J3cZFhFh2FEgUgxMT60,4873
72
- xoscar/serialization/core.cp310-win_amd64.pyd,sha256=Avp-z2xtaMUB1Nm6JSNZhTMmWXB4Cm0KzjIZ0QFYlsQ,268800
72
+ xoscar/serialization/core.cp310-win_amd64.pyd,sha256=VKGJxRCi9nhp6aVnJ6DLoer0PLlHYJgRjQLsO6R2c0M,268800
73
73
  xoscar/serialization/core.pxd,sha256=X-47bqBM2Kzw5SkLqICdKD0gU6CpmLsBxC3kfW--wVk,1013
74
74
  xoscar/serialization/core.pyx,sha256=ZKexLRnRwZXXn2045kR7xfM_szcoPNrDuouQCWtpFp8,30570
75
75
  xoscar/serialization/cuda.py,sha256=Fj4Cpr_YmkGceUCo0mQn8fRvmHP_5WcLdRx6epZ3RC0,3869
@@ -81,7 +81,7 @@ xoscar/serialization/scipy.py,sha256=9ph-yoRoNiwUZTwQrn35U60VPirWlncXNAg6EXvqMR4
81
81
  xoscar/virtualenv/__init__.py,sha256=rhJ7I6x7aXjKOCzSqsKLwqFJMh4YC2sqchEIJNEfI58,1151
82
82
  xoscar/virtualenv/core.py,sha256=FeLmheIkQk0JOayVdUBEMyltAQhidQqbHguCMTHB0Sw,1394
83
83
  xoscar/virtualenv/uv.py,sha256=v1LvpxtUu2ja4Cy2EqD-BGxb8zZle5Zj-91QPZH_C10,3273
84
- xoscar-0.7.0.dist-info/METADATA,sha256=fdIFMff170aAaqB_-FtVAsSaDampWmkFBR8DdY2qb-8,9360
85
- xoscar-0.7.0.dist-info/WHEEL,sha256=NVXpD7b4Gxps0cd2ds5rr5TG8W4ApEwx_i5J99qMZ5E,102
86
- xoscar-0.7.0.dist-info/top_level.txt,sha256=vYlqqY4Nys8Thm1hePIuUv8eQePdULVWMmt7lXtX_ZA,21
87
- xoscar-0.7.0.dist-info/RECORD,,
84
+ xoscar-0.7.1.dist-info/METADATA,sha256=9OmPACIrv37yJ6XfD5h9B6ynOc30kt5plHupHPUpOEg,9360
85
+ xoscar-0.7.1.dist-info/WHEEL,sha256=NVXpD7b4Gxps0cd2ds5rr5TG8W4ApEwx_i5J99qMZ5E,102
86
+ xoscar-0.7.1.dist-info/top_level.txt,sha256=vYlqqY4Nys8Thm1hePIuUv8eQePdULVWMmt7lXtX_ZA,21
87
+ xoscar-0.7.1.dist-info/RECORD,,
File without changes