-
Notifications
You must be signed in to change notification settings - Fork 481
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
Make compatible with thumbv6m-none-eabi #2096
Conversation
Checklist of things that need to be done
|
@BjornTheProgrammer FYI, it's sufficient to fix make this work with crates in this test: https://github.com/tracel-ai/burn/tree/main/crates/burn-no-std-tests |
0975828
to
774ac0d
Compare
This comment was marked as resolved.
This comment was marked as resolved.
I believe I have actually found the issue.
[dependencies]
# ** Please make sure all dependencies support no_std when std is disabled **
burn-common = { path = "../burn-common", version = "0.14.0", default-features = false }
burn-dataset = { path = "../burn-dataset", version = "0.14.0", optional = true, default-features = false }
burn-derive = { path = "../burn-derive", version = "0.14.0" }
burn-tensor = { path = "../burn-tensor", version = "0.14.0", default-features = false }
# ... But We could just make it so that |
Tagging @nathanielsimard @laggui @syl20bnr to suggest dependency consistency. I will take a look closer tomorrow. |
This pull request only supports |
We do not have no-std tests for candle. It would be great if candle worked because it's CPU implentation is more optimized than ndarray. Maybe you could tackle them in a different pr |
Any resolution on this front? |
Yes, the cubecl-common has std flag enabled by default. You need to disable default features like this: I resolved the conflicts of your PR locally and built and tested Here is the diff you need to apply: Probably left out by recent refactoring. |
Based on my testing, this doesn't work. When you try to build for the To test yourself use the following command in
|
3979b82
to
fe8c02e
Compare
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.
For the following, I do not know which method is best used instead of the deprecated method. Your input would be appreciated.
I've added documentation to the burn book (it should be rewritten more to your standards) and replaced the deprecated methods, I'm unsure if I did so correctly. One of the tests still fails from asserts with These are the final things that need to be fixed before this can be merged. @antimora would you mind tackling these? |
I will try. I have been feeling sick lately, so my availability might be sporadic. |
@BjornTheProgrammer is this error you're gettin when building
|
I resolved conflicts and rebase. Let me know what's blocking you. |
I fixed that error, just by updating the revision of Upon fixing this, the PR should be ready to merge. I'll open this to no longer be a draft.
|
a6a40e8
to
a3f17e0
Compare
@antimora Fixed all issues, |
@BjornTheProgrammer i will review in coming days. I also invited others to look into this. This will be a very useful feature especially with your example and a book section! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2096 +/- ##
=======================================
Coverage 86.04% 86.04%
=======================================
Files 695 695
Lines 88882 88882
=======================================
Hits 76480 76480
Misses 12402 12402 ☔ View full report in Codecov by Sentry. |
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.
This looks awesome! Thanks for the great addition including both an example and step-by-step guide in the book 🙂
I'll make time to review this in the next few days 🙏
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.
LGTM
Thank you for you addition. This feature has been asked a few times. I am glad we support CPUs without atomic instructions.
cd645ff
to
46b19ad
Compare
@laggui I hope you'd be able to review it soon so we can merge it before other deviations appear on the main. |
Wow I reviewed this earlier this afternoon, I guess I forgot to submit 😅 |
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.
Awesome work!
Everything looks good, I just have a minor request:
Can you add a small README to the example, and perhaps rename it to something more explicit instead of rp2040. know it is for the target embedded system, but perhaps something like raspberry-pi-micro
would be better?
I'll let you decide what you think fits best 😄
@laggui I've made the requested changes! Good catch, I didn't think of that at all! |
Thanks for the quick change! Looks good to go 👌🏻 |
Thank you so much everyone. I really appreciate your project! It's bringing forward the possibilities of ai inference! |
Checklist
run-checks all
script has been executed.Related Issues/PRs
Problem with no_std on thumbv6m-none-eabi #302
Inference on an embedded MCU (RP2040 / Raspberry Pico) #1067
[WIP] Use portable atomics to build for thumbv6m-none-eabi target #374
Changes
The goal is to get
burn
working on athumbv6m-none-eabi
target, which std lib does not have access toArc
, and some atomics.It fixes issues surrounding compilation using a new version of ndarray and exposes some feature flags. It also provides an example model that runs on a
thumbv6m-none-eabi
target.Testing
Haven't been able to test completely yet, due to
cubecl
andcubecl-common
dependencies breaking the build.