Fix duration minimum for zero-task stages - #2154
Merged
amahussein merged 1 commit intoSep 10, 2026
Merged
Conversation
Ignore empty stage records when aggregating task duration minima across SQLs, jobs, and stage attempts. Render the undefined minimum as an empty cell on zero-task rows so downstream minimum reductions do not treat the sentinel as a measurement. Add fixture and record-level coverage for the SQL fold and both stage-attempt operand orders. Signed-off-by: Ahmed Hussein (amahussein) <a@ahussein.me>
|
This was referenced Sep 10, 2026
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.
Fixes #2151.
A stage that produced no task records is held in memory with
numTasks=0and zeroed extrema, soTaskMetricsAccumRec.finalizeAggregationleavesdurationMin=0. Two later folds read that synthetic zero as an observed task duration: the cached-record fold inTaskMetricsAccumRec.addRecord, which builds the job and SQL aggregates, andStageAggTaskMetricsProfileResult.aggregateStageProfileMetric, which merges stage attempts. On the storedgpu_oom_eventlogfixture this made SQL 24 reportduration_min=0while its task-bearing stages had minima of 3085, 4374, and 4760 ms.Both folds now key on task count rather than value, because 0 remains a legitimate duration for a task that ran. The record fold skips a zero-task record, and the attempt merge takes the populated operand's minimum when exactly one side is empty.
A standalone zero-task stage row also publishes an empty
duration_mininstead of 0. QualX pools stage rows by SQL and reduces_mincolumns with pandasmin; it recomputesduration_meanfrom pooled sums but cannot reconstruct a minimum, so retaining numeric 0 would continue feeding the model a false value. For QualX owners: the shipped XGBoost models useduration_min, so predictions can change for affected applications; an all-empty group now supplies a missing value instead of a synthetic 0.duration_maxandduration_avgdeliberately keep their zero values on an empty row. Zero never wins a maximum, and the mean is recomputed downstream from pooled sums and counts, so the minimum is the only sentinel that propagates.Tests cover the stored fixture through SQL aggregation and cover stage-attempt merging with populated, empty-left, empty-right, and both-empty operands. Full verification passed on Scala 2.12 and 2.13.