From 8d71e1806a1aeea85b53bf14fc623f32c6217d8c Mon Sep 17 00:00:00 2001 From: Anssi Kostiainen Date: Thu, 10 Oct 2024 16:52:33 +0300 Subject: [PATCH] Add resource contention considerations This is to address feedback from the TAG review: https://github.com/w3ctag/design-reviews/issues/933 --- index.bs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.bs b/index.bs index 0ea3f54a..e7fe373f 100644 --- a/index.bs +++ b/index.bs @@ -609,6 +609,8 @@ This API is disabled by default in all cross-origin frames using the [[#permissi This API allows creation of an {{MLContext}} from a {{GPUDevice}} defined by WebGPU specification. See WebGPU Security Considerations for more information regarding security characteristics of this context. +This API provides an abstraction across GPU, CPU and dedicated ML accelerator hardware. When using a GPU, denial of service considerations similar to WebGPU apply. When using a CPU or a dedicated ML accelerator, the types of potential resource contention are different and mitigations will be implementation- and configuration-dependent. Implementations should use whatever mechanisms available from the platform to prevent sites from using an unfair amount of system resources. These compute units are shared resources and the use of any compute API will affect overall performance on a fully-loaded system. + Once the graph is fully constructed and compiled, the input shapes into each of the operations in the graph are inferred and finalized. The bounds checking occurs when the compute method is invoked that executes the graph against the actual data. No actual data is bound to the compiled graph before this stage. It is the implementation's responsibility to make sure proper bounds checking occurs against the shapes of the data already inferred by that time. Issue: Document operations susceptible to out-of-bounds access as a guidance to implementers.