-
Notifications
You must be signed in to change notification settings - Fork 46
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
Support asynchronous graph compilation #263
Comments
Reproducing the discussion from #257 here for the record:
|
To my experience, asyncify injects quite a bit supporting code to wrap the async call that would introduce non-trivial cost and impact the performance. In today's WG call, @RafaelCintron also mentioned
Regarding to the "Async" suffix, there are other APIs follow this convention, for example WebGPU: GPUBuffer.mapAsync @dontcallmedom may have more insights on the naming. |
Thanks for the explanation. I think having a sync version of the method is justified considering the performance overhead and easier interoperability with C++ code. It's a good starting point for WebNN implementation. I feel the async version can lower the barrier to adoption (developers won't need workers). Perhaps we can (in the spec), expose |
Thanks @wacky6
+1. I'll make a PR to add the async build method.
I agree adding such kind of notice would be helpful. However, according to the feedback of #229, only exposing sync APIs in worker would protect the user from main-thread jank via developers using such APIs. Do you think the WG should revisit that issue? |
I agree limiting sync API to only workers, if there's an async alternative in window (e.g. Personally, I think the user experience is the responsibility of application developers. API and spec authors should provide the tools for developers to deliver such experience. Developers should make the final call on whether to do X in where. If a developer really want to block the main thread, I don't think spec authors should try to stop that. Of course, we should warn developers about potential caveats (e.g. this method could take a long time and block the main thread). |
Feedback from @wacky6 and @huningxin. Detail is in PR #257.
The text was updated successfully, but these errors were encountered: