From 5c64074c544e8a6853a760fa258790f7b13e0bdc Mon Sep 17 00:00:00 2001 From: Dwayne Robinson Date: Mon, 17 Jun 2024 18:41:43 -0700 Subject: [PATCH] Add MLDeviceType npu (#696) * Add MLDeviceType npu * Minor wording * Add note about fallback * Remove 'can' regarding performance * Review feedback * Fix funky line break in issue text * Review feedback * Review feedback from Joshua --- index.bs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/index.bs b/index.bs index 39301cec..2455362b 100644 --- a/index.bs +++ b/index.bs @@ -613,7 +613,9 @@ Unlike WebGPU, this API does not intrinsically support custom shader authoring; The WebGPU API identifies machine-specific artifacts 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 two 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 {{MLDeviceType}} normatively indicates the kind of device and is either {{MLDeviceType/"cpu"}} or {{MLDeviceType/"gpu"}}. If this type cannot be satisfied, an "{{OperationError}}" {{DOMException}} is thrown, thus this type can in some cases add two bits of entropy to the fingerprint. An {{MLPowerPreference}} indicates preference as related to the power consumption and is considered a hint only and as such does not increase entropy of the fingerprint. +The WebNN API defines two 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 {{MLDeviceType}} normatively indicates the kind of device and is one of: {{MLDeviceType/"cpu"}}, {{MLDeviceType/"gpu"}}, {{MLDeviceType/"npu"}}. If this type cannot be satisfied, an "{{OperationError}}" {{DOMException}} is thrown, thus this type can in some cases add two bits of entropy to the fingerprint. An {{MLPowerPreference}} indicates preference as related to the power consumption and 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. If a future version of this specification introduces support for a new {{MLDeviceType}} that can only support a subset of {{MLOperandDataType}}s, that may introduce a new fingerprint. @@ -702,7 +704,8 @@ WorkerNavigator includes NavigatorML;