batchcompute

command
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: 11 Imported by: 0

Documentation

Overview

Command batchcompute is a WASI container that computes on the GPU through the batched command stream (wasi_webgpu_batch) and checks every element it reads back.

GOOS=wasip1 GOARCH=wasm go build -o batchcompute.wasm ./examples/batchcompute
wctr run --gpu [--gpu-memory=SIZE] IMAGE [MODE]

It records a compute shader that writes known values into a storage buffer, copies the buffer to a MAP_READ buffer and reads it back in the same submit: one crossing into the host. MODE:

(none)     1 MiB and 4 KiB read-backs, every element checked; exit 0
refusals   frames the host must refuse (an out-of-range write, a read
           outside the window, a malformed frame, an oversized frame,
           an allocation past the GPU memory quota); prints one line
           each; exit 0 when every one is refused as expected
shaders    WGSL the GPU refuses (a reserved word, a syntax error) must fail with
           errno InvalidShader and the compiler's message; a valid source is the
           control; exit 0 when every case is as expected
unbounded  what the host refuses for its loop budget: errno 13 (the host's bind
           group 3 in WGSL, a 4-group layout, a SetBindGroup of 3) and errno 15 (a
           loop beside every storage buffer the device allows, a loop in a module
           with a vertex entry, an auto layout); a bounded loop is the control
quota      allocates 64 MiB buffers through the remote device until
           the guest-side quota refuses
bench N    N interleaved rounds of the per-submit round trip at 4 KiB
           and 1 MiB, read-only and compute+copy+read; prints medians

Exit 2 (printing "no GPU") when the container has no GPU: no --gpu, no WebGPU where it runs, or only a software adapter.

Jump to

Keyboard shortcuts

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