The integer operator set's graph operators on GPUs. WGSL has no 64-bit integer, so the kernels use 32-bit words only: a graph whose certificate meets acc32 runs on one word per value, with its two product intermediates formed from 16-bit halves; every other graph of wai-ops/1-i32 meets acc64 and runs on exact 64- and 128-bit arithmetic built from 32-bit words (integer-operators §7.3). A graph with layernorm_c, l2norm, softmax, sigmoid or elu runs on the CPU, and support() says which operator sent it there. The host makes the interpreter's run-time checks in its order before the device runs anything; a check tensor that leaves its range sets its operator's flag, and the first flagged operator refuses the decode. Every device passes an arithmetic probe against the host before it runs a graph. Tests: the probe on a million cases, an edited product caught by it, and every graph vector of ops-conformance that the subset covers, at both widths, held to the committed expectations and the CPU interpreter. Co-Authored-By: Claude Opus 5.5 <[email protected]>
33 lines
1.3 KiB
TOML
33 lines
1.3 KiB
TOML
# `wai-ops/1-i32` on GPUs: the integer operator set's graph operators as WGSL compute
|
|
# kernels through wgpu (Metal, Vulkan, DX12 natively; a browser's WebGPU on
|
|
# wasm32-unknown-unknown), exact at both accumulator profiles, `acc32` in one 32-bit
|
|
# word per value and `acc64` in exact 64- and 128-bit arithmetic built from 32-bit
|
|
# words (extensions/integer-operators.md §7.3).
|
|
#
|
|
# A SEPARATE crate with its own lockfile, so that `wai-ops` stays `no_std` with no
|
|
# dependencies and `wai-rs` builds without wgpu by default; `wai-rs`'s `ops_gpu`
|
|
# feature is the only way it enters a decode.
|
|
[package]
|
|
name = "wai-ops-gpu"
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
rust-version = "1.97"
|
|
license = "Apache-2.0"
|
|
publish = false
|
|
description = "WAI integer operator set wai-ops/1-i32 on GPUs: WGSL kernels through wgpu, exact at acc32 and acc64"
|
|
|
|
[lib]
|
|
name = "wai_ops_gpu"
|
|
path = "src/lib.rs"
|
|
|
|
[dependencies]
|
|
wai-ops = { path = "../wai-ops" }
|
|
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
|
wgpu = { version = "30.0.1", default-features = false, features = ["std", "wgsl", "metal", "vulkan", "dx12"] }
|
|
|
|
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
|
|
wgpu = { version = "30.0.1", default-features = false, features = ["std", "wgsl", "webgpu"] }
|
|
|
|
[profile.release]
|
|
debug = false
|