-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add config to disable FP16 optimizations on aarch64 UNIX [Build] #18744
Comments
They are compile time flags which only impose requirements on compilers, not hardware. For example, in the same file you will see a lot of references to AVX512, but today most PC hardware do not have AVX512. It doesn't cause any problem. |
This is the kind of build error I get when I build using arm-gnu 11.2 with
When I build with |
These are two different issues. It's great to see that with add_compile_options(-march=armv8.2-a+fp16) set globally, the build succeeds. The problem is the illegal instruction error instead of building problem then. We do have code to detect fp16 hardware feature in ARM. We need to fix the bug causing the illegal instruction, instead of using build options to get around it. Can you build in Debug and locate where the illegal instruction error was thrown? Thanks! |
Have you tried GCC 13? I believe our code can pass the build with GCC 13 without problems. |
https://github.com/microsoft/onnxruntime/blob/main/onnxruntime/core/mlas/lib/halfgemm.cpp#L29 |
@chenfucn Thank you for the clarification and guidance. I should have some time this week to look into this. I will update here with whatever I find. @snnn I definitely tried building with GCC 13.2, but I don't think I ran that code on the target to see if the hardware feature detection works. I'll check that as well. |
It is expected. |
This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details. |
This issue has been automatically closed due to inactivity. Please reactivate if further support is needed. |
Describe the issue
I'm unable to build for aarch64 targets that don't support FP16 instructions, due to the configuration here, which includes sources compiled with
-march=armv8.2-a+fp16
in all aarch64 builds. (The issue is specifically that the optimized methods fail to inline when combined with the rest of the source, which is compiled without+fp16
.)I have been able to work around this by patching the source to prevent
MLAS_F16VEC_INTRINSICS_SUPPORTED
from being set here. I would like to make this option directly configurable from CMake.I made a discussion post a few days ago with some context.
If there's support for this feature, I have an implementation ready to contribute.
Urgency
No response
Target platform
aarch64
Build script
CMake build targeting Linux with
-march=armv8.2-a
.Error / output
Misc. methods in
fp16_common.h
fail to inline.Visual Studio Version
No response
GCC / Compiler Version
11.2, 13.2
The text was updated successfully, but these errors were encountered: