[ray] Async actor not working in local mode.
See original GitHub issueWhat is the problem?
Async actor is not being recognized in local mode. cc: @ijrsvt
Ray version and other system information (Python version, TensorFlow version, OS):
- ray version: latest master
- python: 3.7.4
- OS: macos 10.15.3.
Reproduction
import ray
ray.init(local_mode=True)
@ray.remote
class test_actor:
async def start(self):
return 1
actor = test_actor.remote()
ray.get(actor.start.remote())
The error I’m getting
E0507 17:19:21.404151 381615552 core_worker.cc:1082] Pushed Error with JobID: 0100 of type: task with message: ray::test_actor.start() (pid=60331, ip=192.168.0.7)
File "python/ray/_raylet.pyx", line 464, in ray._raylet.execute_task
File "python/ray/_raylet.pyx", line 465, in ray._raylet.execute_task
File "python/ray/_raylet.pyx", line 1136, in ray._raylet.CoreWorker.store_task_outputs
File "/Users/allenyin/Test/ray/python/ray/serialization.py", line 401, in serialize
return self._serialize_to_msgpack(metadata, value)
File "/Users/allenyin/Test/ray/python/ray/serialization.py", line 373, in _serialize_to_msgpack
self._serialize_to_pickle5(metadata, python_objects)
File "/Users/allenyin/Test/ray/python/ray/serialization.py", line 353, in _serialize_to_pickle5
raise e
File "/Users/allenyin/Test/ray/python/ray/serialization.py", line 350, in _serialize_to_pickle5
value, protocol=5, buffer_callback=writer.buffer_callback)
File "/Users/allenyin/Test/ray/python/ray/cloudpickle/cloudpickle_fast.py", line 72, in dumps
cp.dump(obj)
File "/Users/allenyin/Test/ray/python/ray/cloudpickle/cloudpickle_fast.py", line 617, in dump
return Pickler.dump(self, obj)
TypeError: can't pickle coroutine objects at time: 1.5889e+09
- I have verified my script runs in a clean environment and reproduces the issue.
- I have verified the issue also occurs with the latest wheels.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:13 (11 by maintainers)
Top Results From Across the Web
AsyncIO / Concurrency for Actors — Ray 2.2.0
Within a single actor process, it is possible to execute concurrent threads. Ray offers two types of concurrency within an actor: async execution....
Read more >Ray Documentation - Read the Docs
1.9.4 Troubleshooting. The Ray timeline visualization may not work in Firefox or Safari. 1.10 Async API (Experimental).
Read more >Actor model - Wikipedia
In response to a message it receives, an actor can: make local decisions, create more actors, send more messages, and determine how to...
Read more >Modern Distributed C++ with Ray - Anyscale
The Ray C++ API was designed to help address these issues so that ... any C++ function to a distributed cluster for asynchronous...
Read more >Real-Time Ray Tracing | Unreal Engine Documentation
Enable r.RayTracing.Reflections.ReflectionCaptures to use Reflection Capture Actors as the last bounce in Ray Traced Reflections.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would argue with this not being a common use-case. Sure, you’re not gonna run Ray in Local mode in production - but you may have to do it during development for debugging purposes. And since async actors are not supported in local mode - it means you simply cannot use them in your code. That is unless you’re prepared to maintain two versions of your code - one with async actors for production, and one with sync actors for development… who would want to do that?
It would not have been an issue for me if not for debugging requirements. #14005 could be an alternative solution here (that would enable seamless debugging of workers/actors in PyCharm in non-local mode).
The same problem I am facing too. As I am testing my actor. Earlier I had used
ray.init()
unfortunately, this does not record test coverage. To test i changed tolocal_mode=True
. Now the problem is my actor’s remote function call never returns, as the actor code runs infinitely 😦