-
Notifications
You must be signed in to change notification settings - Fork 159
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
[infra] Update protobuf to 3.20 #14535
base: master
Are you sure you want to change the base?
Conversation
This commit adds onert on-device compiler document. ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh <[email protected]>
This commit updates the Protobuf library to a newer version due to the fixes this version contains. In particular this version fixes some compilation errors being reported by GCC on Ubuntu 24.04 when the build is performed with the following flags enabled: -Werror -Wall The removed .patch file is not required any more since the js_embed binary has been removed from protobuf in the following pull request protocolbuffers/protobuf#4709 ONE-DCO-1.0-Signed-off-by: Tomasz Dolbniak <[email protected]>
|
I was able to successfully build the project for ARM32 but by examining the build tree I was not able to find anything related to Protobuf. The source files are not even downloaded during the configuration or build phase. I've used the instructions from the Did I miss anything? Could you please point me to the ARM32 CI jobs configuration so that I could compare the actual commands executed there? |
You've been building onert not compiler. Plz check https://github.com/Samsung/ONE/blob/master/docs/howto/how-to-build-compiler.md#cross-build-for-ubuntuarm32-experimental |
plz paste the error log. just "there was error" doesn't help. next time plz post an issue first describing the problem as the issue may have changes across modules. |
@tomdol , I'm confused. your problem is with onert? or compiler? |
My last comment was not the final report about the results of the cross compilation attempts. There was a statement that I couldn't find anything related to protobuf in the build tree so I thought there was no point in pasting any logs because they wouldn't prove anything. A part of the compiler was built in the process though and this is the list of directories created by cmake:
It looks like none of them depend on protobuf and that's why it wasn't downloaded nor compiled.
An example full log can be accessed here https://github.sec.samsung.net/AIP/NPU_Compiler/actions/runs/14912799/job/45144450 although it contains multiple other errors that we're trying to gradually fix. An example warning (treated as error in that workflow's configuration) is:
Those warnings have been fixed in protobuf itself but the corrected code is only available in the newer releases.
The problem occurs when trying to build the NPU Compiler on Ubuntu 24.04 with the extra compiler flags. This is what we've been trying to address and since protobuf is not a direct dependency of the NPU Compiler, I'm trying to update it to solve one of a few steps of enabling the work on that project using the current LTS. The NPU Compiler depends on the compiler part of the ONE project but since I don't know all internal dependencies in ONE and all use cases where Protobuf is involved, I've submitted this PR and hoped for some suggestions about what I should build and/or run to validate the upgrade of PB. In particular I was wondering if there are any workflows/jobs that span both the compiler and onert that could potentially be affected by the upgrade of this dependency. Thanks for the current suggestions, I will keep digging and will definitely share more detailed results as soon as I have them :) |
Q) why did you cross compile check with runtime? |
Just trying to figure out all dependencies and possible impact of the upgraded protobuf on the ONE project. I should have focused on the compiler first though, I guess. |
@tomdol |
I have tested the compiler builds and here are my results: ARM32 cross-compilationI was able to successfully build the project with the following commands:
Although I had to apply a minor change because of an error reported by the compiler:
The error comes from https://github.com/Samsung/ONE/blob/master/compiler/luci/lang/include/luci/IR/CircleNodeMixins.h#L76 and is also reported for the line number 91. It might be a compiler bug and it has already been reported by multiple users for multiple versions of GCC. In the In the end I got 2 directories under
A build with
|
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.
plz split PRs for each modules, compiler/*
what is your GCC version? |
In my case it was 10.5.0:
|
I've changed the Protobuf version to 3.20.2 because 3.20.1 contains a potential security vulnerability GHSA-8gq9-2x98-w8hf I've rebuilt everything from scratch and got the same results as yesterday. |
I assumed you are using U24.04, with other issues in npu compiler. I'm using U22.04 and got
strange... what is your Ubuntu version? |
@seanshpark - it's not determined which cross compiler should be used in Ubuntu versions newer that 20.04, and for 20.04 it's 9 or 10 (https://github.com/Samsung/ONE/blob/master/docs/howto/how-to-cross-build-runtime-for-arm.md#install-arm-cross-toolchain). In your opinion we should use some specific version of |
I have just finished testing with GCC 9 and GCC 11, both on Ubuntu 22.04. This time it compiled without the error so perhaps GCC 10.5 has some specific problem. Anyway I've removed the related change from this PR and only left the code adjustments required by the Protobuf's API change. |
OK, that's good. |
Do you mean a note about the workaround(with if-constexpr) if someone encounters this build error on GCC 10? And would it be ok to add such information in a section like "Known issues" at the end of this document? https://github.com/Samsung/ONE/blob/master/docs/howto/how-to-build-compiler.md#cross-build-for-ubuntuarm32-experimental |
I think we recommend to use g++ version >= 11 would be OK cause of the issue "something something".
yes, some explanation about g++ == 10 can give issue "something something..." |
I've added the suggested description to the docs, please have a look if this wording makes sense. |
docs/howto/how-to-build-compiler.md
Outdated
@@ -208,3 +208,31 @@ NOTE: this assumes | |||
- host and target have same directoy structure | |||
- should copy `build` folder to target or | |||
- mounting `ONE` folder with NFS on the target would be simple | |||
|
|||
## Known issues | |||
There's a potential known build error when attempting to cross-compile for ARM32 using GCC 10.5. You might encounter an error `comparison of unsigned expression in ‘< 0’ is always false [-Werror=type-limits]` reported from the `CircleNodeMixins.h` file. This is likely GCC's bug in this specific version. There's a workaround for it though - you can apply the following changes to both for loops in the `CircleNodeMixins.h`: |
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.
can you please split lines within 100 cols for not h-scrolling?
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.
Sure, already done
This commit updates the Protobuf library to a newer version due to the fixes this version contains.
In particular this version fixes some compilation errors being reported by GCC on Ubuntu 24.04
when the build is performed with the following flags enabled: -Werror -Wall
The removed .patch file is not required any more since the js_embed binary has been removed from protobuf
in the following pull request protocolbuffers/protobuf#4709
ONE-DCO-1.0-Signed-off-by: Tomasz Dolbniak [email protected]