Skip to content

Commit

Permalink
Improve text on underlying device selection
Browse files Browse the repository at this point in the history
Co-authored-by: Joshua Bell <[email protected]>
  • Loading branch information
zolkis and inexorabletash authored Jan 27, 2025
1 parent 75a6848 commit 360aaae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ An {{MLContext}} interface represents a global state of neural network execution

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.

When an {{MLContext}} is created with {{MLContextOptions}}, the user agent selects and creates the underlying execution device by taking into account these options, currently the {{MLPowerPreference}} option. Depending on the underlying platform, the user agents may select different devices or combination of CPU, NPU and GPU devices.
When an {{MLContext}} is created with {{MLContextOptions}}, the user agent selects and creates the underlying execution device by taking into account these options, currently only the {{MLPowerPreference}} option. Depending on the underlying platform, the user agent may select different combinations of CPU, NPU and GPU devices.

For a history and rationale of this design, please see the <a href="https://github.com/webmachinelearning/webnn/blob/master/device-selection-explainer.md">device selection explainer</a>.

Expand Down

0 comments on commit 360aaae

Please sign in to comment.