Repository navigation
[Fix/n] Return External Consumer Bytes for Downstream Capacity to Activate Backpressure - #65474
Conversation
Signed-off-by: Sirui Huang <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request updates the _get_downstream_capacity_size_bytes method in downstream_capacity_backpressure_policy.py to handle cases where an operator has no output dependencies by returning the external consumer bytes. There are no review comments, and I have no feedback to provide.
There was a problem hiding this comment.
Pull request overview
This PR adjusts Ray Data’s DownstreamCapacityBackpressurePolicy to correctly account for downstream capacity when a pipeline ends at a terminal operator with no in-DAG downstream operators, by using externally-consumed (iterator/prefetch) bytes as the capacity signal. This addresses missing backpressure at the terminal boundary that can lead to spilling in training ingest pipelines.
Changes:
- Reintroduces an early return in
_get_downstream_capacity_size_bytes()for operators with nooutput_dependencies. - Uses
ResourceManager.get_external_consumer_bytes()as the downstream capacity for terminal operators (instead of implicitly treating capacity as 0).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: Sirui Huang <[email protected]>
…ivate Backpressure (ray-project#65474) ray-project#64456 applies the block ref counter to track the object store memory and control backpressure signals based on downstream capacity, but this had lead to spilling in training pipelines. This is mainly due to backpressure not being applied to the terminal operator even though the external consumer is not consuming blocks quickly enough. This PR adds back the early return for `DownstreamCapacityBackpressurePolicy`'s `_get_downstream_capacity_size_bytes`, so that for terminal operators, the downstream capacity is the external consumer bytes tracked instead of 0. --------- Signed-off-by: Sirui Huang <[email protected]> Signed-off-by: 400Ping <[email protected]>
…ivate Backpressure (ray-project#65474) ray-project#64456 applies the block ref counter to track the object store memory and control backpressure signals based on downstream capacity, but this had lead to spilling in training pipelines. This is mainly due to backpressure not being applied to the terminal operator even though the external consumer is not consuming blocks quickly enough. This PR adds back the early return for `DownstreamCapacityBackpressurePolicy`'s `_get_downstream_capacity_size_bytes`, so that for terminal operators, the downstream capacity is the external consumer bytes tracked instead of 0. --------- Signed-off-by: Sirui Huang <[email protected]>
Description
#64456 applies the block ref counter to track the object store memory and control backpressure signals based on downstream capacity, but this had lead to spilling in training pipelines. This is mainly due to backpressure not being applied to the terminal operator even though the external consumer is not consuming blocks quickly enough.
This PR adds back the early return for
DownstreamCapacityBackpressurePolicy's_get_downstream_capacity_size_bytes, so that for terminal operators, the downstream capacity is the external consumer bytes tracked instead of 0.Related issues
Fixes #64456.