|
2 | 2 | <p><code>wasi-nn</code> is a WASI API for performing machine learning (ML) inference. The API is not (yet)
|
3 | 3 | capable of performing ML training. WebAssembly programs that want to use a host's ML
|
4 | 4 | capabilities can access these capabilities through <code>wasi-nn</code>'s core abstractions: <em>graphs</em> and
|
5 |
| -<em>tensors</em>. A user <a href="#load"><code>load</code></a>s a model -- instantiated as a <em>graph</em> -- to use in an ML <em>backend</em>. |
| 5 | +<em>tensors</em>. A user <a href="#load"><code>load</code></a>s an ML model -- instantiated as a <em>graph</em> -- to use in an ML <em>backend</em>. |
6 | 6 | Then, the user passes <em>tensor</em> inputs to the <em>graph</em>, computes the inference, and retrieves the
|
7 | 7 | <em>tensor</em> outputs.</p>
|
8 | 8 | <p>This example world shows how to use these primitives together.</p>
|
@@ -62,8 +62,8 @@ memory--e.g., using row-major ordering--and could perhaps be improved.</p>
|
62 | 62 | <li><a name="error.busy"><code>busy</code></a></li>
|
63 | 63 | <li><a name="error.runtime_error"><code>runtime-error</code></a></li>
|
64 | 64 | <li><a name="error.unsupported_operation"><code>unsupported-operation</code></a></li>
|
65 |
| -<li><a name="error.model_too_large"><code>model-too-large</code></a></li> |
66 |
| -<li><a name="error.model_not_found"><code>model-not-found</code></a></li> |
| 65 | +<li><a name="error.too_large"><code>too-large</code></a></li> |
| 66 | +<li><a name="error.not_found"><code>not-found</code></a></li> |
67 | 67 | </ul>
|
68 | 68 | <h2><a name="wasi:nn_graph">Import interface wasi:nn/graph</a></h2>
|
69 | 69 | <p>A <a href="#graph"><code>graph</code></a> is a loaded instance of a specific ML model (e.g., MobileNet) for a specific ML
|
@@ -119,18 +119,18 @@ graph IR in parts (e.g., OpenVINO stores its IR and weights separately).</p>
|
119 | 119 | <ul>
|
120 | 120 | <li><a name="load.0"></a> result<<a href="#graph"><a href="#graph"><code>graph</code></a></a>, <a href="#error"><a href="#error"><code>error</code></a></a>></li>
|
121 | 121 | </ul>
|
122 |
| -<h4><a name="load_named_model"><code>load-named-model: func</code></a></h4> |
| 122 | +<h4><a name="load_by_name"><code>load-by-name: func</code></a></h4> |
123 | 123 | <p>Load a <a href="#graph"><code>graph</code></a> by name.</p>
|
124 | 124 | <p>How the host expects the names to be passed and how it stores the graphs for retrieval via
|
125 | 125 | this function is <strong>implementation-specific</strong>. This allows hosts to choose name schemes that
|
126 | 126 | range from simple to complex (e.g., URLs?) and caching mechanisms of various kinds.</p>
|
127 | 127 | <h5>Params</h5>
|
128 | 128 | <ul>
|
129 |
| -<li><a name="load_named_model.name"><code>name</code></a>: <code>string</code></li> |
| 129 | +<li><a name="load_by_name.name"><code>name</code></a>: <code>string</code></li> |
130 | 130 | </ul>
|
131 | 131 | <h5>Return values</h5>
|
132 | 132 | <ul>
|
133 |
| -<li><a name="load_named_model.0"></a> result<<a href="#graph"><a href="#graph"><code>graph</code></a></a>, <a href="#error"><a href="#error"><code>error</code></a></a>></li> |
| 133 | +<li><a name="load_by_name.0"></a> result<<a href="#graph"><a href="#graph"><code>graph</code></a></a>, <a href="#error"><a href="#error"><code>error</code></a></a>></li> |
134 | 134 | </ul>
|
135 | 135 | <h2><a name="wasi:nn_inference">Import interface wasi:nn/inference</a></h2>
|
136 | 136 | <p>An inference "session" is encapsulated by a <a href="#graph_execution_context"><code>graph-execution-context</code></a>. This structure binds a
|
|
0 commit comments