You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Graph initialization is an important step in optimizing an MLGraph for execution on the GPU using DirectML (see #303 (comment)). This is another piece of build() which should be better specified (see #457).
However, the spec currently refers to graph initialization in two different ways:
The specification of MLCommandEncoder includes a definition of graph initialization, which consists of a non-normative note but no formal algorithm
The MLGraph.buildSync() algorithm includes a step to "make a request to the underlying platform to initialize the graph", which includes steps such as validating MLOperands and preprocessing constants
The former pretty clearly maps to the concept of graph initialization in DirectML. As does "Implementations MAY preprocess and optimize the tensor data of operand for the underlying platform" from the MLGraph.buildSync() algorithm. Since this initialization step is context-dependent and may not exist separate from compilation for other backends (see #341 (comment)), I tentatively suggest alluding to this step as an implementation-defined non-normative hint.
However, we can't just wave away "graph initialization" as entirely implementation-defined. There are some characteristics of this step (at least how it's currently specified) which still should be specified somehow: