You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "rmuir (via GitHub)" <gi...@apache.org> on 2023/11/05 15:56:28 UTC

[PR] Detect J9 and disable vectorization completely (it is not supported there) [lucene]

rmuir opened a new pull request, #12764:
URL: https://github.com/apache/lucene/pull/12764

   J9 VM doesn't seem to actually implement the vector api, so it falls back to hundreds-of-times-slower-pure-java impl. Currently:
   ```
   VectorUtilBenchmark.floatCosineScalar         1024  thrpt   15  0.860 ±  0.011  ops/us
   VectorUtilBenchmark.floatCosineVector         1024  thrpt   75  0.010 ±  0.001  ops/us (!)
   VectorUtilBenchmark.floatDotProductScalar     1024  thrpt   15  2.325 ±  0.047  ops/us
   VectorUtilBenchmark.floatDotProductVector     1024  thrpt   75  0.021 ±  0.001  ops/us (!)
   VectorUtilBenchmark.floatSquareScalar         1024  thrpt   15  1.797 ±  0.020  ops/us
   VectorUtilBenchmark.floatSquareVector         1024  thrpt   75  0.015 ±  0.001  ops/us (!)
   ```
   
   Look, i realize somehow it seems "culturally acceptable" in the java world to fall back to hundreds-of-times-slower code whenever it is convenient (e.g. `Math.fma` in the jdk), but this is so, so, so, wrong. We must never allow it to happen when it can be easily prevented: we have to detect and prevent such performance landmines.
   
   Many users have no idea of the differences between different JVMs and I don't want them hitting any traps like this. It may not really be their fault, perhaps some java-based software they are running is turning on the vector flags for them in a shell script/bat file, and they just happen to have J9 VM in their path.
   
   Patch:
   ```
   Benchmark                                   (size)   Mode  Cnt  Score   Error   Units
   VectorUtilBenchmark.floatCosineScalar         1024  thrpt   15  0.858 ± 0.012  ops/us
   VectorUtilBenchmark.floatCosineVector         1024  thrpt   75  0.864 ± 0.002  ops/us
   VectorUtilBenchmark.floatDotProductScalar     1024  thrpt   15  2.327 ± 0.027  ops/us
   VectorUtilBenchmark.floatDotProductVector     1024  thrpt   75  2.331 ± 0.013  ops/us
   VectorUtilBenchmark.floatSquareScalar         1024  thrpt   15  1.782 ± 0.022  ops/us
   VectorUtilBenchmark.floatSquareVector         1024  thrpt   75  1.779 ± 0.021  ops/us
   ```


-- 
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] Detect J9 and disable vectorization completely (it is not supported there) [lucene]

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

   I have another PR already developed: #12765 
   
   It does not use sysprops and detects hotspot by the algorithms we already use. Should I close this one?


-- 
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] Detect J9 and disable vectorization completely (it is not supported there) [lucene]

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir closed pull request #12764: Detect J9 and disable vectorization completely (it is not supported there)
URL: https://github.com/apache/lucene/pull/12764


-- 
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] Detect J9 and disable vectorization completely (it is not supported there) [lucene]

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

   I like Uwe's PR better here, closing this one


-- 
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