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 micro-benchmark module in k-NN plugin for benchmark streaming vectors to JNI layer functionality. #1583

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

navneet1v
Copy link
Collaborator

@navneet1v navneet1v commented Mar 28, 2024

Description

Add micro-benchmark module in k-NN plugin for benchmark streaming vectors to JNI layer functionality.

This is first of many PR that will be raised for Issue: #1506.

The benchmark results that will be used in #1506 will come from this change. Hence adding it upfront.

Along with this change I am adding a new interface in JNILayer: transferVectorsV2, which is actually getting benchmarked. This interface is experimental and will changed once I start the feature development. Right now I have marked the interface as experimental.

What is micro-benchmarks? and how it is useful?

Micro-benchmark is a new module which is getting added in k-NN plugin that will host some client code to run the performance benchmarks. This module will help us do the benchmarking of a specific internal piece of code/functions/feature of k-NN plugin without setting up the whole cluster. Internally the module uses JMH as the benchmarking platform.

Results

./gradlew -p micro-benchmarks run --args ' -gc true ' -Djvm.heap.size=16g

Benchmark (dimension) (vectorsPerTransfer) Mode Cnt Score Units
TransferVectorsBenchmarks.transferVectors 128 100000 ss 3 1.904 s/op
TransferVectorsBenchmarks.transferVectors 128 500000 ss 3 1.589 s/op
TransferVectorsBenchmarks.transferVectors 128 1000000 ss 3 1.443 s/op
TransferVectorsBenchmarks.transferVectors 256 100000 ss 3 3.986 s/op
TransferVectorsBenchmarks.transferVectors 256 500000 ss 3 3.234 s/op
TransferVectorsBenchmarks.transferVectors 256 1000000 ss 3 2.863 s/op
TransferVectorsBenchmarks.transferVectors 384 100000 ss 3 6.306 s/op
TransferVectorsBenchmarks.transferVectors 384 500000 ss 3 4.953 s/op
TransferVectorsBenchmarks.transferVectors 384 1000000 ss 3 4.478 s/op
TransferVectorsBenchmarks.transferVectors 512 100000 ss 3 7.74 s/op
TransferVectorsBenchmarks.transferVectors 512 500000 ss 3 6.063 s/op
TransferVectorsBenchmarks.transferVectors 512 1000000 ss 3 5.338 s/op

Issues Resolved

NA

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed as per the DCO using --signoff

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.

Copy link

codecov bot commented Mar 28, 2024

Codecov Report

Attention: Patch coverage is 37.50000% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 84.87%. Comparing base (c861966) to head (622ea16).

Files Patch % Lines
...ain/java/org/opensearch/knn/index/KNNSettings.java 42.85% 4 Missing ⚠️
...c/main/java/org/opensearch/knn/jni/JNIService.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1583      +/-   ##
============================================
- Coverage     84.96%   84.87%   -0.10%     
+ Complexity     1366     1365       -1     
============================================
  Files           172      172              
  Lines          5566     5572       +6     
  Branches        546      546              
============================================
  Hits           4729     4729              
- Misses          605      610       +5     
- Partials        232      233       +1     

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

…ctors to JNI layer functionality.

Signed-off-by: Navneet Verma <[email protected]>
Copy link
Member

@jmazanec15 jmazanec15 left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

@navneet1v navneet1v merged commit cc91c7c into opensearch-project:main Mar 28, 2024
51 of 54 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 28, 2024
…ctors to JNI layer functionality. (#1583)

Signed-off-by: Navneet Verma <[email protected]>
(cherry picked from commit cc91c7c)
navneet1v added a commit that referenced this pull request Apr 3, 2024
…ctors to JNI layer functionality. (#1583) (#1584)

Signed-off-by: Navneet Verma <[email protected]>
(cherry picked from commit cc91c7c)

Co-authored-by: Navneet Verma <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants