Skip to content
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

added support for armv6-linux-guneabihf and riscv64-linux-{gnu,musl} #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cocoa-xu
Copy link

@cocoa-xu cocoa-xu commented Mar 1, 2024

Hi this PR added support for building libedgetpu for armv6-linux-guneabihf and riscv64-linux-{gnu,musl}. It allows old armv6 devices to be able to use edgetpu devices with Tensorflow Lite, and builds for newer riscv64 single board computers.

It should be able to generate libedgetpu runtime binaries as in https://github.com/cocoa-xu/libedgetpu/releases/tag/v0.1.8, which have been used in my Erlang/OTP binding for TensorFlow Lite tflite_beam for about a year.

Copy link

google-cla bot commented Mar 1, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@cocoa-xu cocoa-xu closed this Mar 5, 2024
@cocoa-xu cocoa-xu deleted the cx/more-architectures branch March 5, 2024 17:01
@Namburger
Copy link
Contributor

@cocoa-xu any reason to close this PR?
I was looking at it :)

@cocoa-xu
Copy link
Author

cocoa-xu commented Mar 5, 2024

Hi @Namburger, I closed this PR because it appeared that no one was interested in adding support for armv6 and riscv64 devices for this library, and was planning to maintain the support on my own fork.

@Namburger
Copy link
Contributor

@cocoa-xu I see, I was going to ask you for your usages/test devices. I haven't use an armv6 device in a long time and don't have one to readily test your PR.

@cocoa-xu
Copy link
Author

cocoa-xu commented Mar 5, 2024

@cocoa-xu I see, I was going to ask you for your usages

As for the usages, my motivation is that if this library can be used on armv6/riscv64 devices, it allows users to use edgetpus with old armv6 boards like RPi 0, and newer riscv64 boards like MangoPi and VisionFive 2.

And there were some attempts from users who wanted to bring back armv6 support in the pycoral repo, google-coral/pycoral#8, google-coral/edgetpu#229 (comment), google-coral/pycoral#7. But the solution was outdated and never in the official codebase.

...test devices.

As for test devices, I have a RPi 0 (armv6), Mangopi MQ Pro (riscv64) and a VisionFive 2 (riscv64).

@Namburger
Copy link
Contributor

Interesting, I didn't know RPi 0 is armv6 o_0

And there were some attempts from users who wanted to bring back armv6 support in the pycoral repo, google-coral/pycoral#8, google-coral/edgetpu#229 (comment), google-coral/pycoral#7. But the solution was outdated and never in the official codebase.

I remember all of those issues, as you could tell it has been awhile since I'm involved with coral so there is a ton of catching up to do :)

Please re-open, I'll take a look at this PR sometimes this week!

@cocoa-xu cocoa-xu restored the cx/more-architectures branch March 5, 2024 17:35
@cocoa-xu cocoa-xu reopened this Mar 5, 2024
@cocoa-xu
Copy link
Author

cocoa-xu commented Mar 5, 2024

I remember all of those issues, as you could tell it has been awhile since I'm involved with coral so there is a ton of catching up to do :)

Please re-open, I'll take a look at this PR sometimes this week!

No problem! I've re-opened this PR, and I'm happy to do further changes. :)

@Namburger Namburger self-assigned this Mar 5, 2024
@feranick
Copy link
Contributor

feranick commented Mar 7, 2024

Quick question: libedgetpu requires tflite_runtime. This has support for arm6, but does it have also support for riscv64?

@cocoa-xu
Copy link
Author

cocoa-xu commented Mar 7, 2024

Quick question: libedgetpu requires tflite_runtime. This has support for arm6, but does it have also support for riscv64?

Yes, we can use tflite on riscv64 boards!

And we also have prebuilt images for a riscv64 board, MangoPi MQ Pro. Although TensorFlow may or may not have optimisations for riscv64 CPUs, there are prebuilt livebook images (tflite is included as a dependency) available for MangoPi MQ Pro here (also see the livebook release page and the tflite_beam release page).

@cocoa-xu
Copy link
Author

cocoa-xu commented Mar 7, 2024

And below is a screenshot of tflite (as an Erlang/Elixir binding) running on a riscv64 board in livebook. I'm using mobilenet_v2_1.0_224_inat_bird_quant.tflite and the sample image as the testing neural network and input. It took 7.6 seconds to do the inference task without the coral device (as the device is not with me at the moment, but I tested it before).

Screenshot 2024-03-08 at 01 35 48

@mxchinegod
Copy link

Just eager to see progress on this as it's been 4 years without arm6 support. Thank you @cocoa-xu

@cocoa-xu
Copy link
Author

cocoa-xu commented May 31, 2024

Hi @Namburger, it seems that this PR is kinda stale, would it be easier for us all if I split this into a few smaller PRs?

@feranick
Copy link
Contributor

This is not my call to make as I have no admin access to the repo.

@cocoa-xu
Copy link
Author

This is not my call to make as I have no admin access to the repo.

Oops.. sorry for the wrong ping!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants