Skip to content

[SPARK-58587][ML] Move final IsotonicRegression PAV pass to executor - #57788

Closed
zhengruifeng wants to merge 2 commits into
apache:masterfrom
zhengruifeng:ml_iso_fit
Closed

[SPARK-58587][ML] Move final IsotonicRegression PAV pass to executor#57788
zhengruifeng wants to merge 2 commits into
apache:masterfrom
zhengruifeng:ml_iso_fit

Conversation

@zhengruifeng

@zhengruifeng zhengruifeng commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This PR moves the final Pool Adjacent Violators (PAV) pass in IsotonicRegression from the
driver to a single executor partition. It replaces the driver-side in-memory sort of all partial
results with sortBy(..., numPartitions = 1), allowing Spark shuffle sort to spill while ordering
partial results. The driver collects only the final PAV output.

The PR also adds regression coverage for a monotonicity violation that spans two input
partitions.

Why are the changes needed?

The final PAV pass can substantially compress partial results. Running it before collect()
reduces driver memory and data transfer when that compression occurs. The final PAV pass remains
single-partition, but the preceding sort no longer materializes every partial result on the driver.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Added a regression test for merging partial PAV results across partitions.

Static checks completed successfully:

  • git diff --check
  • ASCII scan of the changed Scala files
  • changed-line length scan

The test suite was not run because it was not requested.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Codex (GPT-5)

@zhengruifeng zhengruifeng changed the title [WIP][MLLIB] Use spillable sort for final IsotonicRegression pass [WIP][SPARK-58587][ML] Use spillable sort for final IsotonicRegression pass Aug 5, 2026
@zhengruifeng zhengruifeng changed the title [WIP][SPARK-58587][ML] Use spillable sort for final IsotonicRegression pass [SPARK-58587][ML] Use spillable sort for final IsotonicRegression pass Aug 5, 2026
@zhengruifeng
zhengruifeng marked this pull request as ready for review August 5, 2026 08:56
@zhengruifeng zhengruifeng changed the title [SPARK-58587][ML] Use spillable sort for final IsotonicRegression pass [SPARK-58587][ML] Move final IsotonicRegression PAV pass to executor Aug 5, 2026
@uros-b

uros-b commented Aug 5, 2026

Copy link
Copy Markdown
Member

LGTM

zhengruifeng added a commit that referenced this pull request Aug 6, 2026
### What changes were proposed in this pull request?

This PR moves the final Pool Adjacent Violators (PAV) pass in `IsotonicRegression` from the
driver to a single executor partition. It replaces the driver-side in-memory sort of all partial
results with `sortBy(..., numPartitions = 1)`, allowing Spark shuffle sort to spill while ordering
partial results. The driver collects only the final PAV output.

The PR also adds regression coverage for a monotonicity violation that spans two input
partitions.

### Why are the changes needed?

The final PAV pass can substantially compress partial results. Running it before `collect()`
reduces driver memory and data transfer when that compression occurs. The final PAV pass remains
single-partition, but the preceding sort no longer materializes every partial result on the driver.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Added a regression test for merging partial PAV results across partitions.

Static checks completed successfully:

- `git diff --check`
- ASCII scan of the changed Scala files
- changed-line length scan

The test suite was not run because it was not requested.

### Was this patch authored or co-authored using generative AI tooling?

Generated-by: Codex (GPT-5)

Closes #57788 from zhengruifeng/ml_iso_fit.

Authored-by: Ruifeng Zheng <ruifengz@apache.org>
Signed-off-by: Ruifeng Zheng <ruifengz@foxmail.com>
(cherry picked from commit 80afd1d)
Signed-off-by: Ruifeng Zheng <ruifengz@foxmail.com>
@zhengruifeng

Copy link
Copy Markdown
Contributor Author

Merge Summary:

Posted by merge_spark_pr.py

@zhengruifeng
zhengruifeng deleted the ml_iso_fit branch August 6, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants