kaivalnp commented on PR #15341:
URL: https://github.com/apache/lucene/pull/15341#issuecomment-3427956084

   > I wasn't aligning the output inside [this merge 
function](https://github.com/apache/lucene/blob/eb27b14eaa09c53496a50c5944160b4989910882/lucene/core/src/java/org/apache/lucene/codecs/lucene99/Lucene99FlatVectorsWriter.java#L252-L253)
   
   Hmm this did not help for some reason (merge time increased)..
   
   `main` (4-byte-alignment)
   
   ```
   recall  latency(ms)  netCPU  avgCpuCount     nDoc  topK  fanout  maxConn  
beamWidth  quantized  visited  index(s)  index_docs/s  force_merge(s)  
num_segments  index_size(MB)  vec_disk(MB)  vec_RAM(MB)  indexType
    0.891        1.895   1.887        0.996  1000000   100      50       32     
   250         no     5408     72.35      13822.46          101.30             
1         3014.54      2929.688     2929.688       HNSW
   ```
   
   This PR (64-byte-alignment)
   
   ```
   recall  latency(ms)  netCPU  avgCpuCount     nDoc  topK  fanout  maxConn  
beamWidth  quantized  visited  index(s)  index_docs/s  force_merge(s)  
num_segments  index_size(MB)  vec_disk(MB)  vec_RAM(MB)  indexType
    0.893        1.868   1.860        0.996  1000000   100      50       32     
   250         no     5426     69.55      14378.97          127.48             
1         3015.40      2929.688     2929.688       HNSW
   ```
   
   I'll still add a commit + revert, so people can see what I tried, and 
comment if I'm missing something!
   
   ---
   
   > Is the alignment also (or maybe less) important for the quantized cases?
   
   I think alignment is less important for quantized vectors (which are stored 
as byte vectors on disk) -- because none of the JMH benchmarks show non-trivial 
variation with padding? (see `VectorScorerBenchmark.binaryDotProductMemSeg`)
   
   > Your results above are for `float32` vectors?
   
   Yeah, those benchmarks^ are for float vectors
   
   > Maybe at least `luceneutil` could somehow warn if vectors are unaligned 
during its perf testing?
   
   I added some print statements to complain if non-64-byte-aligned addresses 
were used (`MemorySegment#address % 64 == 0`) -- and it complained in (only) 
baseline benchmarks..
   
   Not committing because it may not be needed after this PR?


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to