-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8370922: Template Framework Library: Float16 type and operations #28095
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
8370922: Template Framework Library: Float16 type and operations #28095
Conversation
|
👋 Welcome back epeter! A progress list of the required criteria for merging this PR into |
|
@eme64 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 23 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 |
Webrevs
|
|
Can someone please review this? |
galderz
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.
Looks good, just a small question about the name of the test
|
|
||
| import compiler.lib.verify.*; | ||
|
|
||
| public class TestVerifyIncubatorVector { |
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.
I have doubts about leaving the "Incubator" name in the test class name as it's temporary. Are you going to refactor the class name when API is not incubator any more? Maybe TestVerifyVectorAPI instead?
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.
Yes, I might refactor it away actually. We could also remove the special handling in verify for foreign classes. Currently I have to do the hack with reflection. I'd like to get rid of that.
This test is here for the cases where we need to include foreign, and because we need @modules jdk.incubator.vector. There is the other test that already exists and does not need this.
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.
@galderz I now renamed it to TestVerifyFloat16.java, I think it is better, even if I eventually have to refactor the internals of the test we don't have to rename the test itself :)
benoitmaillard
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.
Looks good to me, nice work! I only have one question.
|
|
||
| // Generate expressions with any scalar numeric types. | ||
| for (CodeGenerationDataNameType type : SCALAR_NUMERIC_TYPES) { | ||
| for (int i = 0; i < 2; i++) { |
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 does this loop do? And why do we have only 2 iterations here, but 10 for PRIMITIVE_TYPES?
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.
It Generate[s] expressions with any scalar numeric types. ;)
The question is just how many per (output) type. Here we do 2 for each type.
The 2 vs 10 is quite arbitrary. I did not want to increase the runtime of the test too much. For now, focusing more on the primitive types an operations is probably good, Float16 is still rather niche. But we can change the balance in the future.
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.
Ah yes, and note: even if we start with a type other than Float16 as the output, we can still have Float16 components in the expression, via conversion for example. We can do float -> Float16 -> float for example.
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.
I meant to ask specificially about the inner loop sorry :)
The explanation makes sense, thanks for explaining a little more. Perhaps we could have a comment for that, or have constants with more explicit names for 2 and 10?
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.
@benoitmaillard I added some extra comments. What do you think, is it better now?
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.
Great, thank you!
|
@eme64 this pull request can not be integrated into git checkout JDK-8370922-TemplateFramework-Library-Float16
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
galderz
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.
@eme64 I have one additional question. How did you test this? Did you have HF hardware access or did you emulate it? In a recent chat with @benoitmaillard, I think he mentioned about using QEMU to emulate and do some testing.
I ran it through out internal testing machines. Some of them do have specific hardware support for Float16 operations :) |
|
@eme64 Thanks for explanation, all good :) |
|
@benoitmaillard @galderz Thanks for the reviews and approvals! Now we'll have to get a reviewer rubber-stamp this :) |
TobiHartmann
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.
Looks good to me.
|
@benoitmaillard @galderz @TobiHartmann Thanks for the reviews! /integrate |
|
Going to push as commit 89e7751.
Your commit was automatically rebased without conflicts. |
We should test
Float16with Template Framework Tests. For this, I'm now implementing:Float16Typethat representsFloat16. ExtendOperations.javawithFloat16operations.Verify.java: add verification forFloat16, and corresponding tests inTestVerifyIncubatorVector.java. We could have done this separately, but it is not much code and completes the pipeline from code generation through execution and finally result verification in the following two tests.Float16toExpressionFuzzer.javaandTestExpressions.java.Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28095/head:pull/28095$ git checkout pull/28095Update a local copy of the PR:
$ git checkout pull/28095$ git pull https://git.openjdk.org/jdk.git pull/28095/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28095View PR using the GUI difftool:
$ git pr show -t 28095Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28095.diff
Using Webrev
Link to Webrev Comment