Skip to content

Commit

Permalink
Address review comments from Ningxin
Browse files Browse the repository at this point in the history
  • Loading branch information
zolkis committed Feb 6, 2025
1 parent ba6d824 commit f809576
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ Unlike WebGPU, this API does not intrinsically support custom shader authoring;

The WebGPU API identifies <a href="https://gpuweb.github.io/gpuweb/#privacy-machine-artifacts">machine-specific artifacts</a> as a privacy consideration. Similarly, the WebNN API's compute unit scheduling may under certain circumstances introduce a fingerprint. However, similarly to WebGPU, such fingerprints are identical across most or all of the devices of each vendor, mitigating the concern. Furthermore, software implementations can be used to further eliminate such artifacts.

The WebNN API defines developer-settable preferences to help inform [[#programming-model-device-selection]] and allow the implementation to better select the most appropriate underlying execution device for the workload. An {{MLPowerPreference}} indicates a preference as related to the desired low power consumption or high performance; this is considered a hint only and as such does not increase entropy of the fingerprint.
The WebNN API defines developer-settable preferences to help inform [[#programming-model-device-selection]] and allow the implementation to better select the underlying execution device for the workload. An {{MLPowerPreference}} indicates preference as related to the desired low power consumption or high performance, is considered a hint only and as such does not increase entropy of the fingerprint.

Issue(623): {{MLContextOptions}} is under active development, and the design is expected to change, informed by further implementation experience and new use cases from the wider web community.

Expand Down Expand Up @@ -729,7 +729,11 @@ 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 only the {{MLPowerPreference}} option. Depending on the underlying platform, the user agent may select different combinations 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.

<div class="note">
Depending on the underlying platform, the user agent may select different combinations of CPU, NPU and GPU devices.
</div>

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 f809576

Please sign in to comment.