-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
[Hardware][PowerPC] Fix fp16 compilation error for Power in cpu attention backend and bump oneDNN version #28535
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
base: main
Are you sure you want to change the base?
[Hardware][PowerPC] Fix fp16 compilation error for Power in cpu attention backend and bump oneDNN version #28535
Conversation
Signed-off-by: Akash Kaothalkar <[email protected]>
Signed-off-by: Akash Kaothalkar <[email protected]>
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.
Code Review
This pull request aims to fix compilation errors on the PowerPC architecture. It correctly bumps the oneDNN version to v3.10, which includes a fix for Power9 systems. It also adds a preprocessor guard to disable an fp16 template specialization that is unsupported on PowerPC. While the fix for cpu_attn_impl.hpp is correct for PowerPC, it appears to be incomplete as the s390x architecture has similar limitations regarding fp16 vector support and will likely still fail to compile. I've added a comment with a suggested fix. Overall, the changes are in the right direction to improve cross-architecture compatibility.
| using vec_t = vec_op::BF16Vec16; | ||
| }; | ||
|
|
||
| #if !defined(__powerpc__) |
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.
The fix is incomplete. The s390x architecture also lacks fp16 vector support (vec_op::FP16Vec16) and will fail to compile this specialization, similar to PowerPC. The preprocessor guard should be extended to also cover s390x. A similar guard #if defined(__powerpc64__) || defined(__s390x__) is used in csrc/cpu/dnnl_kernels.cpp, which indicates s390x has similar characteristics.
#if !defined(__powerpc__) && !defined(__s390x__)
|
If fp16 is not supported on Power, should we add a check in |
|
Hi @bigPYJ1151, Thanks for the feedback. You are right, as currently for Power with dtype="float16" we do not get a proper error message. If possible, I would take this up in a seperate follow up PR as this could require some discussion. Currently the tip is broken for Power due to the compilation failure. |
|
Hi @fadara01 this PR will upgrade oneDNN to 3.10. Would you please help to check the compatibility of ACL? As I saw the 3.10 minimum requires ACL 52.4.0 |
fadara01
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.
Thanks for spotting this @bigPYJ1151 - current version of ACL is indeed not compatible with oneDNN v3.10
@Akashcodes732 could you please update ACL version here to v52.6.0 which should be compatible with oneDNN v3.10
Signed-off-by: Akash Kaothalkar <[email protected]>
|
Hi @bigPYJ1151 @fadara01 , I have updated the ACL version |
fadara01
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.
LGTM
Purpose
Fix Power compilation failure: PR #27954
refactored the attention backend for CPU, but the build fails on Power due to the use of fp16, which is not supported on this architecture. This PR addresses that issue (also mentioned in my review on the original PR).
Update oneDNN to v3.10: The oneDNN PR uxlfoundation/oneDNN#4002
— included in v3.10 — fixes a compilation failure on Power9 systems. Bumping the version here resolves that issue as well.
cc: @bigPYJ1151