feat: add LinearCurve variant for adaptive parallelism strategy #24022
+359
−5
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.
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Summary
This PR introduces a new
LinearCurvevariant to theAdaptiveParallelismStrategyenum, enabling flexible piecewise-linear mapping from available parallelism to target parallelism ratio. It enhances the system's ability to finely control parallelism scaling behavior beyond existing fixed or ratio-based strategies.Details
LinearCurveandLinearCurvePointstructs representing piecewise-linear curves with validated points sorted by available parallelism.LINEAR_CURVE(0:0,10:0.5,20:0.8)with automatic padding at boundaries for robustness.compute_target_parallelismto handle the new strategy, impacting adaptive parallelism decisions across the system.By the way, this curve doesn't necessarily need to keep increasing; it can even be used to draw a sine curve.
Checklist
Documentation
Release note
Add a linear_curve to the adaptive parallelism strategy, allowing users to customize the scaling curve.