webgpu

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2026 License: BSD-3-Clause Imports: 5 Imported by: 0

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

View Source
const MaxRank = 8

MaxRank is the largest tensor rank the kernels index.

View Source
const MaxSpatial = 3

MaxSpatial is the largest number of spatial axes of Conv and pooling.

Variables

View Source
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL