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

Clarify the denorm support for FP16 (may apply to FP32 too) #1288

Open
wanghqc opened this issue Dec 2, 2024 · 0 comments
Open

Clarify the denorm support for FP16 (may apply to FP32 too) #1288

wanghqc opened this issue Dec 2, 2024 · 0 comments

Comments

@wanghqc
Copy link

wanghqc commented Dec 2, 2024

Moved this topic from Gitlab to Github:

Original post on this topic at Gitlab:

Create this issue based on the discussion on denorm of vstore_half in our weekly meeting. The current OpenCL spec allows FP16/FP32 denorm support to be specified via the clGetDeviceInfo call using CL_DEVICE_HALF_FP_CONFIG/CL_DEVICE_SINGLE_FP_CONFIG. A bit field for CL_FP_DENORM is used to tell whether denorms are supported for FP32/FP16. We need to specify what "support" really means: denorm can be from arithmetic or conversion. One discrepancy is the function like vstore_half: its conversion from float to half requires denorm to be preserved, regardless of the device's denorm handling capability.
We can add words in spec to say conversion is supported regardless the device's denorm capability.
We can also differentiate conversion vs arithmetic denorm capability, which will require new tests and sounds too much

Copy the reply from Ben:

We should be a little careful here, since I think there are multiple types of "conversions":

  1. There are the vstore_half and vload_half functions, which involve float <-> half conversions, and are currently specified to NOT allow flushing denorms to zero.
  1. There are the explicit conversion functions, e.g. convert_float. I think these may flush denorms to zero? Maybe this is an area we should improve.
  1. There are implicit conversions and explicit casts. Similar to (2), but without an explicit function call.
  1. There are conversion rules for images. These are allowed to flush denorms to zero, at least for float -> half and float <-> float, though I'm not sure about half -> float.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant