-
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
arm64: force -mcpu to be valid #21117
base: main
Are you sure you want to change the base?
Conversation
ff79574
to
69d5aa7
Compare
According to https://community.arm.com/arm-community-blogs/b/tools-software-ides-blog/posts/compiler-flags-across-architectures-march-mtune-and-mcpu, we should not need to use both "-march" and "-mcpu" |
@snnn according to your article we should avoid -march and only use -mcpu. What would you say about only keeping -mcpu in this patch ? This would also fix my issue |
Signed-off-by: Clément Péron <[email protected]>
69d5aa7
to
4adfe05
Compare
Hi, @clementperon, I have met this #23267 / v1.19.2 for Jetpack 5.1.4 L4T 35.6 Is this patch ok to build without "BFLOAT16" issue? EDIT: I modified
EDIT2: Do I need extra flags in build command?
EDIT3: difference between v1.19.2 and my onnx: 21117_for_v1.19.2.patch |
@lida2003 , would you please consider upgrading your jetpack to 6.0(which has Ubuntu 22.04 and GCC 11)? |
Even ubuntu20.04 itself will reach EOL in a few months. Sorry we do not have bandwidth to maintain a build system for ubuntu20.04 and GCC 9. You may fork this repo and patch it in your way. |
@liqunfu , I am not familiar with mlas code. If you would like to take the changes, please help review the PR. Otherwise I will close it later. |
@snnn That's OK. Currently the treads end up here, but the patch is not working. Is there any flags or other links/help available for me? EDIT: what's the root cause for this? in #21099 , it seems "Some ARCH64 machine doesn't have support for dotprod or bf16". Is this mean that it's gcc issue on the current ubuntu 20.04 gcc 9.4.0? Which version has fixed this, any link? Or is there an alternative way to get around gcc 9.4.0 and get onnx build?
EDIT2: In #22837 #19760, still some gcc version & bf16 issue. If onnx is tested bf16 with gcc 11,12 and 13, is it possible to remove bf16 when gcc version is less than 11 ? |
You may search the build flag in https://github.com/microsoft/onnxruntime/blame/main/cmake/onnxruntime_mlas.cmake |
I believe it was added in #14538 |
Description
When building with a cross-toolchain some CXX_FLAGS could be set to a specific CPU.
This leads to a CPU not compatible with some specific functions compiles with ARCH v8.2+bf16
Error is :
cc1: error: switch '-mcpu=XXXX' conflicts with '-march=armv8.2-a+i8mm' switch
Motivation and Context
As these functions are dispatched at runtime and as there is no -mno-cpu, force the -mcpu to be valid by forcing it to a valid combination of -march and -mcpu