-
Notifications
You must be signed in to change notification settings - Fork 788
[SYCL] Add aspect for bfloat16 #5720
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
I do not see the |
There is actually an extension, but bf16 aspect there is known under different name. @AidanBeltonS can these names be united? |
Yes, ideally we would unite the two aspects. I think this has been discussed a bit before: #5645 (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.
Other than the comments, the change LGTM.
sycl/include/CL/sycl/aspects.hpp
Outdated
@@ -49,6 +49,7 @@ enum class aspect { | |||
ext_oneapi_native_assert = 31, | |||
host_debuggable = 32, | |||
ext_intel_gpu_hw_threads_per_eu = 33, | |||
bf16 = 34 |
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.
To reduce changes in future:
bf16 = 34 | |
bf16 = 34, |
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.
Done
@@ -4288,6 +4288,7 @@ _ZNK2cl4sycl6device8get_infoILNS0_4info6deviceE65808EEENS3_12param_traitsIS4_XT_ | |||
_ZNK2cl4sycl6device8get_infoILNS0_4info6deviceE65809EEENS3_12param_traitsIS4_XT_EE11return_typeEv | |||
_ZNK2cl4sycl6device8get_infoILNS0_4info6deviceE65810EEENS3_12param_traitsIS4_XT_EE11return_typeEv | |||
_ZNK2cl4sycl6device8get_infoILNS0_4info6deviceE69632EEENS3_12param_traitsIS4_XT_EE11return_typeEv | |||
_ZNK2cl4sycl6device8get_infoILNS0_4info6deviceE73728EEENS3_12param_traitsIS4_XT_EE11return_typeEv |
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.
Probably, a PATCH version in CMakeLists should be incremented to denote a non-breaking change. @alexbatashev , please, correct me if I'm wrong.
Please, refer to https://github.com/intel/llvm/blob/sycl/sycl/doc/developer/ABIPolicyGuide.md#abi-versioning-policy.
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 am not sure if the PATCH version should be updated as in the abi-versioning-policy docs it states. MAJOR, MINOR, and PATCH versions are not updated between releases.
@@ -1,4 +1,4 @@ | |||
= SYCL_INTEL_bf16_conversion | |||
= SYCL_ONEAPI_bfloat16 |
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 think your branch must be out-of-date because these specification file names are now all lower case. You should merge the base and resolve conflicts (or maybe it will just be easier to start a new PR).
The name of the file should stay in sync with the feature-test macro. Since you are renaming the feature-test macro to "SYCL_EXT_ONEAPI_BFLOAT16_CONVERSION", the file name should be "sycl_ext_oneapi_bfloat16_conversion.asciidoc". The name of the extension (on line 1 of this file) should also be lowercase: "sycl_ext_oneapi_bfloat16_conversion".
However, maybe you are preparing this extension to encompass all bfloat16 features, rather than just conversion? As I mentioned in #5645, I think it would be better to have a single bloat16 extension like this. In that case, the name of the feature-test macro should be "SYCL_EXT_ONEAPI_BFLOAT16", the name of the extension should be "sycl_ext_oneapi_bfloat16", and the name of the file should be "sycl_ext_oneapi_bfloat16.asciidoc".
Finally, the header file "include/CL/sycl/feature_test.hpp" should also be updated to define the new feature-test macro, and you should remove the definition of the old feature-test macro.
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.
No changes to the extension are in this PR anymore. The extension was updated by #5393.
So the new aspect is inline with the the extension
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.
Thanks. I think this looks good.
@smaslov-intel, do you want a chance to review this from the implementation point of view?
sycl/include/CL/sycl/detail/pi.h
Outdated
@@ -317,6 +317,7 @@ typedef enum { | |||
PI_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES = 0x11000, | |||
PI_DEVICE_INFO_GPU_HW_THREADS_PER_EU = 0x10112, | |||
PI_DEVICE_INFO_BACKEND_VERSION = 0x10113, | |||
PI_EXT_ONEAPI_DEVICE_INFO_BFLOAT16 = 0x12000, |
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.
Let's not create more than necessary gaps in numbering. Please use 0x1FFFF
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.
Okay thanks. I have updated the value
Why don't you add a test for real "bfloat16" support, if the aspect is reported? |
Could you clarify what you mean by this? Finding out if the device supports bfloat16 is backend dependent and involves calling native CUDA functions. |
Can you also add a test that really uses bfloat16 after the aspect check returns true? |
Yes, I have made a change to |
/verify with intel/llvm-test-suite#888 |
@AidanBeltonS, can you fix conflicts please? |
I have resolved all conflicts. |
This PR adds the bf16 aspect to aspects.cpp test. Depends on: intel/llvm#5720
intel#5720 added a new specialization of get_info for info::device::ext_oneapi_bfloat16 but no Windows symbol was added to the dump file. This commit adds the missing symbol. Signed-off-by: Larsen, Steffen <[email protected]>
#5720 added a new specialization of get_info for info::device::ext_oneapi_bfloat16 but no Windows symbol was added to the dump file. This commit adds the missing symbol. Signed-off-by: Larsen, Steffen <[email protected]>
This PR adds the bf16 aspect to aspects.cpp test. Depends on: intel#5720
This PR adds a new aspect
ext_oneapi_bfloat16
to allow a runtime check for if the device supports the bfloat16 floating point type.Only the CUDA implementation for checking if the device supports this aspect is added.
Updated test: intel/llvm-test-suite#888