SYCLomatic
SYCLomatic copied to clipboard
Use `sycl::bfloat16` class and functions instead of float casts.
The bfloat16 class has been non-experimental for a while now, supporting all backends: https://github.com/oneapi-src/SYCLomatic/pull/1286 However SYCLomatic appears to be not be using this, and instead just always casting to float, see e.g.https://github.com/oneapi-src/SYCLomatic/pull/1286. This seems to be a lost opportunity. For example there are native cuda bfloat16 implementations of bfloat16 math functions in DPC++ that make bfloat16 math much faster than using casts to float.
Same here: https://github.com/oneapi-src/SYCLomatic/pull/1181/files
@JackAKirk the reference PR #1286 for sentence "The bfloat16 class has been non-experimental for a while now, supporting all backends" is incorrect, could you provide the correct PR? So that we can double confirm that bfloat16 class has been non-experimental. Thanks.
@JackAKirk the reference PR #1286 for sentence "The bfloat16 class has been non-experimental for a while now, supporting all backends" is incorrect, could you provide the correct PR? So that we can double confirm that bfloat16 class has been non-experimental. Thanks.
Sorry I meant this one: https://github.com/intel/llvm/pull/6524
Note actually that I forgot bfloat16 math functions are still in the experimental namespace https://github.com/intel/llvm/pull/7567 However these bfloat16 math functions have generic support for all backends, at least via float emulation. So it might be appropriate to move them out of experimental to match the bfloat16 class. @rdeodhar what do you think?
I think it would be OK to move the math functions out of experimental. @gmlueck do you have an opinion?
I think this could be OK. I'd like to consider merging the math functions into the base extension for bfloat16, though, rather than having two separate extensions.
I think this could be OK. I'd like to consider merging the math functions into the base extension for bfloat16, though, rather than having two separate extensions.
Sounds good to me. I'd be happy to draft a PR merging the two extensions.
@gmlueck @JackAKirk So, after the bfloat16 math functions are merged into base extension, we will plan to refine the migration logic in SYCLomatic, pls remind us after your PR is merged.
@gmlueck @JackAKirk So, after the bfloat16 math functions are merged into base extension, we will plan to refine the migration logic in SYCLomatic, pls remind us after your PR is merged.
PR is here: https://github.com/intel/llvm/pull/11506
Hi, @JackAKirk. The PR (https://github.com/intel/llvm/pull/11506) is in draft status for about one year, so we need wait.
By the way, you can migrate bf16 math function by using --use-experimental-features=bfloat16_math_functions
. We have already support migration bf16 math function to sycl::ext::oneapi::experimental
math funtion.