-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8317763: Follow-up to AVX512 intrinsics for Arrays.sort() PR #16124
Conversation
👋 Welcome back vamsi-parasa! A progress list of the required criteria for merging this PR into |
@vamsi-parasa The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
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.
LGTM
|
@vamsi-parasa 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 36 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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@jatin-bhateja, @vnkozlov, @magicus, @sviswa7) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
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.
What is change for "Addressing the build failure due to a bug in GCC 12"?
Forgive me, I might be missing something very obvious, but is there any particular reason to entirely disable the SIMD accelerated sort on Zen 4 rather than having an alternate code path for Zen 4 where it has the |
In #14227, you inadvertently added an extra space at line 230 in make/modules/java.base/Lib.gmk Can you please revert it here? |
Hi @vamsi-parasa , Methods Is ok that Should we add @ForceInline to |
Good question. Someone familiar with this Java code should answer. Note, @forceinline annotation is used by C2 JIT compiler when it decide to inline. One criteria is the bytecode size (we don't want inline huge method into another compilation). Default value is 35. With @forceinline the size will be 1 - most likely guarantee inlining. |
Also @forceinline in these changes only works for case when new intrinsics are not used. |
@vnkozlov Thank you for explanation, I will benchmark cases with and without @forceinline and provide results very soon. |
@vnkozlov |
Hi @vamsi-parasa, Both methods mixedInsertionSort and insertionSort are covered by intrinsics. To have clear picture could you please run benchmarking to compare both cases: see changes |
I don't think you're missing anything. This should be done, rather than disabling the intrinsic. |
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.
Build changes look good. Thanks for fixing this!
/label +build
/reviewers 2
@magicus |
@vamsi-parasa |
@iaroslavski |
@vamsi-parasa, and no profit with @forceinline on insertionSort and mixedInsertionSort. |
@iaroslavski, Please see the change reverted. |
Thanks a lot Vladimir. RFE filed: https://bugs.openjdk.org/browse/JDK-8317976. |
I started testing for v04 assuming if you make make file changes they will be cosmetic. |
Proposed patch has one disadvantage: there's no way to override ergonomics decisions on AMD CPUs and forcibly enable the intrinsic without rebuilding the JVM. For many other intrinsics there are flags which enable finer grained control over JVM behavior (e.g., It makes sense to let |
May be it could be done as part of https://bugs.openjdk.org/browse/JDK-8317976. |
It is not easy to do. You need to make sure that you not enable intrinsic by Note, we are not introducing regression to AMD with these changes - code is reverted back to before previous changes 14227. We have some time to propose patch. |
FTR I'm perfectly fine with handling it separately.
There's |
At least on Saphire Rapids the emulation suggested here only imposes a 6% penalty for
Not super familiar with the JDK testing infrastructure I'm afraid, but FWIW I dropped
Intel(R) Xeon(R) Platinum 8488C - Current
Intel(R) Xeon(R) Platinum 8488C - Emulated
Intel(R) Xeon(R) Platinum 8488C - Baseline
AMD EPYC 9R14 - Emulated
AMD EPYC 9R14 - Baseline
|
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.
My tier1-3,xcomp testing for v04 passed. I am integrating these changes.
Lets continue discussion about changes for AMD in https://bugs.openjdk.org/browse/JDK-8317976.
Thank you, Vladimir! |
/integrate |
@vamsi-parasa |
/sponsor |
Going to push as commit 2edf9c3.
Your commit was automatically rebased without conflicts. |
@vnkozlov @vamsi-parasa Pushed as commit 2edf9c3. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Thanks for testing this out, this seems a good solution to explore. Is there is a way to |
The answer for slow performance of AVX512 version of x86-simd-sort on Zen 4 is most probably explained in AMD manuals which could be found at: https://www.amd.com/en/search/documentation/hub.html#q=software%20optimization%20guide%20for%20the%20amd%20microarchitecture&f-amd_document_type=Software%20Optimization%20Guides Software Optimization Guide for the AMD Zen4 Microarchitecture has following remark in "2.11.2 Code recommendations" chapter:
Software Optimization Guide for the AMD Zen5 Microarchitecture doesn't have any remark about COMPRESS instructions. Could you add some code that disables the AVX512 version on Zen4, but keeps it enabled on Zen5 and future Zen architectures? |
The goal of this PR is to address the follow-up comments to the SIMD accelerated sort PR (#14227) which implemented AVX512 intrinsics for Arrays.sort() methods.
The proposed changes are:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16124/head:pull/16124
$ git checkout pull/16124
Update a local copy of the PR:
$ git checkout pull/16124
$ git pull https://git.openjdk.org/jdk.git pull/16124/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 16124
View PR using the GUI difftool:
$ git pr show -t 16124
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16124.diff
Webrev
Link to Webrev Comment