-
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
[Build] Trying to build on a embedded device that doesn't support BFLOAT16 #19920
Comments
Are you just able to build default CPU EP after commenting that check in CMakeLists.txt ? My guess is on ARM, we require bfloat16 support to compile some MLAS kernels which is why we have that check. Tagging @yufenglee @snnn to comment on compiler bfloat16 support requirement to compile Default CPU EP on ARM. |
Attempting now. Surprisingly there are 2 consecutive checks for the exact same thing in that CMakeLists.txt... No clue why you check for the exact same thing twice in a row. Might want to simplify that while you are at it. |
They are slightly different. "float16" vs "bfloat16" check_cxx_compiler_flag(-march=armv8.2-a+bf16 HAS_ARM64_BFLOAT16)
if(NOT HAS_ARM64_BFLOAT16)
message(FATAL_ERROR "The compiler doesn't support BFLOAT16!!!")
endif()
check_cxx_compiler_flag(-march=armv8.2-a+fp16 HAS_ARM64_FLOAT16)
if(NOT HAS_ARM64_FLOAT16)
message(FATAL_ERROR "The compiler doesn't support FLOAT16!!!")
endif() |
Would you mind upgrading your Ubuntu version from 20.04 to 22.04? |
Right now, my project requires that I remain on 20.04. If it is required that I upgrade to make this work, I can first test this out on a clone of my SD card, and then report this to my project manager and then they can decide if we need to step up. For now, I'm going to wait to see if the project finishes building. If it doesn't build I'll clone the SD card tomorrow and try stepping up then. |
Yep, it failed on MLAS. Going to start the backup process for the SD card now. It'll probably take about an hour or so. I'll probably be back tomorrow with more information if things are working in 22.04 Radxa-Ubuntu |
An update:
I almost didn't have enough room to perform the do-release-upgrade on these tiny SD-cards. Too many packages wanted upgrading that one actually ran out of space, but it was non-critical and I was able to update it afterwards once space had been cleared. Now as I said before, I'm not sure that I even need BFLOAT16s at all in my use case. I think that there should be a means to disable use of them in the build scripts for those that don't need them, and for some reason can't build with a non-IEEE format. |
Hrm... I have a problem. It seems that I ran into this error now:
|
From INetwork.hpp:
There is no other method "AddFullyConnectedLayer" in class "INetwork" so I don't know what you are trying to access here. I built the most recent armnn repository 2 days ago. It took 2 days to do. |
From the code, it looks like you have to do some work with a constant tensor before you make the fully connected layer in the first one. Then you need to make a second constant layer with the bias, and connect it as an input to the layer as well. |
Code fix for gemm.cc works. I'll post it in a second, but now conv.cc has issues:
Looks to be similar problems. Looks like you have some API problems with new ArmNN. |
Ok, the code patch to gemm.h was as follows:
Keep in mind that I am working on a ssh connection with command line input to these files and my only means of error checking is running your build script again, so my progress is slow. I don't have a proper environment set up to work on your stuff. Also, it probably could have been done better by creating an inline function to emulate the old function you were used to. Your choice how you want to ultimately do it. I'll continue plugging away unless you have a solution for me before I'm done. |
It is an armnn specific problem. Sorry I cannot provide further help. |
So, what you are saying is that they are the ones that write the ArmNN extension for Onnxruntime? |
I mean I didn't write the ArmNN extension code. I am not familiar with the code. Sorry I cannot provide help on that. |
I see. Since it is not related to the original issue, should I open a new issue for this topic to get the right developer's attention? |
An update here: It seems that the GPIO ports are not working with the update to 22.04, and the developers of the Radxa-zero have not put out a specially compiled kernel for 22.04 ubuntu yet. This makes the solution to update to 22.04 unsatisfactory for the BFLOAT16 issue, at least until they provide a new kernel. In the interim, is there a way that you could provide a means to disable BFLOAT16 support so that I can build onnxruntime without it on the Radxa-zero? |
ubantu18.04 jetson xviewer can not build onnxruntime because BFLOAT16,error |
@huyunlei , please try JetPack 6.0 Developer Preview |
@ChthonicOne , in your local branch you may revert #17031 . |
@snnn Xavier doesn't support JetPack 6 so people are still are on JetPack 5, suggest you handle this check for gracefully in the future |
Maybe you could try to upgrade your gcc version |
Facing the same issue on Voxl 2 chips. Has anyone found a solution for this? |
I have the same Issue, I think it should be autodetect by CMake like doing:
|
Please upgrade GCC, or apply local patches to remove the code. |
Describe the issue
I'm trying to build onnxruntime on a Radxa-Zero, but I've come to find out that it does not support BFLOAT16 instructions. As a result your builds fail because they require those instructions and I cannot find any way to disable support for those instructions.
I do not need support for these instructions on this device. I can make do with fp16 datatype instead if need be despite the rounding error. I already do with NCNN. The problem I have with NCNN is that the device does not properly support Vulcan at this time, and I wished to attempt to try GPU acceleration using ArmNN with ONNX.
Is there a way I can disable these instructions and build onnxruntime without them on this device? I have already built ArmNN on the device.
Urgency
I am currently blocked from attempting to use onnxruntime on the Radxa
Target platform
Radxa-zero aarch64
Build script
./build.sh --config RelWithDebInfo --build_shared_lib --parallel --compile_no_warning_as_error --skip_submodule_sync --disable_types=float8 --use_armnn --armnn_relu --armnn_bn
Error / output
debug log is as follows:
gcc type compatibility is as follows:
Visual Studio Version
n/a
GCC / Compiler Version
Ubuntu 9.4.0-1ubuntu1~20.04.2
The text was updated successfully, but these errors were encountered: