Skip to content
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

Add experimental SIMD implementation of B-tree to round down dates #11194

Merged
merged 15 commits into from
Jan 18, 2024

Conversation

ketanv3
Copy link
Contributor

@ketanv3 ketanv3 commented Nov 14, 2023

Description

In the date histogram aggregation, the timestamp value from each hit must be rounded down to the nearest interval (year, quarter, month, week, day, etc.) as defined in the search request. This rounded-down timestamp serves as the bucket key to aggregate results.

This PR aims to improve the performance of rounding-down dates using SIMD.
More details can be found here: #10392

Related Issues

Resolves #10392

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • Public documentation issue/PR created

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.

@github-actions github-actions bot added the enhancement Enhancement or improvement to existing feature or request label Nov 14, 2023
@ketanv3 ketanv3 changed the title Add vectorized (SIMD) implementation of B-tree to round down dates [DRAFT] Add vectorized (SIMD) implementation of B-tree to round down dates Nov 14, 2023
Copy link
Contributor

github-actions bot commented Nov 14, 2023

Compatibility status:

Checks if related components are compatible with change 88b45a3

Incompatible components

Incompatible components: [https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/performance-analyzer-rca.git]

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/geospatial.git]

Copy link
Contributor

❌ Gradle check result for 923022b: 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?

Copy link
Contributor

❕ Gradle check result for d03fc44: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.search.SearchWeightedRoutingIT.testMultiGetWithNetworkDisruption_FailOpenEnabled

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Copy link

codecov bot commented Nov 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (904c9a9) 71.44% compared to head (88b45a3) 71.38%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11194      +/-   ##
============================================
- Coverage     71.44%   71.38%   -0.07%     
+ Complexity    59397    59345      -52     
============================================
  Files          4923     4923              
  Lines        279178   279178              
  Branches      40581    40581              
============================================
- Hits         199470   199283     -187     
- Misses        63064    63274     +210     
+ Partials      16644    16621      -23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

❕ Gradle check result for a67c3d9: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.search.SearchWeightedRoutingIT.testMultiGetWithNetworkDisruption_FailOpenEnabled

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Copy link
Contributor

✅ Gradle check result for bc42b6b: SUCCESS

Copy link
Contributor

✅ Gradle check result for ee1e2a2: SUCCESS

@ketanv3 ketanv3 changed the title [DRAFT] Add vectorized (SIMD) implementation of B-tree to round down dates [DRAFT] Add experimental SIMD implementation of B-tree to round down dates Nov 15, 2023
Copy link
Contributor

✅ Gradle check result for 4432ec6: SUCCESS

Copy link
Contributor

✅ Gradle check result for 550422c: SUCCESS

Copy link
Contributor

❕ Gradle check result for 0edb311: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.remotestore.RemoteIndexPrimaryRelocationIT.testPrimaryRelocationWhileIndexing

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@reta reta self-requested a review December 18, 2023 14:30
Copy link
Contributor

❕ Gradle check result for 5336b6d: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.search.SearchWeightedRoutingIT.testMultiGetWithNetworkDisruption_FailOpenEnabled

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Copy link
Contributor

❕ Gradle check result for 42eac9a: UNSTABLE

  • TEST FAILURES:
      2 org.opensearch.remotestore.RemoteIndexPrimaryRelocationIT.testPrimaryRelocationWhileIndexing

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Copy link
Contributor

@backslasht backslasht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ketanv3 for making this changes!

@ketanv3
Copy link
Contributor Author

ketanv3 commented Dec 21, 2023

@andrross Are you still looking at this PR?

@andrross
Copy link
Member

@reta Looks like I missed this one :(

Are you still good with this? I've rebased against main so it should be good to merge once the check is green.

Copy link
Contributor

❕ Gradle check result for 88b45a3: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.remotestore.RemoteIndexPrimaryRelocationIT.testPrimaryRelocationWhileIndexing

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@reta reta merged commit b424aaf into opensearch-project:main Jan 18, 2024
30 checks passed
@reta reta added v3.0.0 Issues and PRs related to version 3.0.0 v2.12.0 Issues and PRs related to version 2.12.0 backport 2.x Backport to 2.x branch labels Jan 18, 2024
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 18, 2024
…11194)

* Add experimental SIMD implementation of B-tree to round down dates

Signed-off-by: Ketan Verma <[email protected]>

* Use system properties in favor of feature flags to remove dependency on the server module

Signed-off-by: Ketan Verma <[email protected]>

* Removed Java 20 test sources to simplify builds

