#1072: Updated review of Web Neural Network API
Discussions
Log in to see TAG-private discussions.
Discussed
Apr 1, 2025 (See Github)
Move to Breakout C
Discussed
Apr 1, 2025 (See Github)
Jeffrey: Lola was concerned about environmental impact and multi-implementer support... I think it's worth sending these to the group.
Jeffrey to channel this to public.
Christian: There is a WebML working group meeting tomorrow. It would be great if they can review the comments then.
Torgo: How do people feel about the environmental impact question? AI should be scrutinized, but this is about being on-device. Environmental impact might not be as much of a factor as in a cluster.
Jeffrey: There are arguments in all sorts of directions, and we don't have the appropriate measurements. We should ask the WG to consider this, and not try to give them an answer.
Torgo: And it depends on what work you're doing. You'll probably only ask the device to do things that are appropirate to the device. If there's something focused on private data, then that makes sense to do on the device. One reason for the API is to make things more efficient: to take advantage of the lower-power processor on the device.
Dan: This would also apply to the Writing Assistance review, which is still in progress. Lots of the efficiency arguments apply the same way.
Jeffrey: Another consideration (which the Chrome team on this is considering) is whether we want this extra whole language in the platform, on top of Wasm and WebGPU.
OpenedMar 20, 2025
Hello TAG!
I'm requesting an updated TAG review of WebNN API - previous TAG review: #933
Further details:
You should also know that...
Below is a summary of substantive changes since the previous TAG review in 2024 to assist you in this delta review.
Significant new features:
MLTensor
interface that represents a tensor, an input or output to anMLGraph
. UpdateMLContext
interface with newcreateTensor()
,readTensor()
,writeTensor()
methods, changecompute()
todispatch()
for scheduling the workload, add newdestroy()
method forMLContext
,MLGraph
,MLTensor
. These changes allow buffer reuse, chained inference, better resource management with explicit destruction, and the opportunity to share memory with WebGPU, minimizing copies. See MLTensor Explainer for details.Other substantial changes:
MLDeviceType
abstraction based on implementation feedback, see Device Selection Explainer for detailsMLContext.lost
attribute to signal context lost error at the earliest opportunity for improved debuggabilityopSupportLimits()
to allow checking whether operators/types are supported before creating a graphFloat16Array
by default, noteUint16Array
workaround informativelyMLOperand
methods into readonly attributes (dataType
,shape
) per Web Platform Design PrinciplesMLOperatorOptions.label
for more diagnosable error messagesMLNumber
for specifying numeric inputs of any typeThe group would like to seek TAG's explicit advise on the following: