You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "CH-Abhinav (via GitHub)" <gi...@apache.org> on 2026/09/05 18:09:58 UTC

[PR] Draft: Add single-query many-doc bulk scoring API to VectorUtilSupport (#16556) [lucene]

CH-Abhinav opened a new pull request, #16640:
URL: https://github.com/apache/lucene/pull/16640

   ### Description
   This is Draft PR addressing #16556 and subsequently progressing #15155 
   
   This PR is trying to move bulk scoring API down to `VectorUtilSupport` layer, allowing the `PanamaVectorUtilSupport` to see bulk operations.
   
   **Current progress (float32 dot product):**
   1. Added zero-allocation `void dotProductBulk(float[] query, float[][] docs, float[] results)` to `VectorUtilSupport`.
   2. Added scalar fallback loop to `DefaultVectorUtilSupport` and pass-through to `NativeVectorUtilSupport`.
   3.  Added 4 vector unrolling in `PanamaVectorUtilSupport` 
   
   **Next steps:**
   * Update `RandomVectorScorer` to consume the new `VectorUtil.dotProductBulk()` method to prove the end-to-end integration.
   * Add similar methods to in bulk format.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Draft: Add single-query many-doc bulk scoring API to VectorUtilSupport (#16556) [lucene]

Posted by "CH-Abhinav (via GitHub)" <gi...@apache.org>.
CH-Abhinav commented on PR #16640:
URL: https://github.com/apache/lucene/pull/16640#issuecomment-5684154879

   thanks for the review @kaivalnp I will continue working on PR
   
   But regarding `NativeVectorUtilSupport` , currently I am by passing FFI to C library and making it always fallback to Panama delegate. If we want proper transfer we will need to write `MethodHandle` and `FunctionDescriptor` for bulk Operations including updating underlying C library itself. 
   
   So should I do C-library implementations and the FFI calling in this PR or just do SIMD layer and see about native layer later?
   I will come up with similary implementations for `consine` and `squareDistance`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Draft: Add single-query many-doc bulk scoring API to VectorUtilSupport (#16556) [lucene]

Posted by "CH-Abhinav (via GitHub)" <gi...@apache.org>.
CH-Abhinav commented on PR #16640:
URL: https://github.com/apache/lucene/pull/16640#issuecomment-5651791186

   I went ahead and implemented off-heap path to `PanamaVectorUtilSupport` for `dotProductBulk` to make end to end connection.
   
   while doing so I did following:-
   1. Left the base VectorUtilSupport strictly for on-heap arrays
   2. Added a public static SIMD batching method directly to `PanamaVectorUtilSupport` to handle off-heap vector unrolling
   3. Directed existing `MemorySegmentBulkVectorOps` to new method
   
   If everyone is okay with this implementation pipeline then i will go ahead and implement the remaining similarity functions like `cosine` and `squareDistance` . So reviewers out there if you have some time please review this Draft once.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Draft: Add single-query many-doc bulk scoring API to VectorUtilSupport (#16556) [lucene]

Posted by "kaivalnp (via GitHub)" <gi...@apache.org>.
kaivalnp commented on PR #16640:
URL: https://github.com/apache/lucene/pull/16640#issuecomment-5670012348

   Thanks @CH-Abhinav, this looks like the right path to me.
   
   I think we should also add equivalent functions to `NativeVectorUtilSupport` though.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org