Updated review of Web Neural Network API #1072
Labels
Focus: API design (pending)
Progress: in progress
Topic: Design Principles
we believe this design review will inform our work on the Web Platform Design Principles document.
Topic: Machine Learning
Not AI
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:
The text was updated successfully, but these errors were encountered: