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

Raspberry Pi 5 self-hosted CI #8828

Merged
merged 106 commits into from
Apr 17, 2024
Merged

Raspberry Pi 5 self-hosted CI #8828

merged 106 commits into from
Apr 17, 2024

Conversation

lakshanthad
Copy link
Member

@lakshanthad lakshanthad commented Mar 10, 2024

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Expand CI testing to include Raspberry Pi 5 on Bookworm OS.

πŸ“Š Key Changes

  • Added rpi5-bookworm to the operating systems (OS) tested in Continuous Integration (CI) workflows.
  • Included conditional steps to skip certain setup actions for rpi5-bookworm.

🎯 Purpose & Impact

  • Testing Expansion: By incorporating Raspberry Pi 5 running Bookworm OS into CI tests, the goal is to ensure compatibility and performance on this platform. πŸ₯§πŸ“ˆ
  • Broader Support: This update aims to widen the user base and improve the experience for developers using Raspberry Pi 5 for their projects. πŸŒπŸ‘¨β€πŸ’»
  • Conditional Workflow Modifications: The introduction of conditions to skip certain actions for rpi5-bookworm helps in tailoring the setup process specifically for this platform, optimizing the workflow. βš™οΈπŸ› οΈ

This move could significantly impact users working on Raspberry Pi 5 by providing better-supported tools and libraries, enhancing development efficiency and product reliability on this popular platform.

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Enhancements for Raspberry Pi compatibility and model export adjustments.

πŸ“Š Key Changes

  • πŸ“ Added Raspberry Pi support in the CI workflow to include tests and checks specific for Raspberry Pi platforms.
  • πŸ”„ Updated pyproject.toml to include a new dependency flatbuffers for better compatibility with TensorFlow packages.
  • πŸš€ Extended the AI model export capabilities to exclude CoreML format on Raspberry Pi and refine conditions for other platforms.
  • πŸ› οΈ Adjusted backend requirements to handle specific numpy version issues on Raspberry Pi and NVIDIA Jetson during ONNX Runtime inference.
  • πŸŒ‰ Modified benchmarking logic to accommodate platform-specific constraints regarding model export formats.

🎯 Purpose & Impact

  • 🏁 Enable Raspberry Pi users to integrate and test Ultralytics AI models, expanding the user base and use-case scenarios.
  • πŸ› Resolve compatibility issues with TensorFlow-related packages, ensuring smoother operations and deployments.
  • 🎨 Refine export functionality across various formats, ensuring broader model applicability and user flexibility.
  • 🎲 Ensure accurate model benchmarking across a wider range of platforms, improving user experience and model reliability.

Copy link

codecov bot commented Mar 10, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 76.00%. Comparing base (c54b013) to head (4ed8db7).

❗ Current head 4ed8db7 differs from pull request most recent head ca40934. Consider uploading reports for the commit ca40934 to get more accurate results

Files Patch % Lines
ultralytics/nn/autobackend.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8828      +/-   ##
==========================================
- Coverage   76.00%   76.00%   -0.01%     
==========================================
  Files         121      121              
  Lines       15339    15343       +4     
==========================================
+ Hits        11658    11661       +3     
- Misses       3681     3682       +1     
Flag Coverage Ξ”
Benchmarks 36.02% <85.71%> (+0.01%) ⬆️
GPU 37.91% <14.28%> (-0.03%) ⬇️
Tests 71.28% <42.85%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@lakshanthad lakshanthad changed the title Add local CI for RPi5 bookworm Add self-hosted CI for Raspberry Pi 5 Bookworm Mar 10, 2024
@lakshanthad
Copy link
Member Author

@glenn-jocher mAP falling behind and throws out error. Do we lower it? What do you suggest?

image

@glenn-jocher
Copy link
Member

glenn-jocher commented Mar 10, 2024

@lakshanthad yes, perhaps some issues with NCNN, we can lower the segment benchmark floor to 0.267. You do that directly in the CI.

@glenn-jocher
Copy link
Member

New fail on Pose, updating to 0.179.

The Tests failures won't be resolved by updating benchmarks though, can you take a look at these as well?

@lakshanthad
Copy link
Member Author

@glenn-jocher Benchmarks are all good now. I will take a look at Tests failures tomorrow.

@glenn-jocher
Copy link
Member

@lakshanthad got it. Yes, I lowered a couple thresholds slightly to meet the lower RPi5 values.

For the tests I fixed a CI YAML bug and they are launching correctly now but aborting mid-tests for some reason, maybe in test_cli.py

@lakshanthad
Copy link
Member Author

@glenn-jocher let's see after this change because coreml doesnt support exports on RPi:
8dfbc54

@lakshanthad
Copy link
Member Author

lakshanthad commented Mar 11, 2024

no luck it seems. I will investigate further. I am suspecting this has something to do with the number of cores on the RPi. Threading issue. The problem might be inside test_python.py

@glenn-jocher
Copy link
Member

glenn-jocher commented Apr 16, 2024

@lakshanthad some of the replacements you've made I'm not understanding at all, like this one is for replacing all ARM64 environments, it's not about Raspberry Pis and Jetson Nano's they are lumped in with every other ARM64 environment no?

Screenshot 2024-04-16 at 16 29 37

@glenn-jocher
Copy link
Member

@lakshanthad here's another case, it seems you're forgetting that RPi and Jetson are not the only ARM64 environments in the world.

If a Macbook M2/M3 user runs this now his code will break no? Why are there so many replacements swapping ARM64 for RPi+Jetson, these statements are not equivalent and are excluding the wider world of ARM64 devices out there, or even i.e. Linux Docker images running on aarch64 devices like Macbooks.

Screenshot 2024-04-16 at 16 34 04

@lakshanthad
Copy link
Member Author

lakshanthad commented Apr 16, 2024

@glenn-jocher M1/M2 will not break. Those ARM64 issues such as numpy versioning only affects RPi and Jetson and was not bringing about issues when running on the macos ARM runner. The reason i made them specify to rpi and jetson is because the problems only started happening for rpi and jetson, but not for macos arm runners.

I wanted to highlight the problems only happen with rpi and jetson and that is why i remove ARM64 and added the new constants.

@glenn-jocher
Copy link
Member

@lakshanthad we started getting a strange failure of is_online() recently, tried to push a fix in the most recent PR, lowered the benchmark floor also to fix a benchmark failure there.

I searched for a simple way to run on schedule but it doesn't exist, we need to treat Raspberry Pi the same way we treat the GPU job, as a separate job. I'm trying to refactor now.

@lakshanthad
Copy link
Member Author

lakshanthad commented Apr 17, 2024

okay thanks a lot! @glenn-jocher. my god, did you only sleep 3hrs?

@glenn-jocher glenn-jocher removed the TODO High priority items label Apr 17, 2024
@glenn-jocher glenn-jocher changed the title ultralytics 8.1.48 Raspberry Pi 5 self-hosted CI Raspberry Pi 5 self-hosted CI Apr 17, 2024
@glenn-jocher glenn-jocher merged commit b76400a into ultralytics:main Apr 17, 2024
6 of 11 checks passed
@glenn-jocher
Copy link
Member

@lakshanthad apologies buddy, I had to tear up the CI changes and merge them into a single smaller job (no benchmarks, just tests).

I used my "GPU" job as a blueprint, I hope this works, but haven't had time to test.

Also I found I couldn't cancel in-progress Rpi runner actions as I think maybe it was coming from your fork, but I've put them on scheduled and workflow dispatch triggers now.

@@ -101,6 +101,7 @@ export = [
"openvino>=2024.0.0", # OpenVINO export
"tensorflow<=2.13.1; python_version <= '3.11'", # TF bug https://github.com/ultralytics/ultralytics/issues/5161
"tensorflowjs>=3.9.0; python_version <= '3.11'", # TF.js export, automatically installs tensorflow
"flatbuffers>=23.5.26,<100", # update old 'flatbuffers' included inside tensorflow package
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lakshanthad I'm not sure if this line is causing the Dockerfile deploy errors following this PR. I may have to remove it for the time being to get 8.2 out in time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be the issue. Because this change was done a long time ago and the other CI were passing at the time @glenn-jocher. Are you sure this is causing the issue?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is really the issue, then we can add this for only 'aarch64' @glenn-jocher

@lakshanthad
Copy link
Member Author

lakshanthad commented Apr 17, 2024

@lakshanthad apologies buddy, I had to tear up the CI changes and merge them into a single smaller job (no benchmarks, just tests).

I used my "GPU" job as a blueprint, I hope this works, but haven't had time to test.

Also I found I couldn't cancel in-progress Rpi runner actions as I think maybe it was coming from your fork, but I've put them on scheduled and workflow dispatch triggers now.

@glenn-jocher understood. it is fine. Thank you for all the changes. I think this is the only way we can implement it for now. So we will manually add the benchmarks later to this separate job?

dimidagd pushed a commit to dimidagd/ultralytics_dotav2 that referenced this pull request Apr 18, 2024
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Ultralytics AI Assistant <135830346+UltralyticsAssistant@users.noreply.github.com>
gkinman pushed a commit to Octasic/ultralytics that referenced this pull request May 30, 2024
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Ultralytics AI Assistant <135830346+UltralyticsAssistant@users.noreply.github.com>
iamdgarcia pushed a commit to iamdgarcia/ultralytics_16U that referenced this pull request Nov 8, 2024
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Ultralytics AI Assistant <135830346+UltralyticsAssistant@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops GitHub Devops or MLops enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants