Skip to content

Commit 6318a5a

Browse files
anssikohuningxin
andauthored
Update WebNN architecture diagram (#847)
Co-authored-by: Ningxin Hu <[email protected]>
1 parent ca0654e commit 6318a5a

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

content/webnn_arch.png

-79 KB
Binary file not shown.

explainer.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,48 @@ The design process of the [Web Neural Network API](https://www.w3.org/TR/webnn/)
2222

2323
With emerging ML innovations in both software and hardware ecosystem, one of the main challenges for the web is to bridge this software and hardware development and bring together a solution that scales across hardware platforms and works with any framework for web-based machine learning experiences. We propose the WebNN API as an abstraction for neural networks in the web browsers.
2424

25-
![WebNN architecture](content/webnn_arch.png)
25+
```mermaid
26+
%%{ init : { "look" : "handDrawn", "theme" : "neo-dark" }}%%
27+
flowchart TD
28+
29+
subgraph Models
30+
Model[ONNX, TensorFlow, PyTorch]
31+
end
32+
33+
subgraph Frameworks
34+
Framework(ONNX Runtime Web, LiteRT)
35+
end
36+
37+
subgraph Browser_APIs[Browser APIs]
38+
Wasm
39+
WebNN
40+
WebGPU
41+
end
42+
43+
subgraph Native_ML_APIs[Native ML APIs]
44+
MLAPI[DirectML / LiteRT / Core&nbsp;ML]
45+
end
46+
47+
subgraph Hardware
48+
CPU
49+
NPU
50+
GPU
51+
end
52+
53+
Model --> Framework
54+
55+
Framework --> Wasm
56+
Framework ==> WebNN
57+
Framework --> WebGPU
58+
59+
Wasm --> CPU
60+
WebNN ==> MLAPI
61+
WebGPU --> GPU
62+
63+
MLAPI ==> CPU
64+
MLAPI ==> NPU
65+
MLAPI ==> GPU
66+
```
2667

2768
As illustrated in the architecture diagram of the figure above, web browsers may implement the WebNN API using native machine learning API available in the operating system. This architecture allows JavaScript frameworks to tap into cutting-edge machine learning innovations in the operating system and the hardware platform underneath it without being tied to platform-specific capabilities, bridging the gap between software and hardware through a hardware-agnostic abstraction layer.
2869

0 commit comments

Comments
 (0)