-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Approximation Framework Enhancement: Update the BKD traversal logic to improve the performance on skewed data #18439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Approximation Framework Enhancement: Update the BKD traversal logic to improve the performance on skewed data #18439
Conversation
Signed-off-by: Prudhvi Godithi <[email protected]>
Signed-off-by: Prudhvi Godithi <[email protected]>
|
Coming from @msfroh comment #18342 (comment), I will update the PR to remove the changes from NumberFieldMapper class, once I see the benchmark results improve for different datasets that has different numeric types (Related PR from benchmark workloads repo opensearch-project/opensearch-benchmark-workloads#655). Coming from this comment #18313 (comment), in past we have seen regression with With the updated code I have tested with Adding @harshavamsi @kkewwei @getsaurabh02 @msfroh to please take a look. Thanks |
|
{"run-benchmark-test": "id_4"} |
|
{"run-benchmark-test": "id_13"} |
|
The Jenkins job url is https://build.ci.opensearch.org/job/benchmark-pull-request/3338/ . Final results will be published once the job is completed. |
|
The Jenkins job url is https://build.ci.opensearch.org/job/benchmark-pull-request/3339/ . Final results will be published once the job is completed. |
|
❌ Gradle check result for 33d7e68: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Prudhvi Godithi <[email protected]>
|
❌ Gradle check result for 03478f6: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Benchmark ResultsBenchmark Results for Job: https://build.ci.opensearch.org/job/benchmark-pull-request/3339/
|
Benchmark Baseline Comparison ResultsBenchmark Results for Job: https://build.ci.opensearch.org/job/benchmark-compare/109/
|
|
{"run-benchmark-test": "id_13"} |
|
The Jenkins job url is https://build.ci.opensearch.org/job/benchmark-pull-request/3340/ . Final results will be published once the job is completed. |
Benchmark ResultsBenchmark Results for Job: https://build.ci.opensearch.org/job/benchmark-pull-request/3340/
|
Benchmark Baseline Comparison ResultsBenchmark Results for Job: https://build.ci.opensearch.org/job/benchmark-compare/110/
|
Benchmark ResultsBenchmark Results for Job: https://build.ci.opensearch.org/job/benchmark-pull-request/3338/
|
Benchmark Baseline Comparison ResultsBenchmark Results for Job: https://build.ci.opensearch.org/job/benchmark-compare/111/
|
|
For From the PR opensearch-project/opensearch-benchmark-workloads#655 I had added more query types which I saw nice improvement for No issues seen with |
Signed-off-by: Prudhvi Godithi <[email protected]>
|
While I add some more tests @msfroh @harshavamsi @kkewwei @bowenlan-amzn @asimmahmood1 can you please review the PR and add your thoughts ? |
kkewwei
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The merge button is gray in my side.😢 |
|
Thanks for your review @kkewwei, I see whats happening, you are not part of |
Signed-off-by: Prudhvi Godithi <[email protected]>
|
Just pushed a commit to fix the |
|
@prudhvigodithi thanks for the change. Could you help me understand what is the memory overhead of the clone? and in worst case, how many such clone trees may exist? when does the cloned tree releases memory? |
|
Hey @rishabhmaurya here is some background on why the |
|
@prudhvigodithi so for some giant segment (say > 1 gb) and in worst case, what would be the memory overhead due to clone? |
|
Thanks @rishabhmaurya please check the following details: This is the following test I did for both asc and desc sort. The number of clients 1, 200 warmup-iterations and 100 iterations. The index used is big5 (created with 1 shard) with force merged to 1 segment. The tree has 18 levels of depth asc (
|
…o improve the performance on skewed data (opensearch-project#18439) * Initial commit for skewed datasets Signed-off-by: Prudhvi Godithi <[email protected]> * Approximation optimization Signed-off-by: Prudhvi Godithi <[email protected]> * Fix test Signed-off-by: Prudhvi Godithi <[email protected]> * Revert NumberFieldMapper changes Signed-off-by: Prudhvi Godithi <[email protected]> * Test nyc_taxis with updated NumberFieldMapper Signed-off-by: Prudhvi Godithi <[email protected]> * More optimization for asc sorts Signed-off-by: Prudhvi Godithi <[email protected]> * More optimization for asc sorts Signed-off-by: Prudhvi Godithi <[email protected]> * Revert NumberFieldMapper and add tests Signed-off-by: Prudhvi Godithi <[email protected]> * Updated CHANGELOG.md Signed-off-by: Prudhvi Godithi <[email protected]> * Fix flaky test in ApproximatePointRangeQueryTests Signed-off-by: Prudhvi Godithi <[email protected]> --------- Signed-off-by: Prudhvi Godithi <[email protected]>
|
@prudhvigodithi thanks for profiling. The clone way of traversing BKD in reverse order looks very promising. So, in the earlier approach, we were executing way too many intersections with tree in NumericComparator with every collection of competitive hits? Whereas, here we are bounded on the clones of the tree by its height, which sounds way more efficient and thus we see less memory utilization too in addition to latency reductions? |
|
Thats true @rishabhmaurya, since we are traversing reverse in the BKD we directly target the highest docs (desc) and once the size is met we early terminate. |
|
Seen some good improvement with nightlies especially for
Here are some compariosn runs: |
…o improve the performance on skewed data (opensearch-project#18439) * Initial commit for skewed datasets Signed-off-by: Prudhvi Godithi <[email protected]> * Approximation optimization Signed-off-by: Prudhvi Godithi <[email protected]> * Fix test Signed-off-by: Prudhvi Godithi <[email protected]> * Revert NumberFieldMapper changes Signed-off-by: Prudhvi Godithi <[email protected]> * Test nyc_taxis with updated NumberFieldMapper Signed-off-by: Prudhvi Godithi <[email protected]> * More optimization for asc sorts Signed-off-by: Prudhvi Godithi <[email protected]> * More optimization for asc sorts Signed-off-by: Prudhvi Godithi <[email protected]> * Revert NumberFieldMapper and add tests Signed-off-by: Prudhvi Godithi <[email protected]> * Updated CHANGELOG.md Signed-off-by: Prudhvi Godithi <[email protected]> * Fix flaky test in ApproximatePointRangeQueryTests Signed-off-by: Prudhvi Godithi <[email protected]> --------- Signed-off-by: Prudhvi Godithi <[email protected]>
…o improve the performance on skewed data (opensearch-project#18439) * Initial commit for skewed datasets Signed-off-by: Prudhvi Godithi <[email protected]> * Approximation optimization Signed-off-by: Prudhvi Godithi <[email protected]> * Fix test Signed-off-by: Prudhvi Godithi <[email protected]> * Revert NumberFieldMapper changes Signed-off-by: Prudhvi Godithi <[email protected]> * Test nyc_taxis with updated NumberFieldMapper Signed-off-by: Prudhvi Godithi <[email protected]> * More optimization for asc sorts Signed-off-by: Prudhvi Godithi <[email protected]> * More optimization for asc sorts Signed-off-by: Prudhvi Godithi <[email protected]> * Revert NumberFieldMapper and add tests Signed-off-by: Prudhvi Godithi <[email protected]> * Updated CHANGELOG.md Signed-off-by: Prudhvi Godithi <[email protected]> * Fix flaky test in ApproximatePointRangeQueryTests Signed-off-by: Prudhvi Godithi <[email protected]> --------- Signed-off-by: Prudhvi Godithi <[email protected]>Signed-off-by: TJ Neuenfeldt <[email protected]>
…o improve the performance on skewed data (opensearch-project#18439) * Initial commit for skewed datasets Signed-off-by: Prudhvi Godithi <[email protected]> * Approximation optimization Signed-off-by: Prudhvi Godithi <[email protected]> * Fix test Signed-off-by: Prudhvi Godithi <[email protected]> * Revert NumberFieldMapper changes Signed-off-by: Prudhvi Godithi <[email protected]> * Test nyc_taxis with updated NumberFieldMapper Signed-off-by: Prudhvi Godithi <[email protected]> * More optimization for asc sorts Signed-off-by: Prudhvi Godithi <[email protected]> * More optimization for asc sorts Signed-off-by: Prudhvi Godithi <[email protected]> * Revert NumberFieldMapper and add tests Signed-off-by: Prudhvi Godithi <[email protected]> * Updated CHANGELOG.md Signed-off-by: Prudhvi Godithi <[email protected]> * Fix flaky test in ApproximatePointRangeQueryTests Signed-off-by: Prudhvi Godithi <[email protected]> --------- Signed-off-by: Prudhvi Godithi <[email protected]>
…o improve the performance on skewed data (opensearch-project#18439) * Initial commit for skewed datasets Signed-off-by: Prudhvi Godithi <[email protected]> * Approximation optimization Signed-off-by: Prudhvi Godithi <[email protected]> * Fix test Signed-off-by: Prudhvi Godithi <[email protected]> * Revert NumberFieldMapper changes Signed-off-by: Prudhvi Godithi <[email protected]> * Test nyc_taxis with updated NumberFieldMapper Signed-off-by: Prudhvi Godithi <[email protected]> * More optimization for asc sorts Signed-off-by: Prudhvi Godithi <[email protected]> * More optimization for asc sorts Signed-off-by: Prudhvi Godithi <[email protected]> * Revert NumberFieldMapper and add tests Signed-off-by: Prudhvi Godithi <[email protected]> * Updated CHANGELOG.md Signed-off-by: Prudhvi Godithi <[email protected]> * Fix flaky test in ApproximatePointRangeQueryTests Signed-off-by: Prudhvi Godithi <[email protected]> --------- Signed-off-by: Prudhvi Godithi <[email protected]>








Description
Approximation Framework Enhancement: Update the BKD traversal logic to improve the performance on skewed data
Related Issues
#18341
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.