-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8272861: Add a micro benchmark for vector api #5234
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
Conversation
|
👋 Welcome back sviswanathan! A progress list of the required criteria for merging this PR into |
Webrevs
|
| scalar_black_scholes_kernel(0); | ||
| } | ||
|
|
||
| static final VectorSpecies<Float> fsp = FloatVector.SPECIES_256; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use a more portable way instead of fixed size SPECIES_256?
shipilev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some benchmark comments.
| } | ||
|
|
||
| @Benchmark | ||
| public void scalar_black_scholes(Blackhole bh) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So there is a Blackhole argument here, but what is actually blackholed? AFAICS, stores to call and put are roughly okay to avoid dead-code elimination on these paths.
| static float Y = 0.2316419f; | ||
| static float A1 = 0.31938153f; | ||
| static float A2 = -0.356563782f; | ||
| static float A3 = 1.781477937f; | ||
| static float A4 = -1.821255978f; | ||
| static float A5 = 1.330274429f; | ||
| static float PI = (float)Math.PI; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Want to make these static final?
|
@PaulSandoz @ericcaspole Looking forward to your review and approval for this vector api micro benchmark. |
PaulSandoz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, just one minor comment (no need for another review), thanks for contributing this.
|
|
||
|
|
||
| float randFloat(float low, float high) { | ||
| float val = rand.nextFloat()/Float.MAX_VALUE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nextFloat returns a PSR between 0 and 1., so no need to divide by Float.MAX_VALUE ?
|
@sviswa7 This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 46 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
|
/integrate |
|
Going to push as commit 5aaa20f.
Your commit was automatically rebased without conflicts. |
This pull request adds a micro benchmark for Vector API.
The Black Scholes algorithm is implemented with and without Vector API.
We see about ~6x gain with Vector API for this micro benchmark using 256 bit vectors.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5234/head:pull/5234$ git checkout pull/5234Update a local copy of the PR:
$ git checkout pull/5234$ git pull https://git.openjdk.java.net/jdk pull/5234/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 5234View PR using the GUI difftool:
$ git pr show -t 5234Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5234.diff