Allow the ability for uneven row wise sharding based on number of buckets for zch #3341
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.
Summary:
This diff enables the use of num_buckets ParameterConstraint in the planner. The presence of this planner will indicate the use of ZCH bucketing as part of rowwise sharding plans.
Without num_buckets present:
The current row-wise sharding strategy will be used.
With num_buckets present:
We will divide the buckets to be evenly distributed across hosts and distribute an additional bucket to the required number of hosts to handle the remainders.
For eg. if
Test case 2: hash_size = 100, num_devices = 4, num_buckets = 10
Each bucket has 10 rows, buckets distributed as [3,3,2,2]
So rows are distributed as [30,30,20,20]
We will distribute the buckets in the proportion of the memory of the device to the total memory of all devices and all the remaining buckets left are stored on the last device in the case where buckets do not completely fit based on the memory ratios.
for eg
hash_size = 45, num_buckets = 9, bucket_size = 5
With memory ratio 2:1:1, buckets should be distributed as [4,2,3]
So rows are distributed as [20,10,15]
Differential Revision: D79659949