Open npilon opened 6 months ago
Hi @npilon
are you able to use the new stream generator: https://docs.ray.io/en/latest/ray-core/ray-generator.html
Hi @npilon
are you able to use the new stream generator: https://docs.ray.io/en/latest/ray-core/ray-generator.html
Streaming generators do not meet important parts of my use case: they do not have the same API semantics as ordinary tasks. This requires all general purpose intermediate infrastructure to detect and appropriately select which API to use. This is a substantial additional maintenance burden.
Per the recently released Ray on AnyScale support lifecycle announcement:
we are investing in making APIs more stable while investigating potential Long-Term Support (LTS) versions.
This would seem to be very relevant to my issues here.
Description
num_returns='dynamic'
generators were deprecated abruptly in ray 2.9. These generators are useful for implementing tasks (or actor methods) that perform a series of operations, which can be expressed as a generator while still having the same semantics as ordinary ray tasks, such as not completing until the actor is free for its next task.Use case
Our ray-based data pipeline has made heavy use of dynamic generator tasks to express operations that produce multiple results. Often they will apply a series of strategies, using python's yield from syntax to concisely produce results and remaining work in a single statement:
These tasks are usually interacting with unreliable external services that loosely but aggressively rate-limit access, and require managing state such as authentication sessions and database connections. We manage these constraints using
ActorPool
, plus helpers for dealing with errors. Dynamic generator tasks are ideal for our use case because: