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

Deprecate Coral TPU suggestion from documentation as upstream dependencies are abandoned #10056

Closed
apalrd opened this issue Feb 26, 2024 · 9 comments
Labels
enhancement New feature or request

Comments

@apalrd
Copy link

apalrd commented Feb 26, 2024

As Coral.ai has been abandoned by Google, stop recommending people purchase the hardware in the documentation.

Specifically:

  • The GASKET driver (required for PCIe devices) in the out-of-tree Coral repository does not support Linux >= 6.4. A community patch can be compiled to work around this for now, but without support from Google it's unlikely that this will continue long term. Additionally, the instructions point to the outdated DKMS modules which do not compile, and this will confuse users who need PCIe support.
  • The Linux kernel team removed the GASKET driver from kernel staging as the Google developers have not kept it up to date or made any of the changes required to merge it into the kernel, and
  • tflite-runtime upstream has not been updated to support Coral patches in years, and as such, recent versions now cause segmentation faults with even when built from source. Frigate can of course stick to old versions, but relying on an outdated version indefinitely is not a sustainable development practice.
  • There are other detectors available in Frigate which also work well, so Coral is not the only solution for hardware accelerated detection.
@apalrd apalrd added the enhancement New feature or request label Feb 26, 2024
@rocket59
Copy link

Could you give some alternatives at a similar price point?

@hipitihop
Copy link

@apalrd Does this apply to the USB based TPU also ?

@blakeblackshear
Copy link
Owner

I would appreciate any links you can provide for these claims.

A significant number of Frigate users are using a Coral device, so we will support it for as long as possible. This includes running older versions of tflite-runtime as necessary. While I do see the gasket driver issues and find the lack of updates concerning, I have yet to see any official statement that the devices have been abandoned. If you have seen this, please provide a link or source for that claim.

Also, the gasket driver issues do not apply to the USB Coral which does not depend on the Gasket driver.

Is there any public discussion to document "Google developers have not kept it up to date or made any of the changes required to merge it into the kernel"?

From my vantage point, it looks like in the future many devices will have support for accelerated AI detection via the processor or an onboard NPU. This project will evolve and adapt based on what happens.

@apalrd
Copy link
Author

apalrd commented Feb 27, 2024

I'm not suggesting we remove support, only suggesting we stop recommending new users to buy the hardware, because of the evidence that the hardware vendor has abandoned their drivers for some time.

I've been trying to get in contact with anyone at coral.ai to get the community-produced Gasket fixes into their Deb repo (which Frigate relies on for pycoral, but users of PCIe devices also rely on for the DKMS module). It looks like the users who used to respond to Github issues in the edgetpu repos no longer work there (their Google emails bounce with 'Address not found').

The InRelease file on the deb repo was last updated on 2022/03/01 (yes, 2 years ago). This file contains the signatures of lower-level files and is GPG signed when any update is made to the repo, so no packages have been pushed in at least 2 years. This repository is in the official coral.ai instructions.

We can find the versions of packages distributed in this repo in the Packages file. Frigate uses python3-tflite-runtime and python3-pycoral directly from this repo, so we are relying on these libraries for edgetpu but also for the CPU detector. The current tflite version in that repo is 2.5.0, while the current version in PyPi is 2.14.0. 2.5.0 was released in PyPi on 2021/10/11. So Frigate is currently using a version of tflite that is pinned at October 2021, including for the CPU detector. To make it even worse, this package depends on Python << 3.10, and no wheels have been built + they do not compile for more recent Python versions, so this sticks Frigate to Python 3.9. Python 3.9 has already reached end of full support, but is still receiving security updates for 18 months. So we have 18 months to figure out what to do with edgetpu.

While it should be possible to build pycoral from source to get around the Python 3.9 / ancient tflite issue, the code has not been updated and this results in a segmentation fault. @feranick was able to fork all of the repos involved and update them, to support more recent versions of tflite and therefore Python - see google-coral/edgetpu#812 for details on that. He has an open PR to the Google repo, but it's gone unanswered for some time now, and it appears that they have never merged a PR to any of their google-coral Github repositories ever (as far as I can see). They have been pinging the previous maintainers with no luck in getting a response. The TensorFlow team treated the issue seriously, but it looks like they've also been unable to get in contact with the google-coral repository owners in the past month (despite being the 'same' company).

Also due to their bad stewardship of the repos, they created a Python package that isn't in PyPi (pycoral), distributed it via deb packages, and there is now a 'real' pycoral in PyPi which is completely different. Oops.

As for the Gasket driver, it was originally in kernel staging, but in 2021 was pushed out by Greg KH due to his view of it being 'abandoned', as Google never pushed any of the fixes required to get it to merge and it stopped compiling in staging. After that, Google maintained it on github as an out of tree module, which has received only minimal updates since 2021. Notably, two contributors (not Google affiliated) were able to resolve build issues on Linux >=6.4 and specific backported kernel compile errors, and these PRs were merged, but the resulting code was never released as a deb package update. It has been 6 months since the fix to Linux >= 6.4 was merged by the community and the deb packages have not been updated, so all of the installation instructions on Coral's site no longer work. Now that Ubuntu has shipped kernel 6.5, this has gotten a lot more attention, and the gasket / edgetpu Github repos are flooded with 'Gasket fails to compile' issues from users. Proxmox tracks Ubuntu kernels, so their users are affected as well. I wrote a Proxmox+Frigate tutorial including the m.2 TPU and I'm getting emails about it not working as well.

Again, I'm not suggesting we drop code to support edgetpu, only remove it's recommendation from the documentation. We are slowly getting more alternatives (like OpenVino and TensorRT) to the Coral TPU, so new users have options.

@feranick
Copy link

feranick commented Feb 27, 2024 via email

@stakach
Copy link

stakach commented Feb 28, 2024

I think everyone using frigate wants to see Google fix coral.ai support @pkgoogle
google-coral/libedgetpu#60

@stakach
Copy link

stakach commented Feb 29, 2024

Looks like Google is getting back on top of things aka coral support which is nice

@NickM-27
Copy link
Collaborator

Yes, good to see this got the attention it deserves.

In general I think more official statements from Google or specific evidence of Google dropping support (rather than neglect) is needed to consider the google coral deprecated and remove the recommendation from the docs.

For now it seems that the original devs weren't on the project and new devs needed to be given notice. Hopefully this continues and things are kept up to date. This issue can be reopened in the future if things change.

@NickM-27 NickM-27 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 29, 2024
@feranick
Copy link

feranick commented Mar 1, 2024

For what is worth, updated libcoral and pycoral libraries are coming as well, i am working to get them merged to the stable repo by the time TF 2.16.0 reaches stable. Not sure if this software uses them, but in case...

Details here:

google-coral/pycoral#137 (comment)

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

No branches or pull requests

7 participants