Signed-off-by: Ketan Verma <[email protected]>

* Remove the use of forbidden APIs in unit-tests

Signed-off-by: Ketan Verma <[email protected]>

* Migrate to the recommended usage for custom test task classpath

Signed-off-by: Ketan Verma <[email protected]>

* Switch benchmarks module to multi-release one

Signed-off-by: Andriy Redko <[email protected]>

* Add JMH annotation processing for JDK-20+ sources

Signed-off-by: Andriy Redko <[email protected]>

* Make JMH annotations consistent across sources

Signed-off-by: Ketan Verma <[email protected]>

* Improve execution of Roundable unit-tests

Signed-off-by: Ketan Verma <[email protected]>

* Revert "Improve execution of Roundable unit-tests"

This reverts commit 2e82d0a.

Signed-off-by: Ketan Verma <[email protected]>

* Add 'forced' as a possible feature flag value to simplify the execution of unit-tests

Signed-off-by: Ketan Verma <[email protected]>

---------

Signed-off-by: Ketan Verma <[email protected]>
Signed-off-by: Andriy Redko <[email protected]>
Co-authored-by: Andriy Redko <[email protected]>
Co-authored-by: Andrew Ross <[email protected]>
(cherry picked from commit b424aaf)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
reta added a commit that referenced this pull request Jan 18, 2024
…11194)

* Add experimental SIMD implementation of B-tree to round down dates

Signed-off-by: Ketan Verma <[email protected]>

* Use system properties in favor of feature flags to remove dependency on the server module

Signed-off-by: Ketan Verma <[email protected]>

* Removed Java 20 test sources to simplify builds

Signed-off-by: Ketan Verma <[email protected]>

* Remove the use of forbidden APIs in unit-tests

Signed-off-by: Ketan Verma <[email protected]>

* Migrate to the recommended usage for custom test task classpath

Signed-off-by: Ketan Verma <[email protected]>

* Switch benchmarks module to multi-release one

Signed-off-by: Andriy Redko <[email protected]>

* Add JMH annotation processing for JDK-20+ sources

Signed-off-by: Andriy Redko <[email protected]>

* Make JMH annotations consistent across sources

Signed-off-by: Ketan Verma <[email protected]>

* Improve execution of Roundable unit-tests

Signed-off-by: Ketan Verma <[email protected]>

* Revert "Improve execution of Roundable unit-tests"

This reverts commit 2e82d0a.

Signed-off-by: Ketan Verma <[email protected]>

* Add 'forced' as a possible feature flag value to simplify the execution of unit-tests

Signed-off-by: Ketan Verma <[email protected]>

---------

