Skip to content
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

Enable fp16 in math bruteforce #1433

Closed
wants to merge 1 commit into from

Conversation

gwawiork
Copy link
Contributor

@gwawiork gwawiork commented Jun 7, 2022

This is almost the duplicate of #529 after rebase.

@gwawiork gwawiork force-pushed the fp16_rebase_github_v2 branch 4 times, most recently from ea57512 to 28bf69a Compare June 8, 2022 08:18
@bashbaug bashbaug mentioned this pull request Nov 22, 2022
3 tasks
@bashbaug bashbaug added mobica-backlog Issue approved by WG for Mobica to work on mobica-triage Issue proposed for addition to Mobica's backlog (needs WG approval) and removed mobica-backlog Issue approved by WG for Mobica to work on labels Feb 21, 2023
@@ -278,7 +313,7 @@ const Func functionList[] = {
ENTRY(minmag, 0.0f, 0.0f, FTZ_OFF, binaryF),
ENTRY(modf, 0.0f, 0.0f, FTZ_OFF, unaryF_two_results),
ENTRY(nan, 0.0f, 0.0f, FTZ_OFF, unaryF_u),
ENTRY(nextafter, 0.0f, 0.0f, FTZ_OFF, binaryF),
ENTRY(nextafter, 0.0f, 0.0f, FTZ_OFF, binaryF_nextafter),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all the ENTRY items here should be updated to use the correct ULPs as defined by the spec - https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_Ext.html#cl_khr_fp16-relative-error-as-ulps

This is the same concerns as when I reviewed the previous PR #529 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've corrected ULP values for half test cases. I have two additional remarks which popped up in the process:

  1. There are couple of tests focused on kernel procedures already covered by test_relationals, there are also other kernel procedures which should land in test_relationals for consistency, list below:
   isequal
   isfinite
   isgreater
   isgreaterequa
   isinf
   isless
   islessequal
   islessgreater
   isnan
   isnormal
   isnotequal
   isordered
   isunordered

Should we raise a new issue for that task ?

  1. It looks like current progress of test_bruteforce (new PR #1681) does not take into account difference in processing for embedded profile for cl_khr_fp16. Should it be covered by new issue or continuation of development for PR added cl_half support for test_bruteforce #1681 ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest documenting both these points as their own issues to keep the scope of changes in #1681 manageable

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, I've created issues #1684 and #1685. Since we have already PR #1681 should we close this PR to avoid future confusion ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gwawiork Are you okay if we close this PR in favour of #1681 so that reviwers don't review the wrong PR accidentally? Closing won't delete the git branch, and we can always reopen the PR later for whatever reason if we had to.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EwanC can we assume silence means consent ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, let's close this. We can always reopen it if closing the PR was an issue for whatever reason.

@@ -0,0 +1,879 @@
//
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the newly added files in this commit are based on older versions of the float/double counterparts. There have been many improvements to the original files since this PR was opened, especially regarding kernel creation, use of cl wrapper objects, and removal of gotos. It would be good to base the new _half.cpp files on a newer version of the _float.cpp/_double.cpp files, which would avoid a lot of (bad) code duplication.

(we might wish to wait for #1634 to land before working on this).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@svenvh sounds good. It seems like there is no other option than align to mentioned modernization - after pulling and solving conflicts this branch doesn't build successfully anymore. I am working on adaptation right now so if you have any suggestions I will appreciate it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably start afresh from the latest main branch.

There are many things you should still be able to reuse from this PR, such as the plumbing in main.cpp, tables with special values and the reference result computations.

Kernel code generation should be much easier now: it should only be a matter of adding a half ParameterType to common.h and common.cpp.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added adaptation for #1634 in new PR #1681.

@neiltrevett neiltrevett added mobica-backlog Issue approved by WG for Mobica to work on and removed mobica-triage Issue proposed for addition to Mobica's backlog (needs WG approval) labels Mar 7, 2023
@EwanC
Copy link
Contributor

EwanC commented Nov 9, 2023

Closing this PR as it's superseded by #1681 and not been worked on in over a year. If this is a problem, feel free to reopen the PR.

@EwanC EwanC closed this Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobica-backlog Issue approved by WG for Mobica to work on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants