Skip to content

Commit f95b30d

Browse files
committed
Tighten up some wordings so it reads better.
1 parent db468ff commit f95b30d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

index.bs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -520,15 +520,16 @@ is completely executed, the result is available in the bound output buffers.
520520

521521
## Context and Device Association ## {#programming-model-context-device-association}
522522

523-
An {{MLContext}} interface represents a state of neural network execution. An important function of this state is manage resources used in the compilation
524-
and execution of the neural network graph. An implementation in a user agent may implement this state in terms of CPU resources when an {{MLContext}} is created
525-
without an explicit association with a hardware device (aka. a *"default context"*). However, when an {{MLContext}} is created from a specific {{GPUDevice}} that
526-
is also used by the application of WebGPU (aka. a *"GPU context"*), any GPU resource created from the same {{GPUDevice}} such as the {{GPUBuffer}} or {{GPUTexture}}
527-
is considered a native resource that can also be used as a graph constant, input, or output operand.
523+
An {{MLContext}} interface represents a state of a neural network execution. An important function of this state is to manage resources used in the compilation
524+
and execution of the neural network graph. An implementation in a user agent may implement this state in terms of CPU resources and execution when an {{MLContext}}
525+
is created without an explicit association with a hardware device (aka. a *"default context"*). However, when an {{MLContext}} is created from a WebGPU {{GPUDevice}}
526+
(aka. a *"GPU context"*), the implementation uses the specified GPU device as a resource domain for the subsequent compilation and execution of the graph.
527+
Any GPU resource such as the {{GPUBuffer}} or {{GPUTexture}} created from the same {{GPUDevice}} is therefore considered a resource of native resource type that
528+
can be used to store a graph constant, input, or output operand.
528529

529530
In a situation when a GPU context executes a graph with a constant or an input or output allocated in the system memory as in an {{ArrayBufferView}}, the content
530531
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
531-
the graph execution. This automatic data upload and download cycles will only occur whenever the executing GPU context determines that the data must be copied out of or back
532+
the graph execution. These automatic data upload and download cycles will only occur whenever the executing GPU context determines that the data must be copied out of or back
532533
into the system memory as part of the execution. Additionally, the eventual result of the execution must also be in a known layout format. While the internal execution
533534
technique may be optimized for native memory access pattern in an intermediate result within the graph, the output of the last operation of the graph must convert
534535
the content back to a known layout format at the end of the graph in order to maintain interoperability as expected by the caller.

0 commit comments

Comments
 (0)