Repository navigation
[Data] DownstreamCapacity: don't count blocks the consumer already holds as output pressure - #66095
Closed
sampan-s-nayak wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the downstream capacity backpressure policy to avoid incorrect backpressuring when downstream consumers retain output blocks (e.g., during training jobs with materialize()). It introduces a new helper method _get_output_size_bytes that calculates the buffered bytes in queues instead of relying on the block reference counter when there are no eligible downstream operators. The feedback suggests simplifying the check for eligible downstream operators using a more idiomatic any() call, and adding defensive guards against potential AttributeError or KeyError when accessing operator metrics and topology.
…lds as output pressure When a pipeline's output goes to an iterator or streaming_split, the ref-counted output usage includes every block the consumer has taken and kept (e.g. Train workers calling materialize()). That pinned ReadFiles to one task in lightgbm_train_batch_inference_benchmark_100G. Count queued bytes plus consumer-reported bytes for that case instead. Signed-off-by: sampan <[email protected]>
sampan-s-nayak
force-pushed
the
sampan/data-downstream-capacity-terminal-queues
branch
from
September 11, 2026 09:22
e53176b to
04cef73
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
overview
lightgbm_train_batch_inference_benchmark_100Gfails in release test withRuntimeError: Training is taking ... longer than expected (600 seconds). The training dataset read that normally takes ~40s takes 400-560s.Root cause: since #64456 the
DownstreamCapacityBackpressurePolicymeasures an operator's output pressure with the block ref counter. When the output goes to an iterator orstreaming_split, that number includes every block the consumer has already taken and still holds. The LightGBM/XGBoost train loops callmaterialize()on their shard, so they hold every block until training ends. The read op's "pending output" then looks like the whole dataset (51 GiB) versus ~1 GiB of consumer prefetch, the ratio never drops, andReadFilesis pinned to a single task by the liveness fallback (Tasks: 1 [backpressured:tasks(DownstreamCapacity)]).Fix
For an operator with no eligible downstream operator, compute output pressure from what is actually queued (its output queues, the pass-through operators' queues such as
OutputSplitter, plus the bytes the consumer reports holding) instead of the ref count. Operator-to-operator edges keep the current ref-count measure, where it is accurate because downstream tasks release blocks when they finish.