Signed-off-by: Ketan Verma <[email protected]>
Signed-off-by: Andriy Redko <[email protected]>
Co-authored-by: Andriy Redko <[email protected]>
Co-authored-by: Andrew Ross <[email protected]>
(cherry picked from commit b424aaf)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
reta added a commit that referenced this pull request Jan 18, 2024
…11194) (#11924)

* Add experimental SIMD implementation of B-tree to round down dates



* Use system properties in favor of feature flags to remove dependency on the server module



* Removed Java 20 test sources to simplify builds



* Remove the use of forbidden APIs in unit-tests



* Migrate to the recommended usage for custom test task classpath



* Switch benchmarks module to multi-release one



* Add JMH annotation processing for JDK-20+ sources



* Make JMH annotations consistent across sources



* Improve execution of Roundable unit-tests



* Revert "Improve execution of Roundable unit-tests"

This reverts commit 2e82d0a.



* Add 'forced' as a possible feature flag value to simplify the execution of unit-tests



---------





(cherry picked from commit b424aaf)

Signed-off-by: Ketan Verma <[email protected]>
Signed-off-by: Andriy Redko <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Andriy Redko <[email protected]>
Co-authored-by: Andrew Ross <[email protected]>
peteralfonsi pushed a commit to peteralfonsi/OpenSearch that referenced this pull request Mar 1, 2024
…pensearch-project#11194)

* Add experimental SIMD implementation of B-tree to round down dates

Signed-off-by: Ketan Verma <[email protected]>

* Use system properties in favor of feature flags to remove dependency on the server module

Signed-off-by: Ketan Verma <[email protected]>

* Removed Java 20 test sources to simplify builds

Signed-off-by: Ketan Verma <[email protected]>

* Remove the use of forbidden APIs in unit-tests

Signed-off-by: Ketan Verma <[email protected]>

* Migrate to the recommended usage for custom test task classpath

Signed-off-by: Ketan Verma <[email protected]>

* Switch benchmarks module to multi-release one

Signed-off-by: Andriy Redko <[email protected]>

* Add JMH annotation processing for JDK-20+ sources

Signed-off-by: Andriy Redko <[email protected]>

* Make JMH annotations consistent across sources

Signed-off-by: Ketan Verma <[email protected]>

* Improve execution of Roundable unit-tests

Signed-off-by: Ketan Verma <[email protected]>

* Revert "Improve execution of Roundable unit-tests"

This reverts commit 2e82d0a.

Signed-off-by: Ketan Verma <[email protected]>

* Add 'forced' as a possible feature flag value to simplify the execution of unit-tests

Signed-off-by: Ketan Verma <[email protected]>

---------

Signed-off-by: Ketan Verma <[email protected]>
Signed-off-by: Andriy Redko <[email protected]>
Co-authored-by: Andriy Redko <[email protected]>
Co-authored-by: Andrew Ross <[email protected]>
rayshrey pushed a commit to rayshrey/OpenSearch that referenced this pull request Mar 18, 2024
…pensearch-project#11194)

* Add experimental SIMD implementation of B-tree to round down dates

Signed-off-by: Ketan Verma <[email protected]>

* Use system properties in favor of feature flags to remove dependency on the server module

Signed-off-by: Ketan Verma <[email protected]>

* Removed Java 20 test sources to simplify builds

Signed-off-by: Ketan Verma <[email protected]>

* Remove the use of forbidden APIs in unit-tests

Signed-off-by: Ketan Verma <[email protected]>

* Migrate to the recommended usage for custom test task classpath

Signed-off-by: Ketan Verma <[email protected]>

* Switch benchmarks module to multi-release one

Signed-off-by: Andriy Redko <[email protected]>

* Add JMH annotation processing for JDK-20+ sources

Signed-off-by: Andriy Redko <[email protected]>

* Make JMH annotations consistent across sources

Signed-off-by: Ketan Verma <[email protected]>

* Improve execution of Roundable unit-tests

Signed-off-by: Ketan Verma <[email protected]>

* Revert "Improve execution of Roundable unit-tests"

This reverts commit 2e82d0a.

Signed-off-by: Ketan Verma <[email protected]>

* Add 'forced' as a possible feature flag value to simplify the execution of unit-tests

Signed-off-by: Ketan Verma <[email protected]>

---------

Signed-off-by: Ketan Verma <[email protected]>
Signed-off-by: Andriy Redko <[email protected]>
Co-authored-by: Andriy Redko <[email protected]>
Co-authored-by: Andrew Ross <[email protected]>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
…pensearch-project#11194)

* Add experimental SIMD implementation of B-tree to round down dates

Signed-off-by: Ketan Verma <[email protected]>

* Use system properties in favor of feature flags to remove dependency on the server module

Signed-off-by: Ketan Verma <[email protected]>

* Removed Java 20 test sources to simplify builds

Signed-off-by: Ketan Verma <[email protected]>

* Remove the use of forbidden APIs in unit-tests

Signed-off-by: Ketan Verma <[email protected]>

* Migrate to the recommended usage for custom test task classpath

Signed-off-by: Ketan Verma <[email protected]>

* Switch benchmarks module to multi-release one

Signed-off-by: Andriy Redko <[email protected]>

* Add JMH annotation processing for JDK-20+ sources

Signed-off-by: Andriy Redko <[email protected]>

* Make JMH annotations consistent across sources

Signed-off-by: Ketan Verma <[email protected]>

* Improve execution of Roundable unit-tests

Signed-off-by: Ketan Verma <[email protected]>

* Revert "Improve execution of Roundable unit-tests"

This reverts commit 2e82d0a.

Signed-off-by: Ketan Verma <[email protected]>

* Add 'forced' as a possible feature flag value to simplify the execution of unit-tests

Signed-off-by: Ketan Verma <[email protected]>

---------

Signed-off-by: Ketan Verma <[email protected]>
Signed-off-by: Andriy Redko <[email protected]>
Co-authored-by: Andriy Redko <[email protected]>
Co-authored-by: Andrew Ross <[email protected]>
Signed-off-by: Shivansh Arora <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch enhancement Enhancement or improvement to existing feature or request Search:Performance v2.12.0 Issues and PRs related to version 2.12.0 v3.0.0 Issues and PRs related to version 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SIMD] [POC] Improve performance of rounding dates in date_histogram aggregation
4 participants