Skip to content

Commit 1fddf79

Browse files
authored
Remove MLBufferResourceView (#553)
* Follow-up to #546. MLBufferResourceView is not relevant without MLCommandEncoder * remove "creation method" table
1 parent 79baee9 commit 1fddf79

File tree

1 file changed

+2
-33
lines changed

1 file changed

+2
-33
lines changed

index.bs

+2-33
Original file line numberDiff line numberDiff line change
@@ -729,22 +729,12 @@ Once the {{MLGraph}} is constructed, the {{MLContext}}.{{MLContext/compute()}} m
729729

730730
## Device Selection ## {#programming-model-device-selection}
731731

732-
An {{MLContext}} interface represents a global state of neural network execution. One of the important context states is the underlying execution device that manages the resources and facilitates the compilation and the eventual execution of the neural network graph. In addition to the default method of creation with {{MLContextOptions}}, an {{MLContext}} could also be created from a specific {{GPUDevice}} that is already in use by the application, in which case the corresponding {{GPUBuffer}} resources used as graph constants, as well as the {{GPUTexture}} as graph inputs must also be created from the same device. In a multi-adapter configuration, the device used for {{MLContext}} must be created from the same adapter as the device used to allocate the resources referenced in the graph.
732+
An {{MLContext}} interface represents a global state of neural network execution. One of the important context states is the underlying execution device that manages the resources and facilitates the compilation and the eventual execution of the neural network graph. In addition to the default method of creation with {{MLContextOptions}}, an {{MLContext}} could also be created from a specific {{GPUDevice}} that is already in use by the application.
733733

734734
In a situation when a GPU context executes a graph with a constant or an input in the system memory as an {{ArrayBufferView}}, the input content is automatically uploaded from the system memory to the GPU memory, and downloaded back to the system memory of an {{ArrayBufferView}} output buffer at the end of the graph execution. This data upload and download cycles will only occur whenever the execution device requires the data to be copied out of and back into the system memory, such as in the case of the GPU. It doesn't occur when the device is a CPU device. Additionally, the result of the graph execution is in a known layout format. While the execution may be optimized for a native memory access pattern in an intermediate result within the graph, the output of the last operation of the graph must convert the content back to a known layout format at the end of the graph in order to maintain the expected behavior from the caller's perspective.
735735

736736
When an {{MLContext}} is created with {{MLContextOptions}}, the user agent selects and creates the underlying execution device by taking into account the application's [=power preference=] and [=device type=] specified in the {{MLPowerPreference}} and {{MLDeviceType}} options.
737737

738-
The following table summarizes the types of resource supported by the context created through different method of creation:
739-
740-
<div class="note">
741-
<table>
742-
<tr><th>Creation method<th>ArrayBufferView<th>GPUBuffer<th>GPUTexture
743-
<tr><td>MLContextOptions<td>Yes<td>No<td>No
744-
<tr><td>GPUDevice<td>Yes<td>Yes<td>Yes
745-
</table>
746-
</div>
747-
748738
API {#api}
749739
=====================
750740

@@ -1133,13 +1123,7 @@ The {{MLGraphBuilder}} interface defines a set of operations as identified by th
11331123
<script type=idl>
11341124
typedef record<DOMString, MLOperand> MLNamedOperands;
11351125

1136-
dictionary MLBufferResourceView {
1137-
required GPUBuffer resource;
1138-
unsigned long long offset = 0;
1139-
unsigned long long size;
1140-
};
1141-
1142-
typedef (ArrayBufferView or MLBufferResourceView) MLBufferView;
1126+
typedef ArrayBufferView MLBufferView;
11431127

11441128
[SecureContext, Exposed=(Window, DedicatedWorker)]
11451129
interface MLGraphBuilder {
@@ -1166,21 +1150,6 @@ The {{MLGraphBuilder}}.{{MLGraphBuilder/build()}} method compiles the graph buil
11661150
Issue(552): Decide how to specify graph initialization.
11671151
</div>
11681152

1169-
{{MLBufferResourceView}} has the following members:
1170-
<dl dfn-type=dict-member dfn-for=MLBufferResourceView>
1171-
: <dfn>resource</dfn>
1172-
::
1173-
The GPU buffer source.
1174-
1175-
: <dfn>offset</dfn>
1176-
::
1177-
The offset in the buffer source.
1178-
1179-
: <dfn>size</dfn>
1180-
::
1181-
The size of the buffer view.
1182-
</dl>
1183-
11841153
<div class=internal-slots>
11851154
{{MLGraphBuilder}} has the following internal slots:
11861155
<dl dfn-type=attribute dfn-for="MLGraphBuilder">

0 commit comments

Comments
 (0)