Documentation
¶
Overview ¶
Package webgpu is a wasi-nn backend that runs ONNX graphs on the browser's GPU through WebGPU (WGSL compute kernels), for the "gpu" execution target. It runs where the engine's WASI host runs in the browser: the playground's engine worker.
The graph is laid out by onnx.Session.Plan (shapes from a CPU dry run, constants folded), then each node is one kernel dispatch. A fallback (software) adapter is refused: GPU work is never claimed from a CPU.
Index ¶
Constants ¶
const MaxRank = 8
MaxRank is the largest tensor rank the kernels index.
const MaxSpatial = 3
MaxSpatial is the largest number of spatial axes of Conv and pooling.
Variables ¶
var Supported = []string{"Add", "AveragePool", "Concat", "Constant", "Conv", "Div", "Dropout", "Flatten",
"Gemm", "Identity", "MatMul", "MaxPool", "Mul", "Relu", "Reshape", "Softmax", "Sub", "Transpose"}
Supported lists the operators with a GPU kernel (or a copy-free rewrite); it equals onnx.Supported, checked by a test.
Functions ¶
This section is empty.
Types ¶
This section is empty.