-
Notifications
You must be signed in to change notification settings - Fork 468
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
Add a sync
feature to common, core, and tensor
#893
Conversation
Maybe this'll fix CI? |
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.
Maybe we should rename the feature flag to something like wasm-sync
since it exclusively modifies the behavior when targeting wasm. Another option is to introduce a feature flag called async
, but it could be misleading, as most of the execution relies on asynchronous operations using channels.
Just the name sync
is also misleading, since even when not enabled, the APIs are sync when not targeting wasm.
burn/Cargo.toml
Outdated
burn-common = { path = "../burn-common", version = "0.10.0", optional = true, default-features = false } | ||
burn-tensor = { path = "../burn-tensor", version = "0.10.0", optional = true, default-features = false } |
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.
I think I would use burn-core
to pass the sync
feature flag to those crates instead of adding them to burn
.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #893 +/- ##
=======================================
Coverage ? 84.99%
=======================================
Files ? 469
Lines ? 44443
Branches ? 0
=======================================
Hits ? 37773
Misses ? 6670
Partials ? 0 ☔ View full report in Codecov by Sentry. |
Oh hah I did not expect that to fix CI. |
@AlexErrant It was a setting problem, so just a trigger would fix it! |
Pull Request Template
Checklist
run-checks
script has been executed.Failed with the same error as last time, more or less.
Related Issues/PRs
Resolves #865.
Continuing the discussion from the above issue: After a truly embarrassing amount of spinning in circles, I don't think I can get Asyncify to work with wgpu. WGPU is, at its foundation, async, and critical apis don't have a synchronous version. Asyncify only works on wasm files. WGPU is async Rust, so asyncify can't "de-async" it for our consumption.
Changes
So instead I pull the same trick as last time and feature flag stuff. I add a
sync
feature that I can use to get sync behavior when targeting WASM.Testing
Add
to https://github.com/burn-rs/burn/blob/main/examples/mnist-inference-web/Cargo.toml, delete this await, and observe that
./build-for-web.sh ndarray
builds.