You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Robert Muir (Jira)" <ji...@apache.org> on 2021/03/14 19:23:00 UTC

[jira] [Commented] (LUCENE-9838) simd version of VectorUtil.dotProduct

    [ https://issues.apache.org/jira/browse/LUCENE-9838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17301264#comment-17301264 ] 

Robert Muir commented on LUCENE-9838:
-------------------------------------

I attached a patch. You have to run compile/tests with java 16 to use it: pass something like {{-Pruntime.java.home=/home/rmuir/Downloads/jdk-16}} to gradle. If you are running with java manually you must add {{--add-modules jdk.incubator.vector}} to commandline flags (javac too). 

Performance improvements are large for big vectors (e.g. up to 6x faster than master)

{noformat}
Benchmark                 (size)   Mode  Cnt    Score   Error   Units

DotProduct.dotProductOld       1  thrpt   15  185.520 ± 0.649  ops/us
DotProduct.dotProductNew       1  thrpt   15  155.562 ± 0.460  ops/us

DotProduct.dotProductOld       4  thrpt   15  134.033 ± 0.622  ops/us
DotProduct.dotProductNew       4  thrpt   15  113.170 ± 0.754  ops/us

DotProduct.dotProductOld       6  thrpt   15  127.956 ± 0.554  ops/us
DotProduct.dotProductNew       6  thrpt   15   92.949 ± 0.260  ops/us

DotProduct.dotProductOld       8  thrpt   15   95.313 ± 0.600  ops/us
DotProduct.dotProductNew       8  thrpt   15   84.722 ± 0.340  ops/us

DotProduct.dotProductOld      13  thrpt   15   71.914 ± 0.323  ops/us
DotProduct.dotProductNew      13  thrpt   15   70.842 ± 0.132  ops/us

DotProduct.dotProductOld      16  thrpt   15   67.188 ± 0.204  ops/us
DotProduct.dotProductNew      16  thrpt   15   64.332 ± 0.444  ops/us

DotProduct.dotProductOld      25  thrpt   15   45.503 ± 0.188  ops/us
DotProduct.dotProductNew      25  thrpt   15   39.183 ± 2.068  ops/us

DotProduct.dotProductOld      32  thrpt   15   40.592 ± 0.162  ops/us
DotProduct.dotProductNew      32  thrpt   15   60.468 ± 0.426  ops/us

DotProduct.dotProductOld      64  thrpt   15   23.123 ± 0.136  ops/us
DotProduct.dotProductNew      64  thrpt   15   52.654 ± 0.346  ops/us

DotProduct.dotProductOld     100  thrpt   15   14.325 ± 0.077  ops/us
DotProduct.dotProductNew     100  thrpt   15   36.043 ± 0.678  ops/us

DotProduct.dotProductOld     128  thrpt   15   12.313 ± 0.061  ops/us
DotProduct.dotProductNew     128  thrpt   15   44.195 ± 0.218  ops/us

DotProduct.dotProductOld     207  thrpt   15    7.776 ± 0.045  ops/us
DotProduct.dotProductNew     207  thrpt   15   22.242 ± 0.155  ops/us

DotProduct.dotProductOld     256  thrpt   15    6.367 ± 0.031  ops/us
DotProduct.dotProductNew     256  thrpt   15   29.054 ± 0.108  ops/us

DotProduct.dotProductOld     300  thrpt   15    5.069 ± 0.022  ops/us
DotProduct.dotProductNew     300  thrpt   15   20.143 ± 0.327  ops/us

DotProduct.dotProductOld     512  thrpt   15    3.235 ± 0.018  ops/us
DotProduct.dotProductNew     512  thrpt   15   18.042 ± 0.132  ops/us

DotProduct.dotProductOld     702  thrpt   15    2.373 ± 0.009  ops/us
DotProduct.dotProductNew     702  thrpt   15   11.626 ± 0.026  ops/us

DotProduct.dotProductOld    1024  thrpt   15    1.615 ± 0.005  ops/us
DotProduct.dotProductNew    1024  thrpt   15   10.290 ± 0.084  ops/us
{noformat}

> simd version of VectorUtil.dotProduct
> -------------------------------------
>
>                 Key: LUCENE-9838
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9838
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Robert Muir
>            Priority: Major
>         Attachments: LUCENE-9838.patch
>
>
> Followup to LUCENE-9837
> Let's explore using JDK 16 vector API to speed this up more. It might be a hassle to try to MR-JAR/package up for users (adding commandline flags and stuff), but it gives good performance.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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