Xenova HF Staff commited on
Commit
8d4a681
·
verified ·
1 Parent(s): 3d17c9b

sync 2e7068faf55e

Browse files
README.md CHANGED
@@ -1,3 +1,96 @@
1
  ---
 
2
  license: apache-2.0
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ library_name: kernels
3
  license: apache-2.0
4
+ tags:
5
+ - kernel
6
+ - webgpu
7
+ - wgsl
8
  ---
9
+ # com.microsoft.MatMulNBitsMlp
10
+
11
+ `com.microsoft` · ONNX Runtime contrib operator · contrib since_version 1
12
+
13
+ ## Description
14
+
15
+ Fuses a gated MLP over two block-quantized projections that share one activation: `Y = silu(A_norm @ gate + gate_bias) * (A_norm @ up + up_bias)`, using the `MatMulNBits` weight packing with no zero-point input. `A_norm` is `A`, `SimplifiedLayerNormalization(A, norm_scale)`, or `SkipSimplifiedLayerNormalization(A, skip, norm_scale)`, whose residual sum may be returned as a second output. Only `silu` and the default `accuracy_level = 0` are implemented; bfloat16 is not implemented.
16
+
17
+ See the [ONNX Runtime `MatMulNBitsMlp` contrib-operator spec](https://github.com/microsoft/onnxruntime/blob/main/docs/ContribOperators.md#com.microsoft.MatMulNBitsMlp) for the reference semantics.
18
+
19
+ ## Inputs
20
+
21
+ | Name | Bind key | Logical dtype | Rank | Shape | Description | Presence |
22
+ | --- | --- | --- | --- | --- | --- | --- |
23
+ | `A` | `aT` | `T1` | — | — | Shared activation of rank 2 `(M, K)` or rank 3 `(batch, sequence, K)`; only the last axis is the reduction axis. | required |
24
+ | `skip` | `skipT` | `T1` | — | — | Residual added to `A` before normalization, with `A`'s shape. Requires `norm_scale`. | optional |
25
+ | `norm_scale` | `normScaleT` | `T1` | `1` | — | Simplified-layer-normalization (RMS) gain of shape `[K]`. Absent means the projections read `A` unnormalized. | optional |
26
+ | `gate_B` | `gateBT` | `uint8` | `3` | — | Bit-packed uint8 gate weights of shape `(N, k_blocks, blob_size)`. | required |
27
+ | `gate_scales` | `gateScalesT` | `T1` | `2` | — | Per-block gate scales of shape `(N, k_blocks)`, with the same dtype as `A`. Quantization is symmetric: this operator has no zero-point input, so codes are offset by the midpoint `2^(bits - 1)`. | required |
28
+ | `gate_bias` | `gateBiasT` | `T1` | `1` | — | Optional gate bias of shape `[N]`, added before the activation. | optional |
29
+ | `up_B` | `upBT` | `uint8` | `3` | — | Bit-packed up weights, same shape and packing as gate_B. | required |
30
+ | `up_scales` | `upScalesT` | `T1` | `2` | — | Per-block up scales of shape `(N, k_blocks)`. | required |
31
+ | `up_bias` | `upBiasT` | `T1` | `1` | — | Optional up bias of shape `[N]`, added before the product. | optional |
32
+
33
+ ## Outputs
34
+
35
+ | Name | Bind key | Logical dtype | Rank | Shape | Description | Presence |
36
+ | --- | --- | --- | --- | --- | --- | --- |
37
+ | `Y` | `yT` | `T1` | same as `A` | derived; see description | Gated MLP output: A's leading axes with a trailing N. | required |
38
+ | `input_skip_bias_sum` | `residualT` | `T1` | same as `A` | same as `A` | The residual sum A + skip, with A's shape. Requires the skip input. | optional |
39
+
40
+ ## Attributes
41
+
42
+ Attributes and default values (overridable per request):
43
+
44
+ | Attribute | Default | Description |
45
+ | --- | --- | --- |
46
+ | `accuracy_level` | `0` | Minimum internal accuracy level: 0 (unset), 1 (float32), 2 (float16), 3 (bfloat16), or 4 (int8). |
47
+ | `bits` | `4` | Bit width used to quantize both weight matrices; this implementation supports 2, 4, and 8. |
48
+ | `epsilon` | `0.00001` | Epsilon used by the optional fused RMS normalization. |
49
+ | `K` | — | Input feature dimension shared by both quantized weight matrices. |
50
+ | `N` | — | Output feature dimension shared by both quantized weight matrices. |
51
+ | `activation` | — | Activation applied to the gate projection; this implementation supports `silu`. |
52
+ | `block_size` | — | Size of each quantization block along K. |
53
+
54
+ ## Type constraints
55
+
56
+ | Variable | Allowed dtypes |
57
+ | --- | --- |
58
+ | `T1` | `float32`, `float16` |
59
+
60
+ ## Files
61
+
62
+ - [`metadata.json`](build/webgpu/metadata.json) — kernel metadata (id, digests, provenance)
63
+ - [`manifest.json`](build/webgpu/manifest.json) — the op contract (source of truth)
64
+ - [`test.json`](build/webgpu/test.json) — correctness cases
65
+ - [`bench.json`](build/webgpu/bench.json) — benchmark + tuning cases
66
+ - [`matmul-nbits-fused-rms-norm.wgsl.jinja`](build/webgpu/matmul-nbits-fused-rms-norm.wgsl.jinja)
67
+ - [`mlp-gate-up.wgsl.jinja`](build/webgpu/mlp-gate-up.wgsl.jinja)
68
+
69
+ ## Use with `@huggingface/kernels`
70
+
71
+ The loader derives every required output's shape and logical dtype from the manifest contract and this call.
72
+ It then allocates the result tensors automatically.
73
+
74
+ The `version: 1` option selects the published kernel contract; it is independent of any operator opset, contrib `since_version`, or model version.
75
+
76
+ Replace each `*Data` placeholder with a typed array containing the corresponding input data.
77
+
78
+ ```js
79
+ import { getKernel } from "@huggingface/kernels";
80
+
81
+ const kernel = await getKernel("webgpu-kernels/com.microsoft.MatMulNBitsMlp", { version: 1 });
82
+ const { yT } = await kernel({
83
+ aT: { data: aTData, shape: [2, 16] },
84
+ gateBT: { data: gateBTData, shape: [4, 2, 4] },
85
+ gateScalesT: { data: gateScalesTData, shape: [4, 2] },
86
+ upBT: { data: upBTData, shape: [4, 2, 4] },
87
+ upScalesT: { data: upScalesTData, shape: [4, 2] },
88
+ }, {
89
+ attrs: {
90
+ K: 16,
91
+ N: 4,
92
+ block_size: 8,
93
+ activation: "silu",
94
+ },
95
+ });
96
+ ```
build/webgpu/bench.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "op": "com.microsoft.MatMulNBitsMlp",
3
+ "tunableSpace": { "TILE_N": [4, 8, 16], "LANES": [8, 16, 32] },
4
+ "cases": [
5
+ {
6
+ "name": "mlp-q4-decode-k2048-n5632",
7
+ "preset": "smoke",
8
+ "vars": { "dtype": "float32" },
9
+ "attrs": { "K": 2048, "N": 5632, "bits": 4, "block_size": 32, "activation": "silu" },
10
+ "inputs": {
11
+ "aT": { "shape": [1, 2048], "dtype": "float32", "dist": "normal", "seed": 8101, "scale": 1 },
12
+ "normScaleT": { "shape": [2048], "dtype": "float32", "dist": "normal", "seed": 8102, "scale": 1 },
13
+ "gateBT": { "shape": [5632, 64, 16], "dtype": "uint8", "dist": "uniform", "seed": 8103, "scale": 255 },
14
+ "gateScalesT": { "shape": [5632, 64], "dtype": "float32", "dist": "normal", "seed": 8104, "scale": 0.05 },
15
+ "upBT": { "shape": [5632, 64, 16], "dtype": "uint8", "dist": "uniform", "seed": 8105, "scale": 255 },
16
+ "upScalesT": { "shape": [5632, 64], "dtype": "float32", "dist": "normal", "seed": 8106, "scale": 0.05 }
17
+ },
18
+ "outputs": { "yT": { "shape": [1, 5632], "dtype": "float32" } },
19
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "2 * 5632 * 64 * 16 * 4" }] }
20
+ },
21
+ {
22
+ "name": "mlp-q4-prefill-m64-k2048-n5632",
23
+ "preset": "model",
24
+ "vars": { "dtype": "float32" },
25
+ "attrs": { "K": 2048, "N": 5632, "bits": 4, "block_size": 32, "activation": "silu" },
26
+ "inputs": {
27
+ "aT": { "shape": [64, 2048], "dtype": "float32", "dist": "normal", "seed": 8107, "scale": 1 },
28
+ "normScaleT": { "shape": [2048], "dtype": "float32", "dist": "normal", "seed": 8108, "scale": 1 },
29
+ "gateBT": { "shape": [5632, 64, 16], "dtype": "uint8", "dist": "uniform", "seed": 8109, "scale": 255 },
30
+ "gateScalesT": { "shape": [5632, 64], "dtype": "float32", "dist": "normal", "seed": 8110, "scale": 0.05 },
31
+ "upBT": { "shape": [5632, 64, 16], "dtype": "uint8", "dist": "uniform", "seed": 8111, "scale": 255 },
32
+ "upScalesT": { "shape": [5632, 64], "dtype": "float32", "dist": "normal", "seed": 8112, "scale": 0.05 }
33
+ },
34
+ "outputs": { "yT": { "shape": [64, 5632], "dtype": "float32" } },
35
+ "bench": { "metrics": [{ "type": "gflops", "value": "2 * 2 * 64 * 2048 * 5632" }] }
36
+ }
37
+ ]
38
+ }
build/webgpu/manifest.json ADDED
@@ -0,0 +1,1948 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "domain": "com.microsoft",
3
+ "name": "MatMulNBitsMlp",
4
+ "sinceVersion": 1,
5
+ "description": "Fuses a gated MLP over two block-quantized projections that share one activation: `Y = silu(A_norm @ gate + gate_bias) * (A_norm @ up + up_bias)`, using the `MatMulNBits` weight packing with no zero-point input. `A_norm` is `A`, `SimplifiedLayerNormalization(A, norm_scale)`, or `SkipSimplifiedLayerNormalization(A, skip, norm_scale)`, whose residual sum may be returned as a second output. Only `silu` and the default `accuracy_level = 0` are implemented; bfloat16 is not implemented.",
6
+ "inputs": [
7
+ {
8
+ "role": "A",
9
+ "dtype": "T1",
10
+ "description": "Shared activation of rank 2 `(M, K)` or rank 3 `(batch, sequence, K)`; only the last axis is the reduction axis."
11
+ },
12
+ {
13
+ "role": "skip",
14
+ "dtype": "T1",
15
+ "optional": true,
16
+ "description": "Residual added to `A` before normalization, with `A`'s shape. Requires `norm_scale`."
17
+ },
18
+ {
19
+ "role": "norm_scale",
20
+ "dtype": "T1",
21
+ "rank": 1,
22
+ "optional": true,
23
+ "description": "Simplified-layer-normalization (RMS) gain of shape `[K]`. Absent means the projections read `A` unnormalized."
24
+ },
25
+ {
26
+ "role": "gate_B",
27
+ "dtype": "uint8",
28
+ "rank": 3,
29
+ "description": "Bit-packed uint8 gate weights of shape `(N, k_blocks, blob_size)`."
30
+ },
31
+ {
32
+ "role": "gate_scales",
33
+ "dtype": "T1",
34
+ "rank": 2,
35
+ "description": "Per-block gate scales of shape `(N, k_blocks)`, with the same dtype as `A`. Quantization is symmetric: this operator has no zero-point input, so codes are offset by the midpoint `2^(bits - 1)`."
36
+ },
37
+ {
38
+ "role": "gate_bias",
39
+ "dtype": "T1",
40
+ "rank": 1,
41
+ "optional": true,
42
+ "description": "Optional gate bias of shape `[N]`, added before the activation."
43
+ },
44
+ {
45
+ "role": "up_B",
46
+ "dtype": "uint8",
47
+ "rank": 3,
48
+ "description": "Bit-packed up weights, same shape and packing as gate_B."
49
+ },
50
+ { "role": "up_scales", "dtype": "T1", "rank": 2, "description": "Per-block up scales of shape `(N, k_blocks)`." },
51
+ {
52
+ "role": "up_bias",
53
+ "dtype": "T1",
54
+ "rank": 1,
55
+ "optional": true,
56
+ "description": "Optional up bias of shape `[N]`, added before the product."
57
+ }
58
+ ],
59
+ "outputs": [
60
+ {
61
+ "role": "Y",
62
+ "dtype": "T1",
63
+ "rank": "ranks.aT",
64
+ "shape": "shapes.aT[:-1] + [attrs.N]",
65
+ "description": "Gated MLP output: A's leading axes with a trailing N."
66
+ },
67
+ {
68
+ "role": "input_skip_bias_sum",
69
+ "dtype": "T1",
70
+ "rank": "ranks.aT",
71
+ "optional": true,
72
+ "shape": "shapes.aT",
73
+ "description": "The residual sum A + skip, with A's shape. Requires the skip input."
74
+ }
75
+ ],
76
+ "attributes": { "accuracy_level": 0, "bits": 4, "epsilon": 0.00001 },
77
+ "attributeDescriptions": {
78
+ "K": "Input feature dimension shared by both quantized weight matrices.",
79
+ "N": "Output feature dimension shared by both quantized weight matrices.",
80
+ "accuracy_level": "Minimum internal accuracy level: 0 (unset), 1 (float32), 2 (float16), 3 (bfloat16), or 4 (int8).",
81
+ "activation": "Activation applied to the gate projection; this implementation supports `silu`.",
82
+ "bits": "Bit width used to quantize both weight matrices; this implementation supports 2, 4, and 8.",
83
+ "block_size": "Size of each quantization block along K.",
84
+ "epsilon": "Epsilon used by the optional fused RMS normalization."
85
+ },
86
+ "attributeConstraints": {
87
+ "K": { "required": true },
88
+ "N": { "required": true },
89
+ "accuracy_level": { "values": [0] },
90
+ "activation": { "required": true, "values": ["silu"] },
91
+ "bits": { "values": [2, 4, 8] },
92
+ "block_size": { "required": true }
93
+ },
94
+ "typeConstraints": { "T1": ["float32", "float16"] },
95
+ "args": {
96
+ "aT": { "kind": "tensor", "semantic": "A", "role": "input" },
97
+ "skipT": { "kind": "tensor", "semantic": "skip", "role": "input", "required": false },
98
+ "normScaleT": { "kind": "tensor", "semantic": "norm_scale", "role": "weights", "required": false },
99
+ "gateBT": { "kind": "tensor", "semantic": "gate_B", "role": "weights" },
100
+ "gateScalesT": { "kind": "tensor", "semantic": "gate_scales", "role": "weights" },
101
+ "gateBiasT": { "kind": "tensor", "semantic": "gate_bias", "role": "weights", "required": false },
102
+ "upBT": { "kind": "tensor", "semantic": "up_B", "role": "weights" },
103
+ "upScalesT": { "kind": "tensor", "semantic": "up_scales", "role": "weights" },
104
+ "upBiasT": { "kind": "tensor", "semantic": "up_bias", "role": "weights", "required": false },
105
+ "yT": { "kind": "tensor", "semantic": "Y", "role": "output" },
106
+ "residualT": { "kind": "tensor", "semantic": "input_skip_bias_sum", "role": "output", "required": false }
107
+ },
108
+ "tunables": { "TILE_N": 8, "LANES": 8, "NORM_WORKGROUP_SIZE": 128, "ROW_TILE": 8 },
109
+ "derive": {
110
+ "aRows": "numel(shapes.aT) / max(1, attrs.K)",
111
+ "rowTile": "1 if aRows <= 1 else min(aRows, tunables.ROW_TILE)",
112
+ "rowGroups": "ceilDiv(aRows, rowTile)",
113
+ "kBlocks": "dim(shapes.gateBT, 1)",
114
+ "blobSize": "dim(shapes.gateBT, 2)",
115
+ "codesPerByte": "8 / attrs.bits",
116
+ "codeMask": "3 if attrs.bits == 2 else (15 if attrs.bits == 4 else 255)",
117
+ "epsilonValue": "attrs.epsilon",
118
+ "bitsSupported": "attrs.bits == 2 or attrs.bits == 4 or attrs.bits == 8",
119
+ "weightShapeOk": "ranks.gateBT == 3 and ranks.upBT == 3 and dim(shapes.gateBT, 0) == attrs.N and dim(shapes.upBT, 0) == attrs.N and dim(shapes.upBT, 1) == kBlocks and dim(shapes.upBT, 2) == blobSize and kBlocks == ceilDiv(attrs.K, attrs.block_size) and blobSize * 8 == attrs.block_size * attrs.bits",
120
+ "scaleShapeOk": "ranks.gateScalesT == 2 and ranks.upScalesT == 2 and dim(shapes.gateScalesT, 0) == attrs.N and dim(shapes.gateScalesT, 1) == kBlocks and dim(shapes.upScalesT, 0) == attrs.N and dim(shapes.upScalesT, 1) == kBlocks",
121
+ "ioShapeOk": "(ranks.aT == 2 or ranks.aT == 3) and dim(shapes.aT, ranks.aT - 1) == attrs.K and ranks.yT == ranks.aT and dim(shapes.yT, ranks.yT - 1) == attrs.N and sameShape(prefix(shapes.yT, ranks.yT - 1), prefix(shapes.aT, ranks.aT - 1))",
122
+ "biasShapeOk": "(ranks.gateBiasT == 1 and dim(shapes.gateBiasT, 0) == attrs.N if present.gateBiasT else true) and (ranks.upBiasT == 1 and dim(shapes.upBiasT, 0) == attrs.N if present.upBiasT else true)",
123
+ "dtypeOk": "tensorDtypes.gateScalesT == tensorDtypes.aT and tensorDtypes.upScalesT == tensorDtypes.aT and tensorDtypes.yT == tensorDtypes.aT and f16Ok(tensorDtypes.aT)",
124
+ "lanesPow2": "tunables.LANES == pow2ceil(tunables.LANES)",
125
+ "mlpShapeOk": "bitsSupported and weightShapeOk and scaleShapeOk and ioShapeOk and biasShapeOk and dtypeOk and lanesPow2 and attrs.K > 0 and attrs.N > 0 and attrs.block_size > 0",
126
+ "normContractOk": "present.normScaleT and ranks.normScaleT == 1 and dim(shapes.normScaleT, 0) == attrs.K and tensorDtypes.normScaleT == tensorDtypes.aT and (sameShape(shapes.skipT, shapes.aT) and tensorDtypes.skipT == tensorDtypes.aT if present.skipT else true) and (sameShape(shapes.residualT, shapes.aT) and tensorDtypes.residualT == tensorDtypes.aT and present.skipT if present.residualT else true)",
127
+ "gateUpDispatchFits": "ceilDiv(attrs.N, tunables.TILE_N) <= device.limits.maxComputeWorkgroupsPerDimension and aRows <= device.limits.maxComputeWorkgroupsPerDimension and tunables.TILE_N * tunables.LANES <= device.limits.maxComputeInvocationsPerWorkgroup and tunables.TILE_N * tunables.LANES <= device.limits.maxComputeWorkgroupSizeX",
128
+ "normDispatchFits": "tunables.NORM_WORKGROUP_SIZE <= device.limits.maxComputeInvocationsPerWorkgroup and tunables.NORM_WORKGROUP_SIZE <= device.limits.maxComputeWorkgroupSizeX",
129
+ "biasPresence_nogb_noub": "not present.gateBiasT and not present.upBiasT",
130
+ "biasPresence_nogb_ub": "not present.gateBiasT and present.upBiasT",
131
+ "biasPresence_gb_noub": "present.gateBiasT and not present.upBiasT",
132
+ "biasPresence_gb_ub": "present.gateBiasT and present.upBiasT"
133
+ },
134
+ "constants": {
135
+ "aScalar": "\"f16\" if tensorDtypes.aT == \"float16\" else \"f32\"",
136
+ "scalar": "\"f16\" if tensorDtypes.aT == \"float16\" else \"f32\"",
137
+ "usesF16": "tensorDtypes.aT == \"float16\"",
138
+ "K": "attrs.K",
139
+ "N": "attrs.N",
140
+ "blockSize": "attrs.block_size",
141
+ "kBlocks": "kBlocks",
142
+ "blobSize": "blobSize",
143
+ "bits": "attrs.bits",
144
+ "codesPerByte": "codesPerByte",
145
+ "codeMask": "codeMask",
146
+ "defaultZero": "\"2.0\" if attrs.bits == 2 else (\"8.0\" if attrs.bits == 4 else \"128.0\")",
147
+ "tileN": "tunables.TILE_N",
148
+ "lanes": "tunables.LANES",
149
+ "rowTile": "rowTile",
150
+ "rows": "aRows",
151
+ "hidden": "attrs.K",
152
+ "workgroupSize": "tunables.NORM_WORKGROUP_SIZE",
153
+ "epsilon": "epsilonValue",
154
+ "hasGateBias": "present.gateBiasT",
155
+ "hasUpBias": "present.upBiasT",
156
+ "hasSkip": "present.skipT",
157
+ "writeResidual": "present.residualT",
158
+ "K_LEN": "attrs.K",
159
+ "N_LEN": "attrs.N"
160
+ },
161
+ "bindingSets": {
162
+ "normFull": [
163
+ {
164
+ "name": "a",
165
+ "arg": "aT",
166
+ "semantic": "A",
167
+ "buffer": { "type": "read-only-storage" },
168
+ "elementType": "$aScalar"
169
+ },
170
+ {
171
+ "name": "skip",
172
+ "arg": "skipT",
173
+ "semantic": "skip",
174
+ "buffer": { "type": "read-only-storage" },
175
+ "elementType": "$aScalar"
176
+ },
177
+ {
178
+ "name": "norm_scale",
179
+ "arg": "normScaleT",
180
+ "semantic": "norm_scale",
181
+ "buffer": { "type": "read-only-storage" },
182
+ "elementType": "$aScalar",
183
+ "length": "$K_LEN"
184
+ },
185
+ { "name": "normed", "semantic": "normedA", "buffer": { "type": "storage" }, "elementType": "f32" },
186
+ {
187
+ "name": "residual",
188
+ "arg": "residualT",
189
+ "semantic": "input_skip_bias_sum",
190
+ "buffer": { "type": "storage" },
191
+ "elementType": "$aScalar"
192
+ },
193
+ {
194
+ "name": "params",
195
+ "semantic": "kernel.params",
196
+ "buffer": { "type": "uniform" },
197
+ "struct": { "name": "Params", "fields": [{ "name": "rows", "type": "u32", "value": "aRows" }] }
198
+ }
199
+ ],
200
+ "normSkip": [
201
+ {
202
+ "name": "a",
203
+ "arg": "aT",
204
+ "semantic": "A",
205
+ "buffer": { "type": "read-only-storage" },
206
+ "elementType": "$aScalar"
207
+ },
208
+ {
209
+ "name": "skip",
210
+ "arg": "skipT",
211
+ "semantic": "skip",
212
+ "buffer": { "type": "read-only-storage" },
213
+ "elementType": "$aScalar"
214
+ },
215
+ {
216
+ "name": "norm_scale",
217
+ "arg": "normScaleT",
218
+ "semantic": "norm_scale",
219
+ "buffer": { "type": "read-only-storage" },
220
+ "elementType": "$aScalar",
221
+ "length": "$K_LEN"
222
+ },
223
+ { "name": "normed", "semantic": "normedA", "buffer": { "type": "storage" }, "elementType": "f32" },
224
+ {
225
+ "name": "params",
226
+ "semantic": "kernel.params",
227
+ "buffer": { "type": "uniform" },
228
+ "struct": { "name": "Params", "fields": [{ "name": "rows", "type": "u32", "value": "aRows" }] }
229
+ }
230
+ ],
231
+ "normOnly": [
232
+ {
233
+ "name": "a",
234
+ "arg": "aT",
235
+ "semantic": "A",
236
+ "buffer": { "type": "read-only-storage" },
237
+ "elementType": "$aScalar"
238
+ },
239
+ {
240
+ "name": "norm_scale",
241
+ "arg": "normScaleT",
242
+ "semantic": "norm_scale",
243
+ "buffer": { "type": "read-only-storage" },
244
+ "elementType": "$aScalar",
245
+ "length": "$K_LEN"
246
+ },
247
+ { "name": "normed", "semantic": "normedA", "buffer": { "type": "storage" }, "elementType": "f32" },
248
+ {
249
+ "name": "params",
250
+ "semantic": "kernel.params",
251
+ "buffer": { "type": "uniform" },
252
+ "struct": { "name": "Params", "fields": [{ "name": "rows", "type": "u32", "value": "aRows" }] }
253
+ }
254
+ ],
255
+ "gateUpAFull": [
256
+ {
257
+ "name": "a",
258
+ "arg": "aT",
259
+ "semantic": "A",
260
+ "buffer": { "type": "read-only-storage" },
261
+ "elementType": "$aScalar"
262
+ },
263
+ {
264
+ "name": "gate_b",
265
+ "arg": "gateBT",
266
+ "semantic": "gate_B",
267
+ "buffer": { "type": "read-only-storage" },
268
+ "elementType": "u32"
269
+ },
270
+ {
271
+ "name": "gate_scales",
272
+ "arg": "gateScalesT",
273
+ "semantic": "gate_scales",
274
+ "buffer": { "type": "read-only-storage" },
275
+ "elementType": "$aScalar"
276
+ },
277
+ {
278
+ "name": "gate_bias",
279
+ "arg": "gateBiasT",
280
+ "semantic": "gate_bias",
281
+ "buffer": { "type": "read-only-storage" },
282
+ "elementType": "$aScalar",
283
+ "length": "$N_LEN"
284
+ },
285
+ {
286
+ "name": "up_b",
287
+ "arg": "upBT",
288
+ "semantic": "up_B",
289
+ "buffer": { "type": "read-only-storage" },
290
+ "elementType": "u32"
291
+ },
292
+ {
293
+ "name": "up_scales",
294
+ "arg": "upScalesT",
295
+ "semantic": "up_scales",
296
+ "buffer": { "type": "read-only-storage" },
297
+ "elementType": "$aScalar"
298
+ },
299
+ {
300
+ "name": "up_bias",
301
+ "arg": "upBiasT",
302
+ "semantic": "up_bias",
303
+ "buffer": { "type": "read-only-storage" },
304
+ "elementType": "$aScalar",
305
+ "length": "$N_LEN"
306
+ },
307
+ { "name": "y", "arg": "yT", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$aScalar" }
308
+ ],
309
+ "gateUpNormedFull": [
310
+ { "name": "normed", "semantic": "normedA", "buffer": { "type": "read-only-storage" }, "elementType": "f32" },
311
+ {
312
+ "name": "gate_b",
313
+ "arg": "gateBT",
314
+ "semantic": "gate_B",
315
+ "buffer": { "type": "read-only-storage" },
316
+ "elementType": "u32"
317
+ },
318
+ {
319
+ "name": "gate_scales",
320
+ "arg": "gateScalesT",
321
+ "semantic": "gate_scales",
322
+ "buffer": { "type": "read-only-storage" },
323
+ "elementType": "$aScalar"
324
+ },
325
+ {
326
+ "name": "gate_bias",
327
+ "arg": "gateBiasT",
328
+ "semantic": "gate_bias",
329
+ "buffer": { "type": "read-only-storage" },
330
+ "elementType": "$aScalar",
331
+ "length": "$N_LEN"
332
+ },
333
+ {
334
+ "name": "up_b",
335
+ "arg": "upBT",
336
+ "semantic": "up_B",
337
+ "buffer": { "type": "read-only-storage" },
338
+ "elementType": "u32"
339
+ },
340
+ {
341
+ "name": "up_scales",
342
+ "arg": "upScalesT",
343
+ "semantic": "up_scales",
344
+ "buffer": { "type": "read-only-storage" },
345
+ "elementType": "$aScalar"
346
+ },
347
+ {
348
+ "name": "up_bias",
349
+ "arg": "upBiasT",
350
+ "semantic": "up_bias",
351
+ "buffer": { "type": "read-only-storage" },
352
+ "elementType": "$aScalar",
353
+ "length": "$N_LEN"
354
+ },
355
+ { "name": "y", "arg": "yT", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$aScalar" }
356
+ ],
357
+ "fusedFull": [
358
+ {
359
+ "name": "a",
360
+ "arg": "aT",
361
+ "semantic": "A",
362
+ "buffer": { "type": "read-only-storage" },
363
+ "elementType": "$aScalar"
364
+ },
365
+ {
366
+ "name": "skip",
367
+ "arg": "skipT",
368
+ "semantic": "skip",
369
+ "buffer": { "type": "read-only-storage" },
370
+ "elementType": "$aScalar"
371
+ },
372
+ {
373
+ "name": "norm_scale",
374
+ "arg": "normScaleT",
375
+ "semantic": "norm_scale",
376
+ "buffer": { "type": "read-only-storage" },
377
+ "elementType": "$aScalar",
378
+ "length": "$K_LEN"
379
+ },
380
+ {
381
+ "name": "gate_b",
382
+ "arg": "gateBT",
383
+ "semantic": "gate_B",
384
+ "buffer": { "type": "read-only-storage" },
385
+ "elementType": "u32"
386
+ },
387
+ {
388
+ "name": "gate_scales",
389
+ "arg": "gateScalesT",
390
+ "semantic": "gate_scales",
391
+ "buffer": { "type": "read-only-storage" },
392
+ "elementType": "$aScalar"
393
+ },
394
+ {
395
+ "name": "gate_bias",
396
+ "arg": "gateBiasT",
397
+ "semantic": "gate_bias",
398
+ "buffer": { "type": "read-only-storage" },
399
+ "elementType": "$aScalar",
400
+ "length": "$N_LEN"
401
+ },
402
+ {
403
+ "name": "up_b",
404
+ "arg": "upBT",
405
+ "semantic": "up_B",
406
+ "buffer": { "type": "read-only-storage" },
407
+ "elementType": "u32"
408
+ },
409
+ {
410
+ "name": "up_scales",
411
+ "arg": "upScalesT",
412
+ "semantic": "up_scales",
413
+ "buffer": { "type": "read-only-storage" },
414
+ "elementType": "$aScalar"
415
+ },
416
+ {
417
+ "name": "up_bias",
418
+ "arg": "upBiasT",
419
+ "semantic": "up_bias",
420
+ "buffer": { "type": "read-only-storage" },
421
+ "elementType": "$aScalar",
422
+ "length": "$N_LEN"
423
+ },
424
+ { "name": "y", "arg": "yT", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$aScalar" },
425
+ {
426
+ "name": "residual",
427
+ "arg": "residualT",
428
+ "semantic": "input_skip_bias_sum",
429
+ "buffer": { "type": "storage" },
430
+ "elementType": "$aScalar"
431
+ }
432
+ ],
433
+ "gateUpA_nogb_noub": [
434
+ {
435
+ "name": "a",
436
+ "arg": "aT",
437
+ "semantic": "A",
438
+ "buffer": { "type": "read-only-storage" },
439
+ "elementType": "$aScalar"
440
+ },
441
+ {
442
+ "name": "gate_b",
443
+ "arg": "gateBT",
444
+ "semantic": "gate_B",
445
+ "buffer": { "type": "read-only-storage" },
446
+ "elementType": "u32"
447
+ },
448
+ {
449
+ "name": "gate_scales",
450
+ "arg": "gateScalesT",
451
+ "semantic": "gate_scales",
452
+ "buffer": { "type": "read-only-storage" },
453
+ "elementType": "$aScalar"
454
+ },
455
+ {
456
+ "name": "up_b",
457
+ "arg": "upBT",
458
+ "semantic": "up_B",
459
+ "buffer": { "type": "read-only-storage" },
460
+ "elementType": "u32"
461
+ },
462
+ {
463
+ "name": "up_scales",
464
+ "arg": "upScalesT",
465
+ "semantic": "up_scales",
466
+ "buffer": { "type": "read-only-storage" },
467
+ "elementType": "$aScalar"
468
+ },
469
+ { "name": "y", "arg": "yT", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$aScalar" }
470
+ ],
471
+ "gateUpNormed_nogb_noub": [
472
+ { "name": "normed", "semantic": "normedA", "buffer": { "type": "read-only-storage" }, "elementType": "f32" },
473
+ {
474
+ "name": "gate_b",
475
+ "arg": "gateBT",
476
+ "semantic": "gate_B",
477
+ "buffer": { "type": "read-only-storage" },
478
+ "elementType": "u32"
479
+ },
480
+ {
481
+ "name": "gate_scales",
482
+ "arg": "gateScalesT",
483
+ "semantic": "gate_scales",
484
+ "buffer": { "type": "read-only-storage" },
485
+ "elementType": "$aScalar"
486
+ },
487
+ {
488
+ "name": "up_b",
489
+ "arg": "upBT",
490
+ "semantic": "up_B",
491
+ "buffer": { "type": "read-only-storage" },
492
+ "elementType": "u32"
493
+ },
494
+ {
495
+ "name": "up_scales",
496
+ "arg": "upScalesT",
497
+ "semantic": "up_scales",
498
+ "buffer": { "type": "read-only-storage" },
499
+ "elementType": "$aScalar"
500
+ },
501
+ { "name": "y", "arg": "yT", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$aScalar" }
502
+ ],
503
+ "fused_norm_nogb_noub": [
504
+ {
505
+ "name": "a",
506
+ "arg": "aT",
507
+ "semantic": "A",
508
+ "buffer": { "type": "read-only-storage" },
509
+ "elementType": "$aScalar"
510
+ },
511
+ {
512
+ "name": "norm_scale",
513
+ "arg": "normScaleT",
514
+ "semantic": "norm_scale",
515
+ "buffer": { "type": "read-only-storage" },
516
+ "elementType": "$aScalar",
517
+ "length": "$K_LEN"
518
+ },
519
+ {
520
+ "name": "gate_b",
521
+ "arg": "gateBT",
522
+ "semantic": "gate_B",
523
+ "buffer": { "type": "read-only-storage" },
524
+ "elementType": "u32"
525
+ },
526
+ {
527
+ "name": "gate_scales",
528
+ "arg": "gateScalesT",
529
+ "semantic": "gate_scales",
530
+ "buffer": { "type": "read-only-storage" },
531
+ "elementType": "$aScalar"
532
+ },
533
+ {
534
+ "name": "up_b",
535
+ "arg": "upBT",
536
+ "semantic": "up_B",
537
+ "buffer": { "type": "read-only-storage" },
538
+ "elementType": "u32"
539
+ },
540
+ {
541
+ "name": "up_scales",
542
+ "arg": "upScalesT",
543
+ "semantic": "up_scales",
544
+ "buffer": { "type": "read-only-storage" },
545
+ "elementType": "$aScalar"
546
+ },
547
+ { "name": "y", "arg": "yT", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$aScalar" }
548
+ ],
549
+ "fused_skip_nogb_noub": [
550
+ {
551
+ "name": "a",
552
+ "arg": "aT",
553
+ "semantic": "A",
554
+ "buffer": { "type": "read-only-storage" },
555
+ "elementType": "$aScalar"
556
+ },
557
+ {
558
+ "name": "skip",
559
+ "arg": "skipT",
560
+ "semantic": "skip",
561
+ "buffer": { "type": "read-only-storage" },
562
+ "elementType": "$aScalar"
563
+ },
564
+ {
565
+ "name": "norm_scale",
566
+ "arg": "normScaleT",
567
+ "semantic": "norm_scale",
568
+ "buffer": { "type": "read-only-storage" },
569
+ "elementType": "$aScalar",
570
+ "length": "$K_LEN"
571
+ },
572
+ {
573
+ "name": "gate_b",
574
+ "arg": "gateBT",
575
+ "semantic": "gate_B",
576
+ "buffer": { "type": "read-only-storage" },
577
+ "elementType": "u32"
578
+ },
579
+ {
580
+ "name": "gate_scales",
581
+ "arg": "gateScalesT",
582
+ "semantic": "gate_scales",
583
+ "buffer": { "type": "read-only-storage" },
584
+ "elementType": "$aScalar"
585
+ },
586
+ {
587
+ "name": "up_b",
588
+ "arg": "upBT",
589
+ "semantic": "up_B",
590
+ "buffer": { "type": "read-only-storage" },
591
+ "elementType": "u32"
592
+ },
593
+ {
594
+ "name": "up_scales",
595
+ "arg": "upScalesT",
596
+ "semantic": "up_scales",
597
+ "buffer": { "type": "read-only-storage" },
598
+ "elementType": "$aScalar"
599
+ },
600
+ { "name": "y", "arg": "yT", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$aScalar" }
601
+ ],
602
+ "fused_skipsum_nogb_noub": [
603
+ {
604
+ "name": "a",
605
+ "arg": "aT",
606
+ "semantic": "A",
607
+ "buffer": { "type": "read-only-storage" },
608
+ "elementType": "$aScalar"
609
+ },
610
+ {
611
+ "name": "skip",
612
+ "arg": "skipT",
613
+ "semantic": "skip",
614
+ "buffer": { "type": "read-only-storage" },
615
+ "elementType": "$aScalar"
616
+ },
617
+ {
618
+ "name": "norm_scale",
619
+ "arg": "normScaleT",
620
+ "semantic": "norm_scale",
621
+ "buffer": { "type": "read-only-storage" },
622
+ "elementType": "$aScalar",
623
+ "length": "$K_LEN"
624
+ },
625
+ {
626
+ "name": "gate_b",
627
+ "arg": "gateBT",
628
+ "semantic": "gate_B",
629
+ "buffer": { "type": "read-only-storage" },
630
+ "elementType": "u32"
631
+ },
632
+ {
633
+ "name": "gate_scales",
634
+ "arg": "gateScalesT",
635
+ "semantic": "gate_scales",
636
+ "buffer": { "type": "read-only-storage" },
637
+ "elementType": "$aScalar"
638
+ },
639
+ {
640
+ "name": "up_b",
641
+ "arg": "upBT",
642
+ "semantic": "up_B",
643
+ "buffer": { "type": "read-only-storage" },
644
+ "elementType": "u32"
645
+ },
646
+ {
647
+ "name": "up_scales",
648
+ "arg": "upScalesT",
649
+ "semantic": "up_scales",
650
+ "buffer": { "type": "read-only-storage" },
651
+ "elementType": "$aScalar"
652
+ },
653
+ { "name": "y", "arg": "yT", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$aScalar" },
654
+ {
655
+ "name": "residual",
656
+ "arg": "residualT",
657
+ "semantic": "input_skip_bias_sum",
658
+ "buffer": { "type": "storage" },
659
+ "elementType": "$aScalar"
660
+ }
661
+ ],
662
+ "gateUpA_nogb_ub": [
663
+ {
664
+ "name": "a",
665
+ "arg": "aT",
666
+ "semantic": "A",
667
+ "buffer": { "type": "read-only-storage" },
668
+ "elementType": "$aScalar"
669
+ },
670
+ {
671
+ "name": "gate_b",
672
+ "arg": "gateBT",
673
+ "semantic": "gate_B",
674
+ "buffer": { "type": "read-only-storage" },
675
+ "elementType": "u32"
676
+ },
677
+ {
678
+ "name": "gate_scales",
679
+ "arg": "gateScalesT",
680
+ "semantic": "gate_scales",
681
+ "buffer": { "type": "read-only-storage" },
682
+ "elementType": "$aScalar"
683
+ },
684
+ {
685
+ "name": "up_b",
686
+ "arg": "upBT",
687
+ "semantic": "up_B",
688
+ "buffer": { "type": "read-only-storage" },
689
+ "elementType": "u32"
690
+ },
691
+ {
692
+ "name": "up_scales",
693
+ "arg": "upScalesT",
694
+ "semantic": "up_scales",
695
+ "buffer": { "type": "read-only-storage" },
696
+ "elementType": "$aScalar"
697
+ },
698
+ {
699
+ "name": "up_bias",
700
+ "arg": "upBiasT",
701
+ "semantic": "up_bias",
702
+ "buffer": { "type": "read-only-storage" },
703
+ "elementType": "$aScalar",
704
+ "length": "$N_LEN"
705
+ },
706
+ { "name": "y", "arg": "yT", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$aScalar" }
707
+ ],
708
+ "gateUpNormed_nogb_ub": [
709
+ { "name": "normed", "semantic": "normedA", "buffer": { "type": "read-only-storage" }, "elementType": "f32" },
710
+ {
711
+ "name": "gate_b",
712
+ "arg": "gateBT",
713
+ "semantic": "gate_B",
714
+ "buffer": { "type": "read-only-storage" },
715
+ "elementType": "u32"
716
+ },
717
+ {
718
+ "name": "gate_scales",
719
+ "arg": "gateScalesT",
720
+ "semantic": "gate_scales",
721
+ "buffer": { "type": "read-only-storage" },
722
+ "elementType": "$aScalar"
723
+ },
724
+ {
725
+ "name": "up_b",
726
+ "arg": "upBT",
727
+ "semantic": "up_B",
728
+ "buffer": { "type": "read-only-storage" },
729
+ "elementType": "u32"
730
+ },
731
+ {
732
+ "name": "up_scales",
733
+ "arg": "upScalesT",
734
+ "semantic": "up_scales",
735
+ "buffer": { "type": "read-only-storage" },
736
+ "elementType": "$aScalar"
737
+ },
738
+ {
739
+ "name": "up_bias",
740
+ "arg": "upBiasT",
741
+ "semantic": "up_bias",
742
+ "buffer": { "type": "read-only-storage" },
743
+ "elementType": "$aScalar",
744
+ "length": "$N_LEN"
745
+ },
746
+ { "name": "y", "arg": "yT", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$aScalar" }
747
+ ],
748
+ "fused_norm_nogb_ub": [
749
+ {
750
+ "name": "a",
751
+ "arg": "aT",
752
+ "semantic": "A",
753
+ "buffer": { "type": "read-only-storage" },
754
+ "elementType": "$aScalar"
755
+ },
756
+ {
757
+ "name": "norm_scale",
758
+ "arg": "normScaleT",
759
+ "semantic": "norm_scale",
760
+ "buffer": { "type": "read-only-storage" },
761
+ "elementType": "$aScalar",
762
+ "length": "$K_LEN"
763
+ },
764
+ {
765
+ "name": "gate_b",
766
+ "arg": "gateBT",
767
+ "semantic": "gate_B",
768
+ "buffer": { "type": "read-only-storage" },
769
+ "elementType": "u32"
770
+ },
771
+ {
772
+ "name": "gate_scales",
773
+ "arg": "gateScalesT",
774
+ "semantic": "gate_scales",
775
+ "buffer": { "type": "read-only-storage" },
776
+ "elementType": "$aScalar"
777
+ },
778
+ {
779
+ "name": "up_b",
780
+ "arg": "upBT",
781
+ "semantic": "up_B",
782
+ "buffer": { "type": "read-only-storage" },
783
+ "elementType": "u32"
784
+ },
785
+ {
786
+ "name": "up_scales",
787
+ "arg": "upScalesT",
788
+ "semantic": "up_scales",
789
+ "buffer": { "type": "read-only-storage" },
790
+ "elementType": "$aScalar"
791
+ },
792
+ {
793
+ "name": "up_bias",
794
+ "arg": "upBiasT",
795
+ "semantic": "up_bias",
796
+ "buffer": { "type": "read-only-storage" },
797
+ "elementType": "$aScalar",
798
+ "length": "$N_LEN"
799
+ },
800
+ { "name": "y", "arg": "yT", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$aScalar" }
801
+ ],
802
+ "fused_skip_nogb_ub": [
803
+ {
804
+ "name": "a",
805
+ "arg": "aT",
806
+ "semantic": "A",
807
+ "buffer": { "type": "read-only-storage" },
808
+ "elementType": "$aScalar"
809
+ },
810
+ {
811
+ "name": "skip",
812
+ "arg": "skipT",
813
+ "semantic": "skip",
814
+ "buffer": { "type": "read-only-storage" },
815
+ "elementType": "$aScalar"
816
+ },
817
+ {
818
+ "name": "norm_scale",
819
+ "arg": "normScaleT",
820
+ "semantic": "norm_scale",
821
+ "buffer": { "type": "read-only-storage" },
822
+ "elementType": "$aScalar",
823
+ "length": "$K_LEN"
824
+ },
825
+ {
826
+ "name": "gate_b",
827
+ "arg": "gateBT",
828
+ "semantic": "gate_B",
829
+ "buffer": { "type": "read-only-storage" },
830
+ "elementType": "u32"
831
+ },
832
+ {
833
+ "name": "gate_scales",
834
+ "arg": "gateScalesT",
835
+ "semantic": "gate_scales",
836
+ "buffer": { "type": "read-only-storage" },
837
+ "elementType": "$aScalar"
838
+ },
839
+ {
840
+ "name": "up_b",
841
+ "arg": "upBT",
842
+ "semantic": "up_B",
843
+ "buffer": { "type": "read-only-storage" },
844
+ "elementType": "u32"
845
+ },
846
+ {
847
+ "name": "up_scales",
848
+ "arg": "upScalesT",
849
+ "semantic": "up_scales",
850
+ "buffer": { "type": "read-only-storage" },
851
+ "elementType": "$aScalar"
852
+ },
853
+ {
854
+ "name": "up_bias",
855
+ "arg": "upBiasT",
856
+ "semantic": "up_bias",
857
+ "buffer": { "type": "read-only-storage" },
858
+ "elementType": "$aScalar",
859
+ "length": "$N_LEN"
860
+ },
861
+ { "name": "y", "arg": "yT", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$aScalar" }
862
+ ],
863
+ "fused_skipsum_nogb_ub": [
864
+ {
865
+ "name": "a",
866
+ "arg": "aT",
867
+ "semantic": "A",
868
+ "buffer": { "type": "read-only-storage" },
869
+ "elementType": "$aScalar"
870
+ },
871
+ {
872
+ "name": "skip",
873
+ "arg": "skipT",
874
+ "semantic": "skip",
875
+ "buffer": { "type": "read-only-storage" },
876
+ "elementType": "$aScalar"
877
+ },
878
+ {
879
+ "name": "norm_scale",
880
+ "arg": "normScaleT",
881
+ "semantic": "norm_scale",
882
+ "buffer": { "type": "read-only-storage" },
883
+ "elementType": "$aScalar",
884
+ "length": "$K_LEN"
885
+ },
886
+ {
887
+ "name": "gate_b",
888
+ "arg": "gateBT",
889
+ "semantic": "gate_B",
890
+ "buffer": { "type": "read-only-storage" },
891
+ "elementType": "u32"
892
+ },
893
+ {
894
+ "name": "gate_scales",
895
+ "arg": "gateScalesT",
896
+ "semantic": "gate_scales",
897
+ "buffer": { "type": "read-only-storage" },
898
+ "elementType": "$aScalar"
899
+ },
900
+ {
901
+ "name": "up_b",
902
+ "arg": "upBT",
903
+ "semantic": "up_B",
904
+ "buffer": { "type": "read-only-storage" },
905
+ "elementType": "u32"
906
+ },
907
+ {
908
+ "name": "up_scales",
909
+ "arg": "upScalesT",
910
+ "semantic": "up_scales",
911
+ "buffer": { "type": "read-only-storage" },
912
+ "elementType": "$aScalar"
913
+ },
914
+ {
915
+ "name": "up_bias",
916
+ "arg": "upBiasT",
917
+ "semantic": "up_bias",
918
+ "buffer": { "type": "read-only-storage" },
919
+ "elementType": "$aScalar",
920
+ "length": "$N_LEN"
921
+ },
922
+ { "name": "y", "arg": "yT", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$aScalar" },
923
+ {
924
+ "name": "residual",
925
+ "arg": "residualT",
926
+ "semantic": "input_skip_bias_sum",
927
+ "buffer": { "type": "storage" },
928
+ "elementType": "$aScalar"
929
+ }
930
+ ],
931
+ "gateUpA_gb_noub": [
932
+ {
933
+ "name": "a",
934
+ "arg": "aT",
935
+ "semantic": "A",
936
+ "buffer": { "type": "read-only-storage" },
937
+ "elementType": "$aScalar"
938
+ },
939
+ {
940
+ "name": "gate_b",
941
+ "arg": "gateBT",
942
+ "semantic": "gate_B",
943
+ "buffer": { "type": "read-only-storage" },
944
+ "elementType": "u32"
945
+ },
946
+ {
947
+ "name": "gate_scales",
948
+ "arg": "gateScalesT",
949
+ "semantic": "gate_scales",
950
+ "buffer": { "type": "read-only-storage" },
951
+ "elementType": "$aScalar"
952
+ },
953
+ {
954
+ "name": "gate_bias",
955
+ "arg": "gateBiasT",
956
+ "semantic": "gate_bias",
957
+ "buffer": { "type": "read-only-storage" },
958
+ "elementType": "$aScalar",
959
+ "length": "$N_LEN"
960
+ },
961
+ {
962
+ "name": "up_b",
963
+ "arg": "upBT",
964
+ "semantic": "up_B",
965
+ "buffer": { "type": "read-only-storage" },
966
+ "elementType": "u32"
967
+ },
968
+ {
969
+ "name": "up_scales",
970
+ "arg": "upScalesT",
971
+ "semantic": "up_scales",
972
+ "buffer": { "type": "read-only-storage" },
973
+ "elementType": "$aScalar"
974
+ },
975
+ { "name": "y", "arg": "yT", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$aScalar" }
976
+ ],
977
+ "gateUpNormed_gb_noub": [
978
+ { "name": "normed", "semantic": "normedA", "buffer": { "type": "read-only-storage" }, "elementType": "f32" },
979
+ {
980
+ "name": "gate_b",
981
+ "arg": "gateBT",
982
+ "semantic": "gate_B",
983
+ "buffer": { "type": "read-only-storage" },
984
+ "elementType": "u32"
985
+ },
986
+ {
987
+ "name": "gate_scales",
988
+ "arg": "gateScalesT",
989
+ "semantic": "gate_scales",
990
+ "buffer": { "type": "read-only-storage" },
991
+ "elementType": "$aScalar"
992
+ },
993
+ {
994
+ "name": "gate_bias",
995
+ "arg": "gateBiasT",
996
+ "semantic": "gate_bias",
997
+ "buffer": { "type": "read-only-storage" },
998
+ "elementType": "$aScalar",
999
+ "length": "$N_LEN"
1000
+ },
1001
+ {
1002
+ "name": "up_b",
1003
+ "arg": "upBT",
1004
+ "semantic": "up_B",
1005
+ "buffer": { "type": "read-only-storage" },
1006
+ "elementType": "u32"
1007
+ },
1008
+ {
1009
+ "name": "up_scales",
1010
+ "arg": "upScalesT",
1011
+ "semantic": "up_scales",
1012
+ "buffer": { "type": "read-only-storage" },
1013
+ "elementType": "$aScalar"
1014
+ },
1015
+ { "name": "y", "arg": "yT", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$aScalar" }
1016
+ ],
1017
+ "fused_norm_gb_noub": [
1018
+ {
1019
+ "name": "a",
1020
+ "arg": "aT",
1021
+ "semantic": "A",
1022
+ "buffer": { "type": "read-only-storage" },
1023
+ "elementType": "$aScalar"
1024
+ },
1025
+ {
1026
+ "name": "norm_scale",
1027
+ "arg": "normScaleT",
1028
+ "semantic": "norm_scale",
1029
+ "buffer": { "type": "read-only-storage" },
1030
+ "elementType": "$aScalar",
1031
+ "length": "$K_LEN"
1032
+ },
1033
+ {
1034
+ "name": "gate_b",
1035
+ "arg": "gateBT",
1036
+ "semantic": "gate_B",
1037
+ "buffer": { "type": "read-only-storage" },
1038
+ "elementType": "u32"
1039
+ },
1040
+ {
1041
+ "name": "gate_scales",
1042
+ "arg": "gateScalesT",
1043
+ "semantic": "gate_scales",
1044
+ "buffer": { "type": "read-only-storage" },
1045
+ "elementType": "$aScalar"
1046
+ },
1047
+ {
1048
+ "name": "gate_bias",
1049
+ "arg": "gateBiasT",
1050
+ "semantic": "gate_bias",
1051
+ "buffer": { "type": "read-only-storage" },
1052
+ "elementType": "$aScalar",
1053
+ "length": "$N_LEN"
1054
+ },
1055
+ {
1056
+ "name": "up_b",
1057
+ "arg": "upBT",
1058
+ "semantic": "up_B",
1059
+ "buffer": { "type": "read-only-storage" },
1060
+ "elementType": "u32"
1061
+ },
1062
+ {
1063
+ "name": "up_scales",
1064
+ "arg": "upScalesT",
1065
+ "semantic": "up_scales",
1066
+ "buffer": { "type": "read-only-storage" },
1067
+ "elementType": "$aScalar"
1068
+ },
1069
+ { "name": "y", "arg": "yT", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$aScalar" }
1070
+ ],
1071
+ "fused_skip_gb_noub": [
1072
+ {
1073
+ "name": "a",
1074
+ "arg": "aT",
1075
+ "semantic": "A",
1076
+ "buffer": { "type": "read-only-storage" },
1077
+ "elementType": "$aScalar"
1078
+ },
1079
+ {
1080
+ "name": "skip",
1081
+ "arg": "skipT",
1082
+ "semantic": "skip",
1083
+ "buffer": { "type": "read-only-storage" },
1084
+ "elementType": "$aScalar"
1085
+ },
1086
+ {
1087
+ "name": "norm_scale",
1088
+ "arg": "normScaleT",
1089
+ "semantic": "norm_scale",
1090
+ "buffer": { "type": "read-only-storage" },
1091
+ "elementType": "$aScalar",
1092
+ "length": "$K_LEN"
1093
+ },
1094
+ {
1095
+ "name": "gate_b",
1096
+ "arg": "gateBT",
1097
+ "semantic": "gate_B",
1098
+ "buffer": { "type": "read-only-storage" },
1099
+ "elementType": "u32"
1100
+ },
1101
+ {
1102
+ "name": "gate_scales",
1103
+ "arg": "gateScalesT",
1104
+ "semantic": "gate_scales",
1105
+ "buffer": { "type": "read-only-storage" },
1106
+ "elementType": "$aScalar"
1107
+ },
1108
+ {
1109
+ "name": "gate_bias",
1110
+ "arg": "gateBiasT",
1111
+ "semantic": "gate_bias",
1112
+ "buffer": { "type": "read-only-storage" },
1113
+ "elementType": "$aScalar",
1114
+ "length": "$N_LEN"
1115
+ },
1116
+ {
1117
+ "name": "up_b",
1118
+ "arg": "upBT",
1119
+ "semantic": "up_B",
1120
+ "buffer": { "type": "read-only-storage" },
1121
+ "elementType": "u32"
1122
+ },
1123
+ {
1124
+ "name": "up_scales",
1125
+ "arg": "upScalesT",
1126
+ "semantic": "up_scales",
1127
+ "buffer": { "type": "read-only-storage" },
1128
+ "elementType": "$aScalar"
1129
+ },
1130
+ { "name": "y", "arg": "yT", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$aScalar" }
1131
+ ],
1132
+ "fused_skipsum_gb_noub": [
1133
+ {
1134
+ "name": "a",
1135
+ "arg": "aT",
1136
+ "semantic": "A",
1137
+ "buffer": { "type": "read-only-storage" },
1138
+ "elementType": "$aScalar"
1139
+ },
1140
+ {
1141
+ "name": "skip",
1142
+ "arg": "skipT",
1143
+ "semantic": "skip",
1144
+ "buffer": { "type": "read-only-storage" },
1145
+ "elementType": "$aScalar"
1146
+ },
1147
+ {
1148
+ "name": "norm_scale",
1149
+ "arg": "normScaleT",
1150
+ "semantic": "norm_scale",
1151
+ "buffer": { "type": "read-only-storage" },
1152
+ "elementType": "$aScalar",
1153
+ "length": "$K_LEN"
1154
+ },
1155
+ {
1156
+ "name": "gate_b",
1157
+ "arg": "gateBT",
1158
+ "semantic": "gate_B",
1159
+ "buffer": { "type": "read-only-storage" },
1160
+ "elementType": "u32"
1161
+ },
1162
+ {
1163
+ "name": "gate_scales",
1164
+ "arg": "gateScalesT",
1165
+ "semantic": "gate_scales",
1166
+ "buffer": { "type": "read-only-storage" },
1167
+ "elementType": "$aScalar"
1168
+ },
1169
+ {
1170
+ "name": "gate_bias",
1171
+ "arg": "gateBiasT",
1172
+ "semantic": "gate_bias",
1173
+ "buffer": { "type": "read-only-storage" },
1174
+ "elementType": "$aScalar",
1175
+ "length": "$N_LEN"
1176
+ },
1177
+ {
1178
+ "name": "up_b",
1179
+ "arg": "upBT",
1180
+ "semantic": "up_B",
1181
+ "buffer": { "type": "read-only-storage" },
1182
+ "elementType": "u32"
1183
+ },
1184
+ {
1185
+ "name": "up_scales",
1186
+ "arg": "upScalesT",
1187
+ "semantic": "up_scales",
1188
+ "buffer": { "type": "read-only-storage" },
1189
+ "elementType": "$aScalar"
1190
+ },
1191
+ { "name": "y", "arg": "yT", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$aScalar" },
1192
+ {
1193
+ "name": "residual",
1194
+ "arg": "residualT",
1195
+ "semantic": "input_skip_bias_sum",
1196
+ "buffer": { "type": "storage" },
1197
+ "elementType": "$aScalar"
1198
+ }
1199
+ ],
1200
+ "gateUpA_gb_ub": [
1201
+ {
1202
+ "name": "a",
1203
+ "arg": "aT",
1204
+ "semantic": "A",
1205
+ "buffer": { "type": "read-only-storage" },
1206
+ "elementType": "$aScalar"
1207
+ },
1208
+ {
1209
+ "name": "gate_b",
1210
+ "arg": "gateBT",
1211
+ "semantic": "gate_B",
1212
+ "buffer": { "type": "read-only-storage" },
1213
+ "elementType": "u32"
1214
+ },
1215
+ {
1216
+ "name": "gate_scales",
1217
+ "arg": "gateScalesT",
1218
+ "semantic": "gate_scales",
1219
+ "buffer": { "type": "read-only-storage" },
1220
+ "elementType": "$aScalar"
1221
+ },
1222
+ {
1223
+ "name": "gate_bias",
1224
+ "arg": "gateBiasT",
1225
+ "semantic": "gate_bias",
1226
+ "buffer": { "type": "read-only-storage" },
1227
+ "elementType": "$aScalar",
1228
+ "length": "$N_LEN"
1229
+ },
1230
+ {
1231
+ "name": "up_b",
1232
+ "arg": "upBT",
1233
+ "semantic": "up_B",
1234
+ "buffer": { "type": "read-only-storage" },
1235
+ "elementType": "u32"
1236
+ },
1237
+ {
1238
+ "name": "up_scales",
1239
+ "arg": "upScalesT",
1240
+ "semantic": "up_scales",
1241
+ "buffer": { "type": "read-only-storage" },
1242
+ "elementType": "$aScalar"
1243
+ },
1244
+ {
1245
+ "name": "up_bias",
1246
+ "arg": "upBiasT",
1247
+ "semantic": "up_bias",
1248
+ "buffer": { "type": "read-only-storage" },
1249
+ "elementType": "$aScalar",
1250
+ "length": "$N_LEN"
1251
+ },
1252
+ { "name": "y", "arg": "yT", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$aScalar" }
1253
+ ],
1254
+ "gateUpNormed_gb_ub": [
1255
+ { "name": "normed", "semantic": "normedA", "buffer": { "type": "read-only-storage" }, "elementType": "f32" },
1256
+ {
1257
+ "name": "gate_b",
1258
+ "arg": "gateBT",
1259
+ "semantic": "gate_B",
1260
+ "buffer": { "type": "read-only-storage" },
1261
+ "elementType": "u32"
1262
+ },
1263
+ {
1264
+ "name": "gate_scales",
1265
+ "arg": "gateScalesT",
1266
+ "semantic": "gate_scales",
1267
+ "buffer": { "type": "read-only-storage" },
1268
+ "elementType": "$aScalar"
1269
+ },
1270
+ {
1271
+ "name": "gate_bias",
1272
+ "arg": "gateBiasT",
1273
+ "semantic": "gate_bias",
1274
+ "buffer": { "type": "read-only-storage" },
1275
+ "elementType": "$aScalar",
1276
+ "length": "$N_LEN"
1277
+ },
1278
+ {
1279
+ "name": "up_b",
1280
+ "arg": "upBT",
1281
+ "semantic": "up_B",
1282
+ "buffer": { "type": "read-only-storage" },
1283
+ "elementType": "u32"
1284
+ },
1285
+ {
1286
+ "name": "up_scales",
1287
+ "arg": "upScalesT",
1288
+ "semantic": "up_scales",
1289
+ "buffer": { "type": "read-only-storage" },
1290
+ "elementType": "$aScalar"
1291
+ },
1292
+ {
1293
+ "name": "up_bias",
1294
+ "arg": "upBiasT",
1295
+ "semantic": "up_bias",
1296
+ "buffer": { "type": "read-only-storage" },
1297
+ "elementType": "$aScalar",
1298
+ "length": "$N_LEN"
1299
+ },
1300
+ { "name": "y", "arg": "yT", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$aScalar" }
1301
+ ],
1302
+ "fused_norm_gb_ub": [
1303
+ {
1304
+ "name": "a",
1305
+ "arg": "aT",
1306
+ "semantic": "A",
1307
+ "buffer": { "type": "read-only-storage" },
1308
+ "elementType": "$aScalar"
1309
+ },
1310
+ {
1311
+ "name": "norm_scale",
1312
+ "arg": "normScaleT",
1313
+ "semantic": "norm_scale",
1314
+ "buffer": { "type": "read-only-storage" },
1315
+ "elementType": "$aScalar",
1316
+ "length": "$K_LEN"
1317
+ },
1318
+ {
1319
+ "name": "gate_b",
1320
+ "arg": "gateBT",
1321
+ "semantic": "gate_B",
1322
+ "buffer": { "type": "read-only-storage" },
1323
+ "elementType": "u32"
1324
+ },
1325
+ {
1326
+ "name": "gate_scales",
1327
+ "arg": "gateScalesT",
1328
+ "semantic": "gate_scales",
1329
+ "buffer": { "type": "read-only-storage" },
1330
+ "elementType": "$aScalar"
1331
+ },
1332
+ {
1333
+ "name": "gate_bias",
1334
+ "arg": "gateBiasT",
1335
+ "semantic": "gate_bias",
1336
+ "buffer": { "type": "read-only-storage" },
1337
+ "elementType": "$aScalar",
1338
+ "length": "$N_LEN"
1339
+ },
1340
+ {
1341
+ "name": "up_b",
1342
+ "arg": "upBT",
1343
+ "semantic": "up_B",
1344
+ "buffer": { "type": "read-only-storage" },
1345
+ "elementType": "u32"
1346
+ },
1347
+ {
1348
+ "name": "up_scales",
1349
+ "arg": "upScalesT",
1350
+ "semantic": "up_scales",
1351
+ "buffer": { "type": "read-only-storage" },
1352
+ "elementType": "$aScalar"
1353
+ },
1354
+ {
1355
+ "name": "up_bias",
1356
+ "arg": "upBiasT",
1357
+ "semantic": "up_bias",
1358
+ "buffer": { "type": "read-only-storage" },
1359
+ "elementType": "$aScalar",
1360
+ "length": "$N_LEN"
1361
+ },
1362
+ { "name": "y", "arg": "yT", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$aScalar" }
1363
+ ],
1364
+ "fused_skip_gb_ub": [
1365
+ {
1366
+ "name": "a",
1367
+ "arg": "aT",
1368
+ "semantic": "A",
1369
+ "buffer": { "type": "read-only-storage" },
1370
+ "elementType": "$aScalar"
1371
+ },
1372
+ {
1373
+ "name": "skip",
1374
+ "arg": "skipT",
1375
+ "semantic": "skip",
1376
+ "buffer": { "type": "read-only-storage" },
1377
+ "elementType": "$aScalar"
1378
+ },
1379
+ {
1380
+ "name": "norm_scale",
1381
+ "arg": "normScaleT",
1382
+ "semantic": "norm_scale",
1383
+ "buffer": { "type": "read-only-storage" },
1384
+ "elementType": "$aScalar",
1385
+ "length": "$K_LEN"
1386
+ },
1387
+ {
1388
+ "name": "gate_b",
1389
+ "arg": "gateBT",
1390
+ "semantic": "gate_B",
1391
+ "buffer": { "type": "read-only-storage" },
1392
+ "elementType": "u32"
1393
+ },
1394
+ {
1395
+ "name": "gate_scales",
1396
+ "arg": "gateScalesT",
1397
+ "semantic": "gate_scales",
1398
+ "buffer": { "type": "read-only-storage" },
1399
+ "elementType": "$aScalar"
1400
+ },
1401
+ {
1402
+ "name": "gate_bias",
1403
+ "arg": "gateBiasT",
1404
+ "semantic": "gate_bias",
1405
+ "buffer": { "type": "read-only-storage" },
1406
+ "elementType": "$aScalar",
1407
+ "length": "$N_LEN"
1408
+ },
1409
+ {
1410
+ "name": "up_b",
1411
+ "arg": "upBT",
1412
+ "semantic": "up_B",
1413
+ "buffer": { "type": "read-only-storage" },
1414
+ "elementType": "u32"
1415
+ },
1416
+ {
1417
+ "name": "up_scales",
1418
+ "arg": "upScalesT",
1419
+ "semantic": "up_scales",
1420
+ "buffer": { "type": "read-only-storage" },
1421
+ "elementType": "$aScalar"
1422
+ },
1423
+ {
1424
+ "name": "up_bias",
1425
+ "arg": "upBiasT",
1426
+ "semantic": "up_bias",
1427
+ "buffer": { "type": "read-only-storage" },
1428
+ "elementType": "$aScalar",
1429
+ "length": "$N_LEN"
1430
+ },
1431
+ { "name": "y", "arg": "yT", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$aScalar" }
1432
+ ]
1433
+ },
1434
+ "variants": [
1435
+ {
1436
+ "id": "plain_nogb_noub",
1437
+ "priority": 10,
1438
+ "when": ["mlpShapeOk", "not present.normScaleT", "not present.skipT", "not present.residualT", "biasPresence_nogb_noub", "gateUpDispatchFits"],
1439
+ "constants": { "inlineNorm": "0", "fromNormed": "0" },
1440
+ "passes": [
1441
+ {
1442
+ "id": "main",
1443
+ "name": "MatMulNBitsMlp.GateUp",
1444
+ "shader": "mlp-gate-up.wgsl.jinja",
1445
+ "bindings": "gateUpA_nogb_noub",
1446
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "rowGroups" }
1447
+ }
1448
+ ]
1449
+ },
1450
+ {
1451
+ "id": "plain_nogb_ub",
1452
+ "priority": 10,
1453
+ "when": ["mlpShapeOk", "not present.normScaleT", "not present.skipT", "not present.residualT", "biasPresence_nogb_ub", "gateUpDispatchFits"],
1454
+ "constants": { "inlineNorm": "0", "fromNormed": "0" },
1455
+ "passes": [
1456
+ {
1457
+ "id": "main",
1458
+ "name": "MatMulNBitsMlp.GateUp",
1459
+ "shader": "mlp-gate-up.wgsl.jinja",
1460
+ "bindings": "gateUpA_nogb_ub",
1461
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "rowGroups" }
1462
+ }
1463
+ ]
1464
+ },
1465
+ {
1466
+ "id": "plain_gb_noub",
1467
+ "priority": 10,
1468
+ "when": ["mlpShapeOk", "not present.normScaleT", "not present.skipT", "not present.residualT", "biasPresence_gb_noub", "gateUpDispatchFits"],
1469
+ "constants": { "inlineNorm": "0", "fromNormed": "0" },
1470
+ "passes": [
1471
+ {
1472
+ "id": "main",
1473
+ "name": "MatMulNBitsMlp.GateUp",
1474
+ "shader": "mlp-gate-up.wgsl.jinja",
1475
+ "bindings": "gateUpA_gb_noub",
1476
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "rowGroups" }
1477
+ }
1478
+ ]
1479
+ },
1480
+ {
1481
+ "id": "plain_gb_ub",
1482
+ "priority": 10,
1483
+ "when": ["mlpShapeOk", "not present.normScaleT", "not present.skipT", "not present.residualT", "biasPresence_gb_ub", "gateUpDispatchFits"],
1484
+ "constants": { "inlineNorm": "0", "fromNormed": "0" },
1485
+ "passes": [
1486
+ {
1487
+ "id": "main",
1488
+ "name": "MatMulNBitsMlp.GateUp",
1489
+ "shader": "mlp-gate-up.wgsl.jinja",
1490
+ "bindings": "gateUpA_gb_ub",
1491
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "rowGroups" }
1492
+ }
1493
+ ]
1494
+ },
1495
+ {
1496
+ "id": "staged_norm_nogb_noub",
1497
+ "priority": 10,
1498
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_nogb_noub", "gateUpDispatchFits", "normDispatchFits", "not present.skipT", "not present.residualT"],
1499
+ "constants": { "inlineNorm": "0", "fromNormed": "1" },
1500
+ "intermediates": [{ "id": "normedA", "dtype": "float32", "shape": "[numel(shapes.aT)]" }],
1501
+ "passes": [
1502
+ {
1503
+ "id": "norm",
1504
+ "name": "MatMulNBitsMlp.RmsNorm",
1505
+ "shader": "matmul-nbits-fused-rms-norm.wgsl.jinja",
1506
+ "bindings": "normOnly",
1507
+ "dispatch": { "workgroups": "aRows" }
1508
+ },
1509
+ {
1510
+ "id": "main",
1511
+ "name": "MatMulNBitsMlp.GateUp",
1512
+ "shader": "mlp-gate-up.wgsl.jinja",
1513
+ "bindings": "gateUpNormed_nogb_noub",
1514
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "rowGroups" }
1515
+ }
1516
+ ]
1517
+ },
1518
+ {
1519
+ "id": "staged_skip_nogb_noub",
1520
+ "priority": 10,
1521
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_nogb_noub", "gateUpDispatchFits", "normDispatchFits", "present.skipT", "not present.residualT"],
1522
+ "constants": { "inlineNorm": "0", "fromNormed": "1" },
1523
+ "intermediates": [{ "id": "normedA", "dtype": "float32", "shape": "[numel(shapes.aT)]" }],
1524
+ "passes": [
1525
+ {
1526
+ "id": "norm",
1527
+ "name": "MatMulNBitsMlp.RmsNorm",
1528
+ "shader": "matmul-nbits-fused-rms-norm.wgsl.jinja",
1529
+ "bindings": "normSkip",
1530
+ "dispatch": { "workgroups": "aRows" }
1531
+ },
1532
+ {
1533
+ "id": "main",
1534
+ "name": "MatMulNBitsMlp.GateUp",
1535
+ "shader": "mlp-gate-up.wgsl.jinja",
1536
+ "bindings": "gateUpNormed_nogb_noub",
1537
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "rowGroups" }
1538
+ }
1539
+ ]
1540
+ },
1541
+ {
1542
+ "id": "staged_skipsum_nogb_noub",
1543
+ "priority": 10,
1544
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_nogb_noub", "gateUpDispatchFits", "normDispatchFits", "present.skipT", "present.residualT"],
1545
+ "constants": { "inlineNorm": "0", "fromNormed": "1" },
1546
+ "intermediates": [{ "id": "normedA", "dtype": "float32", "shape": "[numel(shapes.aT)]" }],
1547
+ "passes": [
1548
+ {
1549
+ "id": "norm",
1550
+ "name": "MatMulNBitsMlp.RmsNorm",
1551
+ "shader": "matmul-nbits-fused-rms-norm.wgsl.jinja",
1552
+ "bindings": "normFull",
1553
+ "dispatch": { "workgroups": "aRows" }
1554
+ },
1555
+ {
1556
+ "id": "main",
1557
+ "name": "MatMulNBitsMlp.GateUp",
1558
+ "shader": "mlp-gate-up.wgsl.jinja",
1559
+ "bindings": "gateUpNormed_nogb_noub",
1560
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "rowGroups" }
1561
+ }
1562
+ ]
1563
+ },
1564
+ {
1565
+ "id": "staged_norm_nogb_ub",
1566
+ "priority": 10,
1567
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_nogb_ub", "gateUpDispatchFits", "normDispatchFits", "not present.skipT", "not present.residualT"],
1568
+ "constants": { "inlineNorm": "0", "fromNormed": "1" },
1569
+ "intermediates": [{ "id": "normedA", "dtype": "float32", "shape": "[numel(shapes.aT)]" }],
1570
+ "passes": [
1571
+ {
1572
+ "id": "norm",
1573
+ "name": "MatMulNBitsMlp.RmsNorm",
1574
+ "shader": "matmul-nbits-fused-rms-norm.wgsl.jinja",
1575
+ "bindings": "normOnly",
1576
+ "dispatch": { "workgroups": "aRows" }
1577
+ },
1578
+ {
1579
+ "id": "main",
1580
+ "name": "MatMulNBitsMlp.GateUp",
1581
+ "shader": "mlp-gate-up.wgsl.jinja",
1582
+ "bindings": "gateUpNormed_nogb_ub",
1583
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "rowGroups" }
1584
+ }
1585
+ ]
1586
+ },
1587
+ {
1588
+ "id": "staged_skip_nogb_ub",
1589
+ "priority": 10,
1590
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_nogb_ub", "gateUpDispatchFits", "normDispatchFits", "present.skipT", "not present.residualT"],
1591
+ "constants": { "inlineNorm": "0", "fromNormed": "1" },
1592
+ "intermediates": [{ "id": "normedA", "dtype": "float32", "shape": "[numel(shapes.aT)]" }],
1593
+ "passes": [
1594
+ {
1595
+ "id": "norm",
1596
+ "name": "MatMulNBitsMlp.RmsNorm",
1597
+ "shader": "matmul-nbits-fused-rms-norm.wgsl.jinja",
1598
+ "bindings": "normSkip",
1599
+ "dispatch": { "workgroups": "aRows" }
1600
+ },
1601
+ {
1602
+ "id": "main",
1603
+ "name": "MatMulNBitsMlp.GateUp",
1604
+ "shader": "mlp-gate-up.wgsl.jinja",
1605
+ "bindings": "gateUpNormed_nogb_ub",
1606
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "rowGroups" }
1607
+ }
1608
+ ]
1609
+ },
1610
+ {
1611
+ "id": "staged_skipsum_nogb_ub",
1612
+ "priority": 10,
1613
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_nogb_ub", "gateUpDispatchFits", "normDispatchFits", "present.skipT", "present.residualT"],
1614
+ "constants": { "inlineNorm": "0", "fromNormed": "1" },
1615
+ "intermediates": [{ "id": "normedA", "dtype": "float32", "shape": "[numel(shapes.aT)]" }],
1616
+ "passes": [
1617
+ {
1618
+ "id": "norm",
1619
+ "name": "MatMulNBitsMlp.RmsNorm",
1620
+ "shader": "matmul-nbits-fused-rms-norm.wgsl.jinja",
1621
+ "bindings": "normFull",
1622
+ "dispatch": { "workgroups": "aRows" }
1623
+ },
1624
+ {
1625
+ "id": "main",
1626
+ "name": "MatMulNBitsMlp.GateUp",
1627
+ "shader": "mlp-gate-up.wgsl.jinja",
1628
+ "bindings": "gateUpNormed_nogb_ub",
1629
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "rowGroups" }
1630
+ }
1631
+ ]
1632
+ },
1633
+ {
1634
+ "id": "staged_norm_gb_noub",
1635
+ "priority": 10,
1636
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_gb_noub", "gateUpDispatchFits", "normDispatchFits", "not present.skipT", "not present.residualT"],
1637
+ "constants": { "inlineNorm": "0", "fromNormed": "1" },
1638
+ "intermediates": [{ "id": "normedA", "dtype": "float32", "shape": "[numel(shapes.aT)]" }],
1639
+ "passes": [
1640
+ {
1641
+ "id": "norm",
1642
+ "name": "MatMulNBitsMlp.RmsNorm",
1643
+ "shader": "matmul-nbits-fused-rms-norm.wgsl.jinja",
1644
+ "bindings": "normOnly",
1645
+ "dispatch": { "workgroups": "aRows" }
1646
+ },
1647
+ {
1648
+ "id": "main",
1649
+ "name": "MatMulNBitsMlp.GateUp",
1650
+ "shader": "mlp-gate-up.wgsl.jinja",
1651
+ "bindings": "gateUpNormed_gb_noub",
1652
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "rowGroups" }
1653
+ }
1654
+ ]
1655
+ },
1656
+ {
1657
+ "id": "staged_skip_gb_noub",
1658
+ "priority": 10,
1659
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_gb_noub", "gateUpDispatchFits", "normDispatchFits", "present.skipT", "not present.residualT"],
1660
+ "constants": { "inlineNorm": "0", "fromNormed": "1" },
1661
+ "intermediates": [{ "id": "normedA", "dtype": "float32", "shape": "[numel(shapes.aT)]" }],
1662
+ "passes": [
1663
+ {
1664
+ "id": "norm",
1665
+ "name": "MatMulNBitsMlp.RmsNorm",
1666
+ "shader": "matmul-nbits-fused-rms-norm.wgsl.jinja",
1667
+ "bindings": "normSkip",
1668
+ "dispatch": { "workgroups": "aRows" }
1669
+ },
1670
+ {
1671
+ "id": "main",
1672
+ "name": "MatMulNBitsMlp.GateUp",
1673
+ "shader": "mlp-gate-up.wgsl.jinja",
1674
+ "bindings": "gateUpNormed_gb_noub",
1675
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "rowGroups" }
1676
+ }
1677
+ ]
1678
+ },
1679
+ {
1680
+ "id": "staged_skipsum_gb_noub",
1681
+ "priority": 10,
1682
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_gb_noub", "gateUpDispatchFits", "normDispatchFits", "present.skipT", "present.residualT"],
1683
+ "constants": { "inlineNorm": "0", "fromNormed": "1" },
1684
+ "intermediates": [{ "id": "normedA", "dtype": "float32", "shape": "[numel(shapes.aT)]" }],
1685
+ "passes": [
1686
+ {
1687
+ "id": "norm",
1688
+ "name": "MatMulNBitsMlp.RmsNorm",
1689
+ "shader": "matmul-nbits-fused-rms-norm.wgsl.jinja",
1690
+ "bindings": "normFull",
1691
+ "dispatch": { "workgroups": "aRows" }
1692
+ },
1693
+ {
1694
+ "id": "main",
1695
+ "name": "MatMulNBitsMlp.GateUp",
1696
+ "shader": "mlp-gate-up.wgsl.jinja",
1697
+ "bindings": "gateUpNormed_gb_noub",
1698
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "rowGroups" }
1699
+ }
1700
+ ]
1701
+ },
1702
+ {
1703
+ "id": "staged_norm_gb_ub",
1704
+ "priority": 10,
1705
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_gb_ub", "gateUpDispatchFits", "normDispatchFits", "not present.skipT", "not present.residualT"],
1706
+ "constants": { "inlineNorm": "0", "fromNormed": "1" },
1707
+ "intermediates": [{ "id": "normedA", "dtype": "float32", "shape": "[numel(shapes.aT)]" }],
1708
+ "passes": [
1709
+ {
1710
+ "id": "norm",
1711
+ "name": "MatMulNBitsMlp.RmsNorm",
1712
+ "shader": "matmul-nbits-fused-rms-norm.wgsl.jinja",
1713
+ "bindings": "normOnly",
1714
+ "dispatch": { "workgroups": "aRows" }
1715
+ },
1716
+ {
1717
+ "id": "main",
1718
+ "name": "MatMulNBitsMlp.GateUp",
1719
+ "shader": "mlp-gate-up.wgsl.jinja",
1720
+ "bindings": "gateUpNormed_gb_ub",
1721
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "rowGroups" }
1722
+ }
1723
+ ]
1724
+ },
1725
+ {
1726
+ "id": "staged_skip_gb_ub",
1727
+ "priority": 10,
1728
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_gb_ub", "gateUpDispatchFits", "normDispatchFits", "present.skipT", "not present.residualT"],
1729
+ "constants": { "inlineNorm": "0", "fromNormed": "1" },
1730
+ "intermediates": [{ "id": "normedA", "dtype": "float32", "shape": "[numel(shapes.aT)]" }],
1731
+ "passes": [
1732
+ {
1733
+ "id": "norm",
1734
+ "name": "MatMulNBitsMlp.RmsNorm",
1735
+ "shader": "matmul-nbits-fused-rms-norm.wgsl.jinja",
1736
+ "bindings": "normSkip",
1737
+ "dispatch": { "workgroups": "aRows" }
1738
+ },
1739
+ {
1740
+ "id": "main",
1741
+ "name": "MatMulNBitsMlp.GateUp",
1742
+ "shader": "mlp-gate-up.wgsl.jinja",
1743
+ "bindings": "gateUpNormed_gb_ub",
1744
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "rowGroups" }
1745
+ }
1746
+ ]
1747
+ },
1748
+ {
1749
+ "id": "staged_skipsum_gb_ub",
1750
+ "priority": 10,
1751
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_gb_ub", "gateUpDispatchFits", "normDispatchFits", "present.skipT", "present.residualT"],
1752
+ "constants": { "inlineNorm": "0", "fromNormed": "1" },
1753
+ "intermediates": [{ "id": "normedA", "dtype": "float32", "shape": "[numel(shapes.aT)]" }],
1754
+ "passes": [
1755
+ {
1756
+ "id": "norm",
1757
+ "name": "MatMulNBitsMlp.RmsNorm",
1758
+ "shader": "matmul-nbits-fused-rms-norm.wgsl.jinja",
1759
+ "bindings": "normFull",
1760
+ "dispatch": { "workgroups": "aRows" }
1761
+ },
1762
+ {
1763
+ "id": "main",
1764
+ "name": "MatMulNBitsMlp.GateUp",
1765
+ "shader": "mlp-gate-up.wgsl.jinja",
1766
+ "bindings": "gateUpNormed_gb_ub",
1767
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "rowGroups" }
1768
+ }
1769
+ ]
1770
+ },
1771
+ {
1772
+ "id": "fused_norm_nogb_noub",
1773
+ "priority": 30,
1774
+ "requires": { "limits": { "maxStorageBuffersPerShaderStage": 7 } },
1775
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_nogb_noub", "gateUpDispatchFits", "aRows == 1", "not present.skipT", "not present.residualT"],
1776
+ "constants": { "inlineNorm": "1", "fromNormed": "0", "rowTile": "1" },
1777
+ "passes": [
1778
+ {
1779
+ "id": "main",
1780
+ "name": "MatMulNBitsMlp.FusedDecode",
1781
+ "shader": "mlp-gate-up.wgsl.jinja",
1782
+ "bindings": "fused_norm_nogb_noub",
1783
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "aRows" }
1784
+ }
1785
+ ]
1786
+ },
1787
+ {
1788
+ "id": "fused_skip_nogb_noub",
1789
+ "priority": 30,
1790
+ "requires": { "limits": { "maxStorageBuffersPerShaderStage": 8 } },
1791
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_nogb_noub", "gateUpDispatchFits", "aRows == 1", "present.skipT", "not present.residualT"],
1792
+ "constants": { "inlineNorm": "1", "fromNormed": "0", "rowTile": "1" },
1793
+ "passes": [
1794
+ {
1795
+ "id": "main",
1796
+ "name": "MatMulNBitsMlp.FusedDecode",
1797
+ "shader": "mlp-gate-up.wgsl.jinja",
1798
+ "bindings": "fused_skip_nogb_noub",
1799
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "aRows" }
1800
+ }
1801
+ ]
1802
+ },
1803
+ {
1804
+ "id": "fused_skipsum_nogb_noub",
1805
+ "priority": 30,
1806
+ "requires": { "limits": { "maxStorageBuffersPerShaderStage": 9 } },
1807
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_nogb_noub", "gateUpDispatchFits", "aRows == 1", "present.skipT", "present.residualT"],
1808
+ "constants": { "inlineNorm": "1", "fromNormed": "0", "rowTile": "1" },
1809
+ "passes": [
1810
+ {
1811
+ "id": "main",
1812
+ "name": "MatMulNBitsMlp.FusedDecode",
1813
+ "shader": "mlp-gate-up.wgsl.jinja",
1814
+ "bindings": "fused_skipsum_nogb_noub",
1815
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "aRows" }
1816
+ }
1817
+ ]
1818
+ },
1819
+ {
1820
+ "id": "fused_norm_nogb_ub",
1821
+ "priority": 30,
1822
+ "requires": { "limits": { "maxStorageBuffersPerShaderStage": 8 } },
1823
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_nogb_ub", "gateUpDispatchFits", "aRows == 1", "not present.skipT", "not present.residualT"],
1824
+ "constants": { "inlineNorm": "1", "fromNormed": "0", "rowTile": "1" },
1825
+ "passes": [
1826
+ {
1827
+ "id": "main",
1828
+ "name": "MatMulNBitsMlp.FusedDecode",
1829
+ "shader": "mlp-gate-up.wgsl.jinja",
1830
+ "bindings": "fused_norm_nogb_ub",
1831
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "aRows" }
1832
+ }
1833
+ ]
1834
+ },
1835
+ {
1836
+ "id": "fused_skip_nogb_ub",
1837
+ "priority": 30,
1838
+ "requires": { "limits": { "maxStorageBuffersPerShaderStage": 9 } },
1839
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_nogb_ub", "gateUpDispatchFits", "aRows == 1", "present.skipT", "not present.residualT"],
1840
+ "constants": { "inlineNorm": "1", "fromNormed": "0", "rowTile": "1" },
1841
+ "passes": [
1842
+ {
1843
+ "id": "main",
1844
+ "name": "MatMulNBitsMlp.FusedDecode",
1845
+ "shader": "mlp-gate-up.wgsl.jinja",
1846
+ "bindings": "fused_skip_nogb_ub",
1847
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "aRows" }
1848
+ }
1849
+ ]
1850
+ },
1851
+ {
1852
+ "id": "fused_skipsum_nogb_ub",
1853
+ "priority": 30,
1854
+ "requires": { "limits": { "maxStorageBuffersPerShaderStage": 10 } },
1855
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_nogb_ub", "gateUpDispatchFits", "aRows == 1", "present.skipT", "present.residualT"],
1856
+ "constants": { "inlineNorm": "1", "fromNormed": "0", "rowTile": "1" },
1857
+ "passes": [
1858
+ {
1859
+ "id": "main",
1860
+ "name": "MatMulNBitsMlp.FusedDecode",
1861
+ "shader": "mlp-gate-up.wgsl.jinja",
1862
+ "bindings": "fused_skipsum_nogb_ub",
1863
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "aRows" }
1864
+ }
1865
+ ]
1866
+ },
1867
+ {
1868
+ "id": "fused_norm_gb_noub",
1869
+ "priority": 30,
1870
+ "requires": { "limits": { "maxStorageBuffersPerShaderStage": 8 } },
1871
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_gb_noub", "gateUpDispatchFits", "aRows == 1", "not present.skipT", "not present.residualT"],
1872
+ "constants": { "inlineNorm": "1", "fromNormed": "0", "rowTile": "1" },
1873
+ "passes": [
1874
+ {
1875
+ "id": "main",
1876
+ "name": "MatMulNBitsMlp.FusedDecode",
1877
+ "shader": "mlp-gate-up.wgsl.jinja",
1878
+ "bindings": "fused_norm_gb_noub",
1879
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "aRows" }
1880
+ }
1881
+ ]
1882
+ },
1883
+ {
1884
+ "id": "fused_skip_gb_noub",
1885
+ "priority": 30,
1886
+ "requires": { "limits": { "maxStorageBuffersPerShaderStage": 9 } },
1887
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_gb_noub", "gateUpDispatchFits", "aRows == 1", "present.skipT", "not present.residualT"],
1888
+ "constants": { "inlineNorm": "1", "fromNormed": "0", "rowTile": "1" },
1889
+ "passes": [
1890
+ {
1891
+ "id": "main",
1892
+ "name": "MatMulNBitsMlp.FusedDecode",
1893
+ "shader": "mlp-gate-up.wgsl.jinja",
1894
+ "bindings": "fused_skip_gb_noub",
1895
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "aRows" }
1896
+ }
1897
+ ]
1898
+ },
1899
+ {
1900
+ "id": "fused_skipsum_gb_noub",
1901
+ "priority": 30,
1902
+ "requires": { "limits": { "maxStorageBuffersPerShaderStage": 10 } },
1903
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_gb_noub", "gateUpDispatchFits", "aRows == 1", "present.skipT", "present.residualT"],
1904
+ "constants": { "inlineNorm": "1", "fromNormed": "0", "rowTile": "1" },
1905
+ "passes": [
1906
+ {
1907
+ "id": "main",
1908
+ "name": "MatMulNBitsMlp.FusedDecode",
1909
+ "shader": "mlp-gate-up.wgsl.jinja",
1910
+ "bindings": "fused_skipsum_gb_noub",
1911
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "aRows" }
1912
+ }
1913
+ ]
1914
+ },
1915
+ {
1916
+ "id": "fused_norm_gb_ub",
1917
+ "priority": 30,
1918
+ "requires": { "limits": { "maxStorageBuffersPerShaderStage": 9 } },
1919
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_gb_ub", "gateUpDispatchFits", "aRows == 1", "not present.skipT", "not present.residualT"],
1920
+ "constants": { "inlineNorm": "1", "fromNormed": "0", "rowTile": "1" },
1921
+ "passes": [
1922
+ {
1923
+ "id": "main",
1924
+ "name": "MatMulNBitsMlp.FusedDecode",
1925
+ "shader": "mlp-gate-up.wgsl.jinja",
1926
+ "bindings": "fused_norm_gb_ub",
1927
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "aRows" }
1928
+ }
1929
+ ]
1930
+ },
1931
+ {
1932
+ "id": "fused_skip_gb_ub",
1933
+ "priority": 30,
1934
+ "requires": { "limits": { "maxStorageBuffersPerShaderStage": 10 } },
1935
+ "when": ["mlpShapeOk", "normContractOk", "biasPresence_gb_ub", "gateUpDispatchFits", "aRows == 1", "present.skipT", "not present.residualT"],
1936
+ "constants": { "inlineNorm": "1", "fromNormed": "0", "rowTile": "1" },
1937
+ "passes": [
1938
+ {
1939
+ "id": "main",
1940
+ "name": "MatMulNBitsMlp.FusedDecode",
1941
+ "shader": "mlp-gate-up.wgsl.jinja",
1942
+ "bindings": "fused_skip_gb_ub",
1943
+ "dispatch": { "x": "ceilDiv(attrs.N, tunables.TILE_N)", "y": "aRows" }
1944
+ }
1945
+ ]
1946
+ }
1947
+ ]
1948
+ }
build/webgpu/matmul-nbits-fused-rms-norm.wgsl.jinja ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% if usesF16 %}
2
+ enable f16;
3
+ {% endif %}
4
+ {{ env.wgsl.resourceDeclarations }}
5
+
6
+ // Shared MatMulNBits MLP/QKV normalization pass.
7
+ // normed[row, d] = (A + skip)[row, d] * inverseSqrt(mean_d((A + skip)^2) + eps) * norm_scale[d]
8
+ // One workgroup owns one row. Every intermediate stays in f32 and `normed` is an
9
+ // f32 scratch tensor, so the projection pass reads exactly what the fused
10
+ // single-dispatch kernel keeps in registers -- the two paths agree for float16
11
+ // inputs instead of differing by one narrowing.
12
+ const HIDDEN: u32 = {{ hidden }}u;
13
+ const WG: u32 = {{ workgroupSize }}u;
14
+ const EPSILON: f32 = {{ epsilon }};
15
+
16
+ var<workgroup> partial: array<f32, WG>;
17
+
18
+ {% macro wgsl_tree_fold_stmt(a, op, idx, svar) %}
19
+ {% if op == "max" %}
20
+ {{ a }}[{{ idx }}] = max({{ a }}[{{ idx }}], {{ a }}[{{ idx }} + {{ svar }}]);
21
+ {%- else %}
22
+ {{ a }}[{{ idx }}] = {{ a }}[{{ idx }}] + {{ a }}[{{ idx }} + {{ svar }}];
23
+ {%- endif %}
24
+ {% endmacro %}
25
+ {% macro wgsl_tree_fold(arrays, op="add", idx="lid", wg="WORKGROUP_SIZE", svar="stride", typed=false, form="tail", breakInline=false, bodyInline=false, barrierFirst=false) %}
26
+ var {{ svar }}{{ ": u32 " if typed else " " }}= {{ wg }} / 2u;
27
+ loop {
28
+ {% if form == "head" %}
29
+ {% if breakInline %}
30
+ if ({{ svar }} == 0u) { break; }
31
+ {% else %}
32
+ if ({{ svar }} == 0u) {
33
+ break;
34
+ }
35
+ {% endif %}
36
+ {% endif %}
37
+ {% if bodyInline %}
38
+ if ({{ idx }} < {{ svar }}) { {{ wgsl_tree_fold_stmt(arrays[0], op, idx, svar) }} }
39
+ {% else %}
40
+ if ({{ idx }} < {{ svar }}) {
41
+ {% for a in arrays %}
42
+ {{ wgsl_tree_fold_stmt(a, op, idx, svar) }}
43
+ {% endfor %}
44
+ }
45
+ {% endif %}
46
+ {% if form == "head" %}
47
+ {% if barrierFirst %}
48
+ workgroupBarrier();
49
+ {{ svar }} = {{ svar }} / 2u;
50
+ {% else %}
51
+ {{ svar }} = {{ svar }} / 2u;
52
+ workgroupBarrier();
53
+ {% endif %}
54
+ {% else %}
55
+ workgroupBarrier();
56
+ if ({{ svar }} == 1u) {
57
+ break;
58
+ }
59
+ {{ svar }} = {{ svar }} / 2u;
60
+ {% endif %}
61
+ }
62
+ {%- endmacro %}
63
+
64
+ // Reusing partial after this reduction requires a barrier between the read of
65
+ // partial[0] and the next write, or the next round can race the prior readers.
66
+ {% set trailingBarrier = trailingBarrier is defined and trailingBarrier %}
67
+ fn reduce_sum(value: f32, tid: u32) -> f32 {
68
+ partial[tid] = value;
69
+ workgroupBarrier();
70
+ {{ wgsl_tree_fold(["partial"], idx="tid", wg="WG", form="head") }}
71
+ {% if trailingBarrier %}
72
+ let total = partial[0];
73
+ workgroupBarrier();
74
+ return total;
75
+ {% else %}
76
+ return partial[0];
77
+ {% endif %}
78
+ }
79
+
80
+
81
+ fn row_value(index: u32) -> f32 {
82
+ {% if hasSkip %}
83
+ return f32(a[index]) + f32(skip[index]);
84
+ {% else %}
85
+ return f32(a[index]);
86
+ {% endif %}
87
+ }
88
+
89
+ @compute @workgroup_size(WG, 1, 1)
90
+ fn main(@builtin(workgroup_id) wg: vec3<u32>,
91
+ @builtin(num_workgroups) nwg: vec3<u32>,
92
+ @builtin(local_invocation_id) lid: vec3<u32>) {
93
+ // 2D-folded row index: wg.y carries the high bits past the
94
+ // maxComputeWorkgroupsPerDimension dispatch limit. Reduces to wg.x when nwg.y == 1.
95
+ let row = wg.x + wg.y * nwg.x;
96
+ if (row >= params.rows) {
97
+ return;
98
+ }
99
+ let tid = lid.x;
100
+ let base = row * HIDDEN;
101
+
102
+ var local_sq = 0.0;
103
+ for (var d = tid; d < HIDDEN; d = d + WG) {
104
+ let value = row_value(base + d);
105
+ local_sq = local_sq + value * value;
106
+ }
107
+ let inv = inverseSqrt(reduce_sum(local_sq, tid) / f32(HIDDEN) + EPSILON);
108
+
109
+ for (var d = tid; d < HIDDEN; d = d + WG) {
110
+ let index = base + d;
111
+ let value = row_value(index);
112
+ {% if writeResidual %}
113
+ residual[index] = {{ scalar }}(value);
114
+ {% endif %}
115
+ normed[index] = value * inv * f32(norm_scale[d]);
116
+ }
117
+ }
build/webgpu/metadata.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "com.microsoft.MatMulNBitsMlp",
3
+ "id": "_com_microsoft_matmulnbitsmlp_webgpu_5f0af61",
4
+ "version": 1,
5
+ "license": "Apache-2.0",
6
+ "backend": { "type": "webgpu" },
7
+ "digest": {
8
+ "algorithm": "sha256",
9
+ "files": {
10
+ "bench.json": "FmfZaHEP/sBLMvGjNKkLAHUkkW9+LWNCTLnfAniZXZY=",
11
+ "manifest.json": "2PUEf3quWni+CsZC4X4XMrR/GVu+mhWWWPqOjzAbbyU=",
12
+ "matmul-nbits-fused-rms-norm.wgsl.jinja": "4TI9Mc/RZWVgMl6NVG2iwe5OpvqQmswhe6xtGvctNmI=",
13
+ "mlp-gate-up.wgsl.jinja": "Zncc9Fsa1Vja8Dz8384/+MSAlJXnpb8OwIoGO1ht0rs=",
14
+ "test.json": "sKKYxHcXolfGhck7PQNdGq3iSM8B58IYf/w5hl6JPLg="
15
+ }
16
+ },
17
+ "provenance": { "kernel": { "sha": "2e7068faf55e7f43df740015f6d1ee49391a41c5", "dirty": false } },
18
+ "webgpu": { "manifestSpec": "1.0", "specialized": true, "opPath": "ops/com.microsoft.MatMulNBitsMlp" }
19
+ }
build/webgpu/mlp-gate-up.wgsl.jinja ADDED
@@ -0,0 +1,290 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% macro matmul_nbits_packed_code(fn="packed_weight", buffer="b", kBlocks="params.kBlocks", blobSize="params.blobSize", bits=4) %}
2
+ fn {{ fn }}(n: u32, block: u32, offset: u32) -> u32 {
3
+ {% if bits == 2 %}
4
+ let byte_index = offset / 4u;
5
+ let shift = (offset % 4u) * 2u;
6
+ let packed_index = (n * {{ kBlocks }} + block) * {{ blobSize }} + byte_index;
7
+ return ({{ buffer }}[packed_index] >> shift) & 3u;
8
+ {% elif bits == 4 %}
9
+ let byte_index = offset / 2u;
10
+ let shift = (offset % 2u) * 4u;
11
+ let packed_index = (n * {{ kBlocks }} + block) * {{ blobSize }} + byte_index;
12
+ return ({{ buffer }}[packed_index] >> shift) & 15u;
13
+ {% else %}
14
+ let packed_index = (n * {{ kBlocks }} + block) * {{ blobSize }} + offset;
15
+ return {{ buffer }}[packed_index] & 255u;
16
+ {% endif %}
17
+ }
18
+ {%- endmacro %}
19
+
20
+ {% if usesF16 %}
21
+ enable f16;
22
+ {% endif %}
23
+ {{ env.wgsl.resourceDeclarations }}
24
+
25
+ // com.microsoft.MatMulNBitsMlp, gate/up projection pass.
26
+ // Y[row, n] = silu(dot(A_norm[row], gate[n]) + gate_bias[n])
27
+ // * (dot(A_norm[row], up[n]) + up_bias[n])
28
+ // Both projections share the activation row, so one workgroup walks the row once
29
+ // and feeds TILE_N output columns of each projection from it. LANES threads
30
+ // cooperate on one column: thread (column, lane) strides the reduction axis by
31
+ // LANES, and the per-column partials are folded within the column's own lane
32
+ // group at the end. Codes are dequantized as (code - ZERO) * block_scale, with
33
+ // the block scale hoisted out of the inner loop; this operator has no
34
+ // zero-point input, so ZERO is the symmetric midpoint for the bit width.
35
+ // A workgroup covers ROW_TILE activation rows, reusing each unpacked weight code
36
+ // across their accumulators.
37
+ const K: u32 = {{ K }}u;
38
+ const N: u32 = {{ N }}u;
39
+ const BLOCK_SIZE: u32 = {{ blockSize }}u;
40
+ const KBLOCKS: u32 = {{ kBlocks }}u;
41
+ const BLOB_SIZE: u32 = {{ blobSize }}u;
42
+ const TILE_N: u32 = {{ tileN }}u;
43
+ const LANES: u32 = {{ lanes }}u;
44
+ const ROW_TILE: u32 = {{ rowTile }}u;
45
+ const ROWS: u32 = {{ rows }}u;
46
+ const WG: u32 = TILE_N * LANES;
47
+ const ZERO: f32 = {{ defaultZero }};
48
+ // Codes per logical byte and the mask for one code. Physical uint8 storage uses
49
+ // a u32 slot, so packing increases the number of codes returned by each load.
50
+ const BITS: u32 = {{ bits }}u;
51
+ const CODES_PER_BYTE: u32 = {{ codesPerByte }}u;
52
+ const CODE_MASK: u32 = {{ codeMask }}u;
53
+ {% if inlineNorm %}
54
+ const EPSILON: f32 = {{ epsilon }};
55
+ {% endif %}
56
+
57
+ {% for stream in ["gate", "up"] %}
58
+ {{ matmul_nbits_packed_code(fn=stream ~ "_code", buffer=stream ~ "_b", kBlocks="KBLOCKS", blobSize="BLOB_SIZE", bits=bits) }}
59
+ // Decode two consecutive reduction-axis codes. Below 8 bits an even offset and
60
+ // its successor share one stored byte; at 8 bits they occupy adjacent slots. An
61
+ // odd offset would straddle bytes, so callers advance by two from an even start.
62
+ fn {{ stream }}_code_pair(n: u32, block: u32, offset: u32) -> vec2<u32> {
63
+ let base = (n * KBLOCKS + block) * BLOB_SIZE;
64
+ let shift = (offset % CODES_PER_BYTE) * BITS;
65
+ let lo = {{ stream }}_b[base + offset / CODES_PER_BYTE];
66
+ let hi = {{ "lo" if codesPerByte > 1 else (stream ~ "_b[base + offset + 1u]") }};
67
+ return vec2<u32>((lo >> shift) & CODE_MASK,
68
+ (hi >> {{ "(shift + BITS)" if codesPerByte > 1 else "0u" }}) & CODE_MASK);
69
+ }
70
+ {% endfor %}
71
+
72
+ fn silu(x: f32) -> f32 {
73
+ return x / (1.0 + exp(-x));
74
+ }
75
+
76
+ var<workgroup> red_gate: array<f32, WG * ROW_TILE>;
77
+ var<workgroup> red_up: array<f32, WG * ROW_TILE>;
78
+ {% if inlineNorm %}
79
+ var<workgroup> partial: array<f32, WG>;
80
+ var<workgroup> row_inv: f32;
81
+
82
+ {% macro wgsl_tree_fold_stmt(a, op, idx, svar) %}
83
+ {% if op == "max" %}
84
+ {{ a }}[{{ idx }}] = max({{ a }}[{{ idx }}], {{ a }}[{{ idx }} + {{ svar }}]);
85
+ {%- else %}
86
+ {{ a }}[{{ idx }}] = {{ a }}[{{ idx }}] + {{ a }}[{{ idx }} + {{ svar }}];
87
+ {%- endif %}
88
+ {% endmacro %}
89
+ {% macro wgsl_tree_fold(arrays, op="add", idx="lid", wg="WORKGROUP_SIZE", svar="stride", typed=false, form="tail", breakInline=false, bodyInline=false, barrierFirst=false) %}
90
+ var {{ svar }}{{ ": u32 " if typed else " " }}= {{ wg }} / 2u;
91
+ loop {
92
+ {% if form == "head" %}
93
+ {% if breakInline %}
94
+ if ({{ svar }} == 0u) { break; }
95
+ {% else %}
96
+ if ({{ svar }} == 0u) {
97
+ break;
98
+ }
99
+ {% endif %}
100
+ {% endif %}
101
+ {% if bodyInline %}
102
+ if ({{ idx }} < {{ svar }}) { {{ wgsl_tree_fold_stmt(arrays[0], op, idx, svar) }} }
103
+ {% else %}
104
+ if ({{ idx }} < {{ svar }}) {
105
+ {% for a in arrays %}
106
+ {{ wgsl_tree_fold_stmt(a, op, idx, svar) }}
107
+ {% endfor %}
108
+ }
109
+ {% endif %}
110
+ {% if form == "head" %}
111
+ {% if barrierFirst %}
112
+ workgroupBarrier();
113
+ {{ svar }} = {{ svar }} / 2u;
114
+ {% else %}
115
+ {{ svar }} = {{ svar }} / 2u;
116
+ workgroupBarrier();
117
+ {% endif %}
118
+ {% else %}
119
+ workgroupBarrier();
120
+ if ({{ svar }} == 1u) {
121
+ break;
122
+ }
123
+ {{ svar }} = {{ svar }} / 2u;
124
+ {% endif %}
125
+ }
126
+ {%- endmacro %}
127
+
128
+ // Reusing partial after this reduction requires a barrier between the read of
129
+ // partial[0] and the next write, or the next round can race the prior readers.
130
+ {% set trailingBarrier = trailingBarrier is defined and trailingBarrier %}
131
+ fn reduce_sum(value: f32, tid: u32) -> f32 {
132
+ partial[tid] = value;
133
+ workgroupBarrier();
134
+ {{ wgsl_tree_fold(["partial"], idx="tid", wg="WG", form="head") }}
135
+ {% if trailingBarrier %}
136
+ let total = partial[0];
137
+ workgroupBarrier();
138
+ return total;
139
+ {% else %}
140
+ return partial[0];
141
+ {% endif %}
142
+ }
143
+
144
+
145
+ fn row_value(index: u32) -> f32 {
146
+ {% if hasSkip %}
147
+ return f32(a[index]) + f32(skip[index]);
148
+ {% else %}
149
+ return f32(a[index]);
150
+ {% endif %}
151
+ }
152
+ {% endif %}
153
+
154
+ {% macro act(b, k) %}{% if inlineNorm %}row_value({{ b }} + {{ k }}) * row_inv * f32(norm_scale[{{ k }}]){% elif fromNormed %}normed[{{ b }} + {{ k }}]{% else %}f32(a[{{ b }} + {{ k }}]){% endif %}{%- endmacro %}
155
+
156
+ {% macro walk_block(guarded) %}
157
+ for (var offset = lane * 2u; offset + 1u < BLOCK_SIZE; offset = offset + LANES * 2u) {
158
+ let k = k_base + offset;
159
+ {% if guarded %}
160
+ if (k + 1u < K) {
161
+ {% endif %}
162
+ let gate_codes = gate_code_pair(n, block, offset);
163
+ let up_codes = up_code_pair(n, block, offset);
164
+ let gate_lo = f32(gate_codes.x) - ZERO;
165
+ let gate_hi = f32(gate_codes.y) - ZERO;
166
+ let up_lo = f32(up_codes.x) - ZERO;
167
+ let up_hi = f32(up_codes.y) - ZERO;
168
+ {% for r in range(rowTile) %}
169
+ {
170
+ let v0 = {{ act("base_" ~ r, "k") }};
171
+ let v1 = {{ act("base_" ~ r, "k + 1u") }};
172
+ block_gate_{{ r }} = block_gate_{{ r }} + v0 * gate_lo + v1 * gate_hi;
173
+ block_up_{{ r }} = block_up_{{ r }} + v0 * up_lo + v1 * up_hi;
174
+ }
175
+ {% endfor %}
176
+ {% if guarded %}
177
+ } else if (k < K) {
178
+ let gate_value = f32(gate_code(n, block, offset)) - ZERO;
179
+ let up_value = f32(up_code(n, block, offset)) - ZERO;
180
+ {% for r in range(rowTile) %}
181
+ {
182
+ let v0 = {{ act("base_" ~ r, "k") }};
183
+ block_gate_{{ r }} = block_gate_{{ r }} + v0 * gate_value;
184
+ block_up_{{ r }} = block_up_{{ r }} + v0 * up_value;
185
+ }
186
+ {% endfor %}
187
+ }
188
+ {% endif %}
189
+ }
190
+ {%- endmacro %}
191
+
192
+ @compute @workgroup_size(WG, 1, 1)
193
+ fn main(@builtin(workgroup_id) wg: vec3<u32>, @builtin(local_invocation_id) lid: vec3<u32>) {
194
+ let row0 = wg.y * ROW_TILE;
195
+ let tid = lid.x;
196
+ let column = tid / LANES;
197
+ let lane = tid % LANES;
198
+ let n = wg.x * TILE_N + column;
199
+ {% for r in range(rowTile) %}
200
+ // Rows past the end of the batch clamp onto the last real row; their
201
+ // accumulators stay finite and the store guard drops them.
202
+ let base_{{ r }} = min(row0 + {{ r }}u, ROWS - 1u) * K;
203
+ {% endfor %}
204
+
205
+ {% if inlineNorm %}
206
+ var local_sq = 0.0;
207
+ for (var d = tid; d < K; d = d + WG) {
208
+ let value = row_value(base_0 + d);
209
+ local_sq = local_sq + value * value;
210
+ }
211
+ let inv = inverseSqrt(reduce_sum(local_sq, tid) / f32(K) + EPSILON);
212
+ if (tid == 0u) {
213
+ row_inv = inv;
214
+ }
215
+ // Separates the reduction's readers of partial[0] from the projection's
216
+ // reuse of the same workgroup array below.
217
+ workgroupBarrier();
218
+ {% if writeResidual %}
219
+ // Every N tile computes the same residual row; only the first one stores it,
220
+ // so the tiles never write the same location.
221
+ if (wg.x == 0u) {
222
+ for (var d = tid; d < K; d = d + WG) {
223
+ residual[base_0 + d] = {{ scalar }}(row_value(base_0 + d));
224
+ }
225
+ }
226
+ {% endif %}
227
+ {% endif %}
228
+
229
+ {% for r in range(rowTile) %}
230
+ var acc_gate_{{ r }} = 0.0;
231
+ var acc_up_{{ r }} = 0.0;
232
+ {% endfor %}
233
+ if (n < N) {
234
+ for (var block = 0u; block < KBLOCKS; block = block + 1u) {
235
+ let gate_scale = f32(gate_scales[n * KBLOCKS + block]);
236
+ let up_scale = f32(up_scales[n * KBLOCKS + block]);
237
+ let k_base = block * BLOCK_SIZE;
238
+ {% for r in range(rowTile) %}
239
+ var block_gate_{{ r }} = 0.0;
240
+ var block_up_{{ r }} = 0.0;
241
+ {% endfor %}
242
+ // Each trip handles two codes. BLOCK_SIZE is even for every admitted
243
+ // packing, so paired trips cover a full block. Only a final partial block
244
+ // needs bounds checks; the branch is workgroup-uniform.
245
+ if (k_base + BLOCK_SIZE <= K) {
246
+ {{ walk_block(false) }}
247
+ } else {
248
+ {{ walk_block(true) }}
249
+ }
250
+ {% for r in range(rowTile) %}
251
+ acc_gate_{{ r }} = acc_gate_{{ r }} + block_gate_{{ r }} * gate_scale;
252
+ acc_up_{{ r }} = acc_up_{{ r }} + block_up_{{ r }} * up_scale;
253
+ {% endfor %}
254
+ }
255
+ }
256
+
257
+ {% for r in range(rowTile) %}
258
+ red_gate[{{ r }}u * WG + tid] = acc_gate_{{ r }};
259
+ red_up[{{ r }}u * WG + tid] = acc_up_{{ r }};
260
+ {% endfor %}
261
+ workgroupBarrier();
262
+ // Fold within each column's own LANES-wide group, one group per staged row.
263
+ // LANES is a power of two, so lane + stride never leaves the group and no
264
+ // column can read another's tail.
265
+ for (var stride = LANES / 2u; stride > 0u; stride = stride / 2u) {
266
+ if (lane < stride) {
267
+ {% for r in range(rowTile) %}
268
+ red_gate[{{ r }}u * WG + tid] = red_gate[{{ r }}u * WG + tid] + red_gate[{{ r }}u * WG + tid + stride];
269
+ red_up[{{ r }}u * WG + tid] = red_up[{{ r }}u * WG + tid] + red_up[{{ r }}u * WG + tid + stride];
270
+ {% endfor %}
271
+ }
272
+ workgroupBarrier();
273
+ }
274
+
275
+ if (lane == 0u && n < N) {
276
+ {% for r in range(rowTile) %}
277
+ if (row0 + {{ r }}u < ROWS) {
278
+ var gate_value_{{ r }} = red_gate[{{ r }}u * WG + tid];
279
+ var up_value_{{ r }} = red_up[{{ r }}u * WG + tid];
280
+ {% if hasGateBias %}
281
+ gate_value_{{ r }} = gate_value_{{ r }} + f32(gate_bias[n]);
282
+ {% endif %}
283
+ {% if hasUpBias %}
284
+ up_value_{{ r }} = up_value_{{ r }} + f32(up_bias[n]);
285
+ {% endif %}
286
+ y[(row0 + {{ r }}u) * N + n] = {{ scalar }}(silu(gate_value_{{ r }}) * up_value_{{ r }});
287
+ }
288
+ {% endfor %}
289
+ }
290
+ }
build/webgpu/test.json ADDED
@@ -0,0 +1,1703 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "op": "com.microsoft.MatMulNBitsMlp",
3
+ "fixtureArrays": {
4
+ "pinned_plain_gb_ub_input_aT": [0.9181, 1.1011, 1.115, 0.9522, 0.6333, 0.2043, -0.2696, -0.7143, -1.0586, -1.2453, -1.2411, -1.0421, -0.6753, -0.1947, 0.3263, 0.8068, 1.1707, 1.3587, 1.3385, 1.1098, 0.7051, 0.1852, -0.3707, -0.8762, -1.2521, -1.4384, -1.4042, -1.1526, -0.7208, -0.1744, 0.4029, 0.9218],
5
+ "pinned_plain_gb_ub_input_gateBT": [52, 93, 210, 163, 160, 89, 30, 255, 204, 21, 42, 27, 184, 145, 246, 247, 100, 205, 130, 147, 208, 201, 206, 239, 252, 133, 218, 11, 232, 1, 166, 231],
6
+ "pinned_plain_gb_ub_input_upBT": [248, 209, 54, 55, 164, 13, 194, 211, 16, 9, 14, 47, 60, 197, 26, 75, 40, 65, 230, 39, 212, 125, 114, 195, 64, 121, 190, 31, 108, 53, 202, 59],
7
+ "pinned_norm_nogb_noub_input_normScaleT": [1.1719, 1.2817, 1.29, 1.1936, 1.0274, 0.8514, 0.7289, 0.7042, 0.7862, 0.9454, 1.1242, 1.2582, 1.2991, 1.2321, 1.0814, 0.9013]
8
+ },
9
+ "cases": [
10
+ {
11
+ "name": "plain_nogb_noub",
12
+ "attrs": { "K": 32, "N": 8, "block_size": 16, "activation": "silu" },
13
+ "inputs": {
14
+ "aT": {
15
+ "dtype": "float32",
16
+ "shape": [3, 32],
17
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
18
+ },
19
+ "gateBT": {
20
+ "dtype": "uint8",
21
+ "shape": [8, 2, 8],
22
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
23
+ },
24
+ "gateScalesT": {
25
+ "dtype": "float32",
26
+ "shape": [8, 2],
27
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
28
+ },
29
+ "upBT": {
30
+ "dtype": "uint8",
31
+ "shape": [8, 2, 8],
32
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
33
+ },
34
+ "upScalesT": {
35
+ "dtype": "float32",
36
+ "shape": [8, 2],
37
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
38
+ }
39
+ },
40
+ "outputs": { "yT": { "dtype": "float32", "shape": [3, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
41
+ },
42
+ {
43
+ "name": "plain_nogb_ub",
44
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
45
+ "inputs": {
46
+ "aT": {
47
+ "dtype": "float32",
48
+ "shape": [3, 32],
49
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
50
+ },
51
+ "gateBT": {
52
+ "dtype": "uint8",
53
+ "shape": [8, 2, 8],
54
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
55
+ },
56
+ "gateScalesT": {
57
+ "dtype": "float32",
58
+ "shape": [8, 2],
59
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
60
+ },
61
+ "upBT": {
62
+ "dtype": "uint8",
63
+ "shape": [8, 2, 8],
64
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
65
+ },
66
+ "upScalesT": {
67
+ "dtype": "float32",
68
+ "shape": [8, 2],
69
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
70
+ },
71
+ "upBiasT": {
72
+ "dtype": "float32",
73
+ "shape": [8],
74
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
75
+ }
76
+ },
77
+ "outputs": { "yT": { "dtype": "float32", "shape": [3, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
78
+ },
79
+ {
80
+ "name": "plain_gb_noub",
81
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
82
+ "inputs": {
83
+ "aT": {
84
+ "dtype": "float32",
85
+ "shape": [3, 32],
86
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
87
+ },
88
+ "gateBT": {
89
+ "dtype": "uint8",
90
+ "shape": [8, 2, 8],
91
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
92
+ },
93
+ "gateScalesT": {
94
+ "dtype": "float32",
95
+ "shape": [8, 2],
96
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
97
+ },
98
+ "gateBiasT": {
99
+ "dtype": "float32",
100
+ "shape": [8],
101
+ "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.53, "scale": 0.3 }
102
+ },
103
+ "upBT": {
104
+ "dtype": "uint8",
105
+ "shape": [8, 2, 8],
106
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
107
+ },
108
+ "upScalesT": {
109
+ "dtype": "float32",
110
+ "shape": [8, 2],
111
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
112
+ }
113
+ },
114
+ "outputs": { "yT": { "dtype": "float32", "shape": [3, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
115
+ },
116
+ {
117
+ "name": "plain_gb_ub",
118
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
119
+ "inputs": {
120
+ "aT": {
121
+ "dtype": "float32",
122
+ "shape": [3, 32],
123
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
124
+ },
125
+ "gateBT": {
126
+ "dtype": "uint8",
127
+ "shape": [8, 2, 8],
128
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
129
+ },
130
+ "gateScalesT": {
131
+ "dtype": "float32",
132
+ "shape": [8, 2],
133
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
134
+ },
135
+ "gateBiasT": {
136
+ "dtype": "float32",
137
+ "shape": [8],
138
+ "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.53, "scale": 0.3 }
139
+ },
140
+ "upBT": {
141
+ "dtype": "uint8",
142
+ "shape": [8, 2, 8],
143
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
144
+ },
145
+ "upScalesT": {
146
+ "dtype": "float32",
147
+ "shape": [8, 2],
148
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
149
+ },
150
+ "upBiasT": {
151
+ "dtype": "float32",
152
+ "shape": [8],
153
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
154
+ }
155
+ },
156
+ "outputs": { "yT": { "dtype": "float32", "shape": [3, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
157
+ },
158
+ {
159
+ "name": "decode_norm_nogb_noub",
160
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
161
+ "inputs": {
162
+ "aT": {
163
+ "dtype": "float32",
164
+ "shape": [1, 32],
165
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
166
+ },
167
+ "normScaleT": {
168
+ "dtype": "float32",
169
+ "shape": [32],
170
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
171
+ },
172
+ "gateBT": {
173
+ "dtype": "uint8",
174
+ "shape": [8, 2, 8],
175
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
176
+ },
177
+ "gateScalesT": {
178
+ "dtype": "float32",
179
+ "shape": [8, 2],
180
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
181
+ },
182
+ "upBT": {
183
+ "dtype": "uint8",
184
+ "shape": [8, 2, 8],
185
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
186
+ },
187
+ "upScalesT": {
188
+ "dtype": "float32",
189
+ "shape": [8, 2],
190
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
191
+ }
192
+ },
193
+ "outputs": { "yT": { "dtype": "float32", "shape": [1, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
194
+ },
195
+ {
196
+ "name": "decode_skip_nogb_noub",
197
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
198
+ "inputs": {
199
+ "aT": {
200
+ "dtype": "float32",
201
+ "shape": [1, 32],
202
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
203
+ },
204
+ "skipT": {
205
+ "dtype": "float32",
206
+ "shape": [1, 32],
207
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.5 }
208
+ },
209
+ "normScaleT": {
210
+ "dtype": "float32",
211
+ "shape": [32],
212
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
213
+ },
214
+ "gateBT": {
215
+ "dtype": "uint8",
216
+ "shape": [8, 2, 8],
217
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
218
+ },
219
+ "gateScalesT": {
220
+ "dtype": "float32",
221
+ "shape": [8, 2],
222
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
223
+ },
224
+ "upBT": {
225
+ "dtype": "uint8",
226
+ "shape": [8, 2, 8],
227
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
228
+ },
229
+ "upScalesT": {
230
+ "dtype": "float32",
231
+ "shape": [8, 2],
232
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
233
+ }
234
+ },
235
+ "outputs": { "yT": { "dtype": "float32", "shape": [1, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
236
+ },
237
+ {
238
+ "name": "decode_skipsum_nogb_noub",
239
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu", "epsilon": 0.001 },
240
+ "inputs": {
241
+ "aT": {
242
+ "dtype": "float32",
243
+ "shape": [1, 32],
244
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
245
+ },
246
+ "skipT": {
247
+ "dtype": "float32",
248
+ "shape": [1, 32],
249
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.5 }
250
+ },
251
+ "normScaleT": {
252
+ "dtype": "float32",
253
+ "shape": [32],
254
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
255
+ },
256
+ "gateBT": {
257
+ "dtype": "uint8",
258
+ "shape": [8, 2, 8],
259
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
260
+ },
261
+ "gateScalesT": {
262
+ "dtype": "float32",
263
+ "shape": [8, 2],
264
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
265
+ },
266
+ "upBT": {
267
+ "dtype": "uint8",
268
+ "shape": [8, 2, 8],
269
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
270
+ },
271
+ "upScalesT": {
272
+ "dtype": "float32",
273
+ "shape": [8, 2],
274
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
275
+ }
276
+ },
277
+ "outputs": {
278
+ "yT": { "dtype": "float32", "shape": [1, 8], "tolerance": 0.0001, "relTolerance": 0.0001 },
279
+ "residualT": { "dtype": "float32", "shape": [1, 32], "tolerance": 0.000001, "relTolerance": 0.000001 }
280
+ }
281
+ },
282
+ {
283
+ "name": "decode_norm_nogb_ub",
284
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
285
+ "inputs": {
286
+ "aT": {
287
+ "dtype": "float32",
288
+ "shape": [1, 32],
289
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
290
+ },
291
+ "normScaleT": {
292
+ "dtype": "float32",
293
+ "shape": [32],
294
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
295
+ },
296
+ "gateBT": {
297
+ "dtype": "uint8",
298
+ "shape": [8, 2, 8],
299
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
300
+ },
301
+ "gateScalesT": {
302
+ "dtype": "float32",
303
+ "shape": [8, 2],
304
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
305
+ },
306
+ "upBT": {
307
+ "dtype": "uint8",
308
+ "shape": [8, 2, 8],
309
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
310
+ },
311
+ "upScalesT": {
312
+ "dtype": "float32",
313
+ "shape": [8, 2],
314
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
315
+ },
316
+ "upBiasT": {
317
+ "dtype": "float32",
318
+ "shape": [8],
319
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
320
+ }
321
+ },
322
+ "outputs": { "yT": { "dtype": "float32", "shape": [1, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
323
+ },
324
+ {
325
+ "name": "decode_skip_nogb_ub",
326
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
327
+ "inputs": {
328
+ "aT": {
329
+ "dtype": "float32",
330
+ "shape": [1, 32],
331
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
332
+ },
333
+ "skipT": {
334
+ "dtype": "float32",
335
+ "shape": [1, 32],
336
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.5 }
337
+ },
338
+ "normScaleT": {
339
+ "dtype": "float32",
340
+ "shape": [32],
341
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
342
+ },
343
+ "gateBT": {
344
+ "dtype": "uint8",
345
+ "shape": [8, 2, 8],
346
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
347
+ },
348
+ "gateScalesT": {
349
+ "dtype": "float32",
350
+ "shape": [8, 2],
351
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
352
+ },
353
+ "upBT": {
354
+ "dtype": "uint8",
355
+ "shape": [8, 2, 8],
356
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
357
+ },
358
+ "upScalesT": {
359
+ "dtype": "float32",
360
+ "shape": [8, 2],
361
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
362
+ },
363
+ "upBiasT": {
364
+ "dtype": "float32",
365
+ "shape": [8],
366
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
367
+ }
368
+ },
369
+ "outputs": { "yT": { "dtype": "float32", "shape": [1, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
370
+ },
371
+ {
372
+ "name": "decode_skipsum_nogb_ub",
373
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
374
+ "inputs": {
375
+ "aT": {
376
+ "dtype": "float32",
377
+ "shape": [1, 32],
378
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
379
+ },
380
+ "skipT": {
381
+ "dtype": "float32",
382
+ "shape": [1, 32],
383
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.5 }
384
+ },
385
+ "normScaleT": {
386
+ "dtype": "float32",
387
+ "shape": [32],
388
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
389
+ },
390
+ "gateBT": {
391
+ "dtype": "uint8",
392
+ "shape": [8, 2, 8],
393
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
394
+ },
395
+ "gateScalesT": {
396
+ "dtype": "float32",
397
+ "shape": [8, 2],
398
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
399
+ },
400
+ "upBT": {
401
+ "dtype": "uint8",
402
+ "shape": [8, 2, 8],
403
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
404
+ },
405
+ "upScalesT": {
406
+ "dtype": "float32",
407
+ "shape": [8, 2],
408
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
409
+ },
410
+ "upBiasT": {
411
+ "dtype": "float32",
412
+ "shape": [8],
413
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
414
+ }
415
+ },
416
+ "outputs": {
417
+ "yT": { "dtype": "float32", "shape": [1, 8], "tolerance": 0.0001, "relTolerance": 0.0001 },
418
+ "residualT": { "dtype": "float32", "shape": [1, 32], "tolerance": 0.000001, "relTolerance": 0.000001 }
419
+ }
420
+ },
421
+ {
422
+ "name": "decode_norm_gb_noub",
423
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
424
+ "inputs": {
425
+ "aT": {
426
+ "dtype": "float32",
427
+ "shape": [1, 32],
428
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
429
+ },
430
+ "normScaleT": {
431
+ "dtype": "float32",
432
+ "shape": [32],
433
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
434
+ },
435
+ "gateBT": {
436
+ "dtype": "uint8",
437
+ "shape": [8, 2, 8],
438
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
439
+ },
440
+ "gateScalesT": {
441
+ "dtype": "float32",
442
+ "shape": [8, 2],
443
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
444
+ },
445
+ "gateBiasT": {
446
+ "dtype": "float32",
447
+ "shape": [8],
448
+ "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.53, "scale": 0.3 }
449
+ },
450
+ "upBT": {
451
+ "dtype": "uint8",
452
+ "shape": [8, 2, 8],
453
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
454
+ },
455
+ "upScalesT": {
456
+ "dtype": "float32",
457
+ "shape": [8, 2],
458
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
459
+ }
460
+ },
461
+ "outputs": { "yT": { "dtype": "float32", "shape": [1, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
462
+ },
463
+ {
464
+ "name": "decode_skip_gb_noub",
465
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
466
+ "inputs": {
467
+ "aT": {
468
+ "dtype": "float32",
469
+ "shape": [1, 32],
470
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
471
+ },
472
+ "skipT": {
473
+ "dtype": "float32",
474
+ "shape": [1, 32],
475
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.5 }
476
+ },
477
+ "normScaleT": {
478
+ "dtype": "float32",
479
+ "shape": [32],
480
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
481
+ },
482
+ "gateBT": {
483
+ "dtype": "uint8",
484
+ "shape": [8, 2, 8],
485
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
486
+ },
487
+ "gateScalesT": {
488
+ "dtype": "float32",
489
+ "shape": [8, 2],
490
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
491
+ },
492
+ "gateBiasT": {
493
+ "dtype": "float32",
494
+ "shape": [8],
495
+ "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.53, "scale": 0.3 }
496
+ },
497
+ "upBT": {
498
+ "dtype": "uint8",
499
+ "shape": [8, 2, 8],
500
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
501
+ },
502
+ "upScalesT": {
503
+ "dtype": "float32",
504
+ "shape": [8, 2],
505
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
506
+ }
507
+ },
508
+ "outputs": { "yT": { "dtype": "float32", "shape": [1, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
509
+ },
510
+ {
511
+ "name": "decode_skipsum_gb_noub",
512
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
513
+ "inputs": {
514
+ "aT": {
515
+ "dtype": "float32",
516
+ "shape": [1, 32],
517
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
518
+ },
519
+ "skipT": {
520
+ "dtype": "float32",
521
+ "shape": [1, 32],
522
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.5 }
523
+ },
524
+ "normScaleT": {
525
+ "dtype": "float32",
526
+ "shape": [32],
527
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
528
+ },
529
+ "gateBT": {
530
+ "dtype": "uint8",
531
+ "shape": [8, 2, 8],
532
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
533
+ },
534
+ "gateScalesT": {
535
+ "dtype": "float32",
536
+ "shape": [8, 2],
537
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
538
+ },
539
+ "gateBiasT": {
540
+ "dtype": "float32",
541
+ "shape": [8],
542
+ "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.53, "scale": 0.3 }
543
+ },
544
+ "upBT": {
545
+ "dtype": "uint8",
546
+ "shape": [8, 2, 8],
547
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
548
+ },
549
+ "upScalesT": {
550
+ "dtype": "float32",
551
+ "shape": [8, 2],
552
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
553
+ }
554
+ },
555
+ "outputs": {
556
+ "yT": { "dtype": "float32", "shape": [1, 8], "tolerance": 0.0001, "relTolerance": 0.0001 },
557
+ "residualT": { "dtype": "float32", "shape": [1, 32], "tolerance": 0.000001, "relTolerance": 0.000001 }
558
+ }
559
+ },
560
+ {
561
+ "name": "decode_norm_gb_ub",
562
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
563
+ "inputs": {
564
+ "aT": {
565
+ "dtype": "float32",
566
+ "shape": [1, 32],
567
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
568
+ },
569
+ "normScaleT": {
570
+ "dtype": "float32",
571
+ "shape": [32],
572
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
573
+ },
574
+ "gateBT": {
575
+ "dtype": "uint8",
576
+ "shape": [8, 2, 8],
577
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
578
+ },
579
+ "gateScalesT": {
580
+ "dtype": "float32",
581
+ "shape": [8, 2],
582
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
583
+ },
584
+ "gateBiasT": {
585
+ "dtype": "float32",
586
+ "shape": [8],
587
+ "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.53, "scale": 0.3 }
588
+ },
589
+ "upBT": {
590
+ "dtype": "uint8",
591
+ "shape": [8, 2, 8],
592
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
593
+ },
594
+ "upScalesT": {
595
+ "dtype": "float32",
596
+ "shape": [8, 2],
597
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
598
+ },
599
+ "upBiasT": {
600
+ "dtype": "float32",
601
+ "shape": [8],
602
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
603
+ }
604
+ },
605
+ "outputs": { "yT": { "dtype": "float32", "shape": [1, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
606
+ },
607
+ {
608
+ "name": "decode_skip_gb_ub",
609
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
610
+ "inputs": {
611
+ "aT": {
612
+ "dtype": "float32",
613
+ "shape": [1, 32],
614
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
615
+ },
616
+ "skipT": {
617
+ "dtype": "float32",
618
+ "shape": [1, 32],
619
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.5 }
620
+ },
621
+ "normScaleT": {
622
+ "dtype": "float32",
623
+ "shape": [32],
624
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
625
+ },
626
+ "gateBT": {
627
+ "dtype": "uint8",
628
+ "shape": [8, 2, 8],
629
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
630
+ },
631
+ "gateScalesT": {
632
+ "dtype": "float32",
633
+ "shape": [8, 2],
634
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
635
+ },
636
+ "gateBiasT": {
637
+ "dtype": "float32",
638
+ "shape": [8],
639
+ "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.53, "scale": 0.3 }
640
+ },
641
+ "upBT": {
642
+ "dtype": "uint8",
643
+ "shape": [8, 2, 8],
644
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
645
+ },
646
+ "upScalesT": {
647
+ "dtype": "float32",
648
+ "shape": [8, 2],
649
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
650
+ },
651
+ "upBiasT": {
652
+ "dtype": "float32",
653
+ "shape": [8],
654
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
655
+ }
656
+ },
657
+ "outputs": { "yT": { "dtype": "float32", "shape": [1, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
658
+ },
659
+ {
660
+ "name": "decode_skipsum_gb_ub",
661
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
662
+ "inputs": {
663
+ "aT": {
664
+ "dtype": "float32",
665
+ "shape": [1, 32],
666
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
667
+ },
668
+ "skipT": {
669
+ "dtype": "float32",
670
+ "shape": [1, 32],
671
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.5 }
672
+ },
673
+ "normScaleT": {
674
+ "dtype": "float32",
675
+ "shape": [32],
676
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
677
+ },
678
+ "gateBT": {
679
+ "dtype": "uint8",
680
+ "shape": [8, 2, 8],
681
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
682
+ },
683
+ "gateScalesT": {
684
+ "dtype": "float32",
685
+ "shape": [8, 2],
686
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
687
+ },
688
+ "gateBiasT": {
689
+ "dtype": "float32",
690
+ "shape": [8],
691
+ "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.53, "scale": 0.3 }
692
+ },
693
+ "upBT": {
694
+ "dtype": "uint8",
695
+ "shape": [8, 2, 8],
696
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
697
+ },
698
+ "upScalesT": {
699
+ "dtype": "float32",
700
+ "shape": [8, 2],
701
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
702
+ },
703
+ "upBiasT": {
704
+ "dtype": "float32",
705
+ "shape": [8],
706
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
707
+ }
708
+ },
709
+ "outputs": {
710
+ "yT": { "dtype": "float32", "shape": [1, 8], "tolerance": 0.0001, "relTolerance": 0.0001 },
711
+ "residualT": { "dtype": "float32", "shape": [1, 32], "tolerance": 0.000001, "relTolerance": 0.000001 }
712
+ }
713
+ },
714
+ {
715
+ "name": "prefill_norm_nogb_noub",
716
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
717
+ "inputs": {
718
+ "aT": {
719
+ "dtype": "float32",
720
+ "shape": [5, 32],
721
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
722
+ },
723
+ "normScaleT": {
724
+ "dtype": "float32",
725
+ "shape": [32],
726
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
727
+ },
728
+ "gateBT": {
729
+ "dtype": "uint8",
730
+ "shape": [8, 2, 8],
731
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
732
+ },
733
+ "gateScalesT": {
734
+ "dtype": "float32",
735
+ "shape": [8, 2],
736
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
737
+ },
738
+ "upBT": {
739
+ "dtype": "uint8",
740
+ "shape": [8, 2, 8],
741
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
742
+ },
743
+ "upScalesT": {
744
+ "dtype": "float32",
745
+ "shape": [8, 2],
746
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
747
+ }
748
+ },
749
+ "outputs": { "yT": { "dtype": "float32", "shape": [5, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
750
+ },
751
+ {
752
+ "name": "prefill_norm_nogb_ub",
753
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
754
+ "inputs": {
755
+ "aT": {
756
+ "dtype": "float32",
757
+ "shape": [5, 32],
758
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
759
+ },
760
+ "normScaleT": {
761
+ "dtype": "float32",
762
+ "shape": [32],
763
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
764
+ },
765
+ "gateBT": {
766
+ "dtype": "uint8",
767
+ "shape": [8, 2, 8],
768
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
769
+ },
770
+ "gateScalesT": {
771
+ "dtype": "float32",
772
+ "shape": [8, 2],
773
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
774
+ },
775
+ "upBT": {
776
+ "dtype": "uint8",
777
+ "shape": [8, 2, 8],
778
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
779
+ },
780
+ "upScalesT": {
781
+ "dtype": "float32",
782
+ "shape": [8, 2],
783
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
784
+ },
785
+ "upBiasT": {
786
+ "dtype": "float32",
787
+ "shape": [8],
788
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
789
+ }
790
+ },
791
+ "outputs": { "yT": { "dtype": "float32", "shape": [5, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
792
+ },
793
+ {
794
+ "name": "prefill_norm_gb_noub",
795
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
796
+ "inputs": {
797
+ "aT": {
798
+ "dtype": "float32",
799
+ "shape": [5, 32],
800
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
801
+ },
802
+ "normScaleT": {
803
+ "dtype": "float32",
804
+ "shape": [32],
805
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
806
+ },
807
+ "gateBT": {
808
+ "dtype": "uint8",
809
+ "shape": [8, 2, 8],
810
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
811
+ },
812
+ "gateScalesT": {
813
+ "dtype": "float32",
814
+ "shape": [8, 2],
815
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
816
+ },
817
+ "gateBiasT": {
818
+ "dtype": "float32",
819
+ "shape": [8],
820
+ "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.53, "scale": 0.3 }
821
+ },
822
+ "upBT": {
823
+ "dtype": "uint8",
824
+ "shape": [8, 2, 8],
825
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
826
+ },
827
+ "upScalesT": {
828
+ "dtype": "float32",
829
+ "shape": [8, 2],
830
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
831
+ }
832
+ },
833
+ "outputs": { "yT": { "dtype": "float32", "shape": [5, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
834
+ },
835
+ {
836
+ "name": "prefill_norm_gb_ub",
837
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
838
+ "inputs": {
839
+ "aT": {
840
+ "dtype": "float32",
841
+ "shape": [5, 32],
842
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
843
+ },
844
+ "normScaleT": {
845
+ "dtype": "float32",
846
+ "shape": [32],
847
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
848
+ },
849
+ "gateBT": {
850
+ "dtype": "uint8",
851
+ "shape": [8, 2, 8],
852
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
853
+ },
854
+ "gateScalesT": {
855
+ "dtype": "float32",
856
+ "shape": [8, 2],
857
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
858
+ },
859
+ "gateBiasT": {
860
+ "dtype": "float32",
861
+ "shape": [8],
862
+ "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.53, "scale": 0.3 }
863
+ },
864
+ "upBT": {
865
+ "dtype": "uint8",
866
+ "shape": [8, 2, 8],
867
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
868
+ },
869
+ "upScalesT": {
870
+ "dtype": "float32",
871
+ "shape": [8, 2],
872
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
873
+ },
874
+ "upBiasT": {
875
+ "dtype": "float32",
876
+ "shape": [8],
877
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
878
+ }
879
+ },
880
+ "outputs": { "yT": { "dtype": "float32", "shape": [5, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
881
+ },
882
+ {
883
+ "name": "prefill_skip_gb_ub",
884
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
885
+ "inputs": {
886
+ "aT": {
887
+ "dtype": "float32",
888
+ "shape": [5, 32],
889
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
890
+ },
891
+ "skipT": {
892
+ "dtype": "float32",
893
+ "shape": [5, 32],
894
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.5 }
895
+ },
896
+ "normScaleT": {
897
+ "dtype": "float32",
898
+ "shape": [32],
899
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
900
+ },
901
+ "gateBT": {
902
+ "dtype": "uint8",
903
+ "shape": [8, 2, 8],
904
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
905
+ },
906
+ "gateScalesT": {
907
+ "dtype": "float32",
908
+ "shape": [8, 2],
909
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
910
+ },
911
+ "gateBiasT": {
912
+ "dtype": "float32",
913
+ "shape": [8],
914
+ "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.53, "scale": 0.3 }
915
+ },
916
+ "upBT": {
917
+ "dtype": "uint8",
918
+ "shape": [8, 2, 8],
919
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
920
+ },
921
+ "upScalesT": {
922
+ "dtype": "float32",
923
+ "shape": [8, 2],
924
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
925
+ },
926
+ "upBiasT": {
927
+ "dtype": "float32",
928
+ "shape": [8],
929
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
930
+ }
931
+ },
932
+ "outputs": { "yT": { "dtype": "float32", "shape": [5, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
933
+ },
934
+ {
935
+ "name": "prefill_skipsum_gb_ub",
936
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
937
+ "inputs": {
938
+ "aT": {
939
+ "dtype": "float32",
940
+ "shape": [5, 32],
941
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
942
+ },
943
+ "skipT": {
944
+ "dtype": "float32",
945
+ "shape": [5, 32],
946
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.5 }
947
+ },
948
+ "normScaleT": {
949
+ "dtype": "float32",
950
+ "shape": [32],
951
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
952
+ },
953
+ "gateBT": {
954
+ "dtype": "uint8",
955
+ "shape": [8, 2, 8],
956
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
957
+ },
958
+ "gateScalesT": {
959
+ "dtype": "float32",
960
+ "shape": [8, 2],
961
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
962
+ },
963
+ "gateBiasT": {
964
+ "dtype": "float32",
965
+ "shape": [8],
966
+ "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.53, "scale": 0.3 }
967
+ },
968
+ "upBT": {
969
+ "dtype": "uint8",
970
+ "shape": [8, 2, 8],
971
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
972
+ },
973
+ "upScalesT": {
974
+ "dtype": "float32",
975
+ "shape": [8, 2],
976
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
977
+ },
978
+ "upBiasT": {
979
+ "dtype": "float32",
980
+ "shape": [8],
981
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
982
+ }
983
+ },
984
+ "outputs": {
985
+ "yT": { "dtype": "float32", "shape": [5, 8], "tolerance": 0.0001, "relTolerance": 0.0001 },
986
+ "residualT": { "dtype": "float32", "shape": [5, 32], "tolerance": 0.000001, "relTolerance": 0.000001 }
987
+ }
988
+ },
989
+ {
990
+ "name": "tail_column_not_tile_aligned",
991
+ "provenance": {
992
+ "notes": "N is not a multiple of the column tile, so the last tile's out-of-range lanes must contribute nothing."
993
+ },
994
+ "attrs": { "K": 32, "N": 5, "bits": 4, "block_size": 16, "activation": "silu" },
995
+ "inputs": {
996
+ "aT": {
997
+ "dtype": "float32",
998
+ "shape": [2, 32],
999
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
1000
+ },
1001
+ "normScaleT": {
1002
+ "dtype": "float32",
1003
+ "shape": [32],
1004
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
1005
+ },
1006
+ "gateBT": {
1007
+ "dtype": "uint8",
1008
+ "shape": [5, 2, 8],
1009
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
1010
+ },
1011
+ "gateScalesT": {
1012
+ "dtype": "float32",
1013
+ "shape": [5, 2],
1014
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
1015
+ },
1016
+ "gateBiasT": {
1017
+ "dtype": "float32",
1018
+ "shape": [5],
1019
+ "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.53, "scale": 0.3 }
1020
+ },
1021
+ "upBT": {
1022
+ "dtype": "uint8",
1023
+ "shape": [5, 2, 8],
1024
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
1025
+ },
1026
+ "upScalesT": {
1027
+ "dtype": "float32",
1028
+ "shape": [5, 2],
1029
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
1030
+ },
1031
+ "upBiasT": {
1032
+ "dtype": "float32",
1033
+ "shape": [5],
1034
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
1035
+ }
1036
+ },
1037
+ "outputs": { "yT": { "dtype": "float32", "shape": [2, 5], "tolerance": 0.0001, "relTolerance": 0.0001 } }
1038
+ },
1039
+ {
1040
+ "name": "tail_block_partial_k",
1041
+ "provenance": { "notes": "K is not a multiple of block_size, so the final block is partly out of range." },
1042
+ "attrs": { "K": 20, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
1043
+ "inputs": {
1044
+ "aT": {
1045
+ "dtype": "float32",
1046
+ "shape": [2, 20],
1047
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
1048
+ },
1049
+ "normScaleT": {
1050
+ "dtype": "float32",
1051
+ "shape": [20],
1052
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
1053
+ },
1054
+ "gateBT": {
1055
+ "dtype": "uint8",
1056
+ "shape": [8, 2, 8],
1057
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
1058
+ },
1059
+ "gateScalesT": {
1060
+ "dtype": "float32",
1061
+ "shape": [8, 2],
1062
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
1063
+ },
1064
+ "gateBiasT": {
1065
+ "dtype": "float32",
1066
+ "shape": [8],
1067
+ "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.53, "scale": 0.3 }
1068
+ },
1069
+ "upBT": {
1070
+ "dtype": "uint8",
1071
+ "shape": [8, 2, 8],
1072
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
1073
+ },
1074
+ "upScalesT": {
1075
+ "dtype": "float32",
1076
+ "shape": [8, 2],
1077
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
1078
+ },
1079
+ "upBiasT": {
1080
+ "dtype": "float32",
1081
+ "shape": [8],
1082
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
1083
+ }
1084
+ },
1085
+ "outputs": { "yT": { "dtype": "float32", "shape": [2, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
1086
+ },
1087
+ {
1088
+ "name": "rank3_activation",
1089
+ "provenance": { "notes": "Rank-3 activation: the leading axes fold into the row count." },
1090
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
1091
+ "inputs": {
1092
+ "aT": {
1093
+ "dtype": "float32",
1094
+ "shape": [1, 4, 32],
1095
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
1096
+ },
1097
+ "normScaleT": {
1098
+ "dtype": "float32",
1099
+ "shape": [32],
1100
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
1101
+ },
1102
+ "gateBT": {
1103
+ "dtype": "uint8",
1104
+ "shape": [8, 2, 8],
1105
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
1106
+ },
1107
+ "gateScalesT": {
1108
+ "dtype": "float32",
1109
+ "shape": [8, 2],
1110
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
1111
+ },
1112
+ "gateBiasT": {
1113
+ "dtype": "float32",
1114
+ "shape": [8],
1115
+ "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.53, "scale": 0.3 }
1116
+ },
1117
+ "upBT": {
1118
+ "dtype": "uint8",
1119
+ "shape": [8, 2, 8],
1120
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
1121
+ },
1122
+ "upScalesT": {
1123
+ "dtype": "float32",
1124
+ "shape": [8, 2],
1125
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
1126
+ },
1127
+ "upBiasT": {
1128
+ "dtype": "float32",
1129
+ "shape": [8],
1130
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
1131
+ }
1132
+ },
1133
+ "outputs": { "yT": { "dtype": "float32", "shape": [1, 4, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
1134
+ },
1135
+ {
1136
+ "name": "bits2_decode",
1137
+ "provenance": { "notes": "2-bit codes pack four per stored byte with a default zero point of 2." },
1138
+ "attrs": { "K": 32, "N": 8, "bits": 2, "block_size": 16, "activation": "silu" },
1139
+ "inputs": {
1140
+ "aT": {
1141
+ "dtype": "float32",
1142
+ "shape": [1, 32],
1143
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
1144
+ },
1145
+ "normScaleT": {
1146
+ "dtype": "float32",
1147
+ "shape": [32],
1148
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
1149
+ },
1150
+ "gateBT": {
1151
+ "dtype": "uint8",
1152
+ "shape": [8, 2, 4],
1153
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
1154
+ },
1155
+ "gateScalesT": {
1156
+ "dtype": "float32",
1157
+ "shape": [8, 2],
1158
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
1159
+ },
1160
+ "gateBiasT": {
1161
+ "dtype": "float32",
1162
+ "shape": [8],
1163
+ "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.53, "scale": 0.3 }
1164
+ },
1165
+ "upBT": {
1166
+ "dtype": "uint8",
1167
+ "shape": [8, 2, 4],
1168
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
1169
+ },
1170
+ "upScalesT": {
1171
+ "dtype": "float32",
1172
+ "shape": [8, 2],
1173
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
1174
+ },
1175
+ "upBiasT": {
1176
+ "dtype": "float32",
1177
+ "shape": [8],
1178
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
1179
+ }
1180
+ },
1181
+ "outputs": { "yT": { "dtype": "float32", "shape": [1, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
1182
+ },
1183
+ {
1184
+ "name": "bits8_prefill",
1185
+ "provenance": { "notes": "8-bit codes are one byte per weight with a default zero point of 128." },
1186
+ "attrs": { "K": 32, "N": 8, "bits": 8, "block_size": 16, "activation": "silu" },
1187
+ "inputs": {
1188
+ "aT": {
1189
+ "dtype": "float32",
1190
+ "shape": [3, 32],
1191
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
1192
+ },
1193
+ "normScaleT": {
1194
+ "dtype": "float32",
1195
+ "shape": [32],
1196
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
1197
+ },
1198
+ "gateBT": {
1199
+ "dtype": "uint8",
1200
+ "shape": [8, 2, 16],
1201
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
1202
+ },
1203
+ "gateScalesT": {
1204
+ "dtype": "float32",
1205
+ "shape": [8, 2],
1206
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
1207
+ },
1208
+ "gateBiasT": {
1209
+ "dtype": "float32",
1210
+ "shape": [8],
1211
+ "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.53, "scale": 0.3 }
1212
+ },
1213
+ "upBT": {
1214
+ "dtype": "uint8",
1215
+ "shape": [8, 2, 16],
1216
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
1217
+ },
1218
+ "upScalesT": {
1219
+ "dtype": "float32",
1220
+ "shape": [8, 2],
1221
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
1222
+ },
1223
+ "upBiasT": {
1224
+ "dtype": "float32",
1225
+ "shape": [8],
1226
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
1227
+ }
1228
+ },
1229
+ "outputs": { "yT": { "dtype": "float32", "shape": [3, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
1230
+ },
1231
+ {
1232
+ "name": "block32_decode",
1233
+ "provenance": { "notes": "block_size 32, the size ONNX Runtime's fused decode kernel is specialized for." },
1234
+ "attrs": { "K": 64, "N": 8, "bits": 4, "block_size": 32, "activation": "silu" },
1235
+ "inputs": {
1236
+ "aT": {
1237
+ "dtype": "float32",
1238
+ "shape": [1, 64],
1239
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
1240
+ },
1241
+ "skipT": {
1242
+ "dtype": "float32",
1243
+ "shape": [1, 64],
1244
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.5 }
1245
+ },
1246
+ "normScaleT": {
1247
+ "dtype": "float32",
1248
+ "shape": [64],
1249
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
1250
+ },
1251
+ "gateBT": {
1252
+ "dtype": "uint8",
1253
+ "shape": [8, 2, 16],
1254
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
1255
+ },
1256
+ "gateScalesT": {
1257
+ "dtype": "float32",
1258
+ "shape": [8, 2],
1259
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
1260
+ },
1261
+ "gateBiasT": {
1262
+ "dtype": "float32",
1263
+ "shape": [8],
1264
+ "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.53, "scale": 0.3 }
1265
+ },
1266
+ "upBT": {
1267
+ "dtype": "uint8",
1268
+ "shape": [8, 2, 16],
1269
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
1270
+ },
1271
+ "upScalesT": {
1272
+ "dtype": "float32",
1273
+ "shape": [8, 2],
1274
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
1275
+ },
1276
+ "upBiasT": {
1277
+ "dtype": "float32",
1278
+ "shape": [8],
1279
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
1280
+ }
1281
+ },
1282
+ "outputs": {
1283
+ "yT": { "dtype": "float32", "shape": [1, 8], "tolerance": 0.0001, "relTolerance": 0.0001 },
1284
+ "residualT": { "dtype": "float32", "shape": [1, 64], "tolerance": 0.000001, "relTolerance": 0.000001 }
1285
+ }
1286
+ },
1287
+ {
1288
+ "name": "f16_decode_skipsum",
1289
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
1290
+ "inputs": {
1291
+ "aT": {
1292
+ "dtype": "float16",
1293
+ "shape": [1, 32],
1294
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
1295
+ },
1296
+ "skipT": {
1297
+ "dtype": "float16",
1298
+ "shape": [1, 32],
1299
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.5 }
1300
+ },
1301
+ "normScaleT": {
1302
+ "dtype": "float16",
1303
+ "shape": [32],
1304
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
1305
+ },
1306
+ "gateBT": {
1307
+ "dtype": "uint8",
1308
+ "shape": [8, 2, 8],
1309
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
1310
+ },
1311
+ "gateScalesT": {
1312
+ "dtype": "float16",
1313
+ "shape": [8, 2],
1314
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
1315
+ },
1316
+ "gateBiasT": {
1317
+ "dtype": "float16",
1318
+ "shape": [8],
1319
+ "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.53, "scale": 0.3 }
1320
+ },
1321
+ "upBT": {
1322
+ "dtype": "uint8",
1323
+ "shape": [8, 2, 8],
1324
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
1325
+ },
1326
+ "upScalesT": {
1327
+ "dtype": "float16",
1328
+ "shape": [8, 2],
1329
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
1330
+ },
1331
+ "upBiasT": {
1332
+ "dtype": "float16",
1333
+ "shape": [8],
1334
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
1335
+ }
1336
+ },
1337
+ "outputs": {
1338
+ "yT": { "dtype": "float16", "shape": [1, 8], "tolerance": 0.002, "relTolerance": 0.01 },
1339
+ "residualT": { "dtype": "float16", "shape": [1, 32], "tolerance": 0.002, "relTolerance": 0.002 }
1340
+ }
1341
+ },
1342
+ {
1343
+ "name": "f16_prefill_norm",
1344
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
1345
+ "inputs": {
1346
+ "aT": {
1347
+ "dtype": "float16",
1348
+ "shape": [4, 32],
1349
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
1350
+ },
1351
+ "normScaleT": {
1352
+ "dtype": "float16",
1353
+ "shape": [32],
1354
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
1355
+ },
1356
+ "gateBT": {
1357
+ "dtype": "uint8",
1358
+ "shape": [8, 2, 8],
1359
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
1360
+ },
1361
+ "gateScalesT": {
1362
+ "dtype": "float16",
1363
+ "shape": [8, 2],
1364
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
1365
+ },
1366
+ "gateBiasT": {
1367
+ "dtype": "float16",
1368
+ "shape": [8],
1369
+ "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.53, "scale": 0.3 }
1370
+ },
1371
+ "upBT": {
1372
+ "dtype": "uint8",
1373
+ "shape": [8, 2, 8],
1374
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
1375
+ },
1376
+ "upScalesT": {
1377
+ "dtype": "float16",
1378
+ "shape": [8, 2],
1379
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
1380
+ },
1381
+ "upBiasT": {
1382
+ "dtype": "float16",
1383
+ "shape": [8],
1384
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
1385
+ }
1386
+ },
1387
+ "outputs": { "yT": { "dtype": "float16", "shape": [4, 8], "tolerance": 0.002, "relTolerance": 0.01 } }
1388
+ },
1389
+ {
1390
+ "name": "f16_plain",
1391
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
1392
+ "inputs": {
1393
+ "aT": {
1394
+ "dtype": "float16",
1395
+ "shape": [3, 32],
1396
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
1397
+ },
1398
+ "gateBT": {
1399
+ "dtype": "uint8",
1400
+ "shape": [8, 2, 8],
1401
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
1402
+ },
1403
+ "gateScalesT": {
1404
+ "dtype": "float16",
1405
+ "shape": [8, 2],
1406
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
1407
+ },
1408
+ "gateBiasT": {
1409
+ "dtype": "float16",
1410
+ "shape": [8],
1411
+ "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.53, "scale": 0.3 }
1412
+ },
1413
+ "upBT": {
1414
+ "dtype": "uint8",
1415
+ "shape": [8, 2, 8],
1416
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
1417
+ },
1418
+ "upScalesT": {
1419
+ "dtype": "float16",
1420
+ "shape": [8, 2],
1421
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
1422
+ },
1423
+ "upBiasT": {
1424
+ "dtype": "float16",
1425
+ "shape": [8],
1426
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
1427
+ }
1428
+ },
1429
+ "outputs": { "yT": { "dtype": "float16", "shape": [3, 8], "tolerance": 0.002, "relTolerance": 0.01 } }
1430
+ },
1431
+ {
1432
+ "name": "pinned_plain_gb_ub",
1433
+ "provenance": {
1434
+ "notes": "Expected values computed by an independent implementation written from the ONNX Runtime schema text alone, so this case checks the trusted reference as well as the kernels. No normalization: the projections read A directly."
1435
+ },
1436
+ "attrs": { "K": 16, "N": 4, "bits": 4, "block_size": 8, "activation": "silu" },
1437
+ "inputs": {
1438
+ "aT": {
1439
+ "dtype": "float32",
1440
+ "shape": [2, 16],
1441
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/pinned_plain_gb_ub_input_aT" } }
1442
+ },
1443
+ "gateBT": {
1444
+ "dtype": "uint8",
1445
+ "shape": [4, 2, 4],
1446
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/pinned_plain_gb_ub_input_gateBT" } }
1447
+ },
1448
+ "gateScalesT": {
1449
+ "dtype": "float32",
1450
+ "shape": [4, 2],
1451
+ "data": { "kind": "values", "values": [0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1] }
1452
+ },
1453
+ "gateBiasT": {
1454
+ "dtype": "float32",
1455
+ "shape": [4],
1456
+ "data": { "kind": "values", "values": [0.1782, 0.1617, -0.0315, -0.1903] }
1457
+ },
1458
+ "upBT": {
1459
+ "dtype": "uint8",
1460
+ "shape": [4, 2, 4],
1461
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/pinned_plain_gb_ub_input_upBT" } }
1462
+ },
1463
+ "upScalesT": {
1464
+ "dtype": "float32",
1465
+ "shape": [4, 2],
1466
+ "data": { "kind": "values", "values": [0.05, 0.046, 0.042, 0.038, 0.034, 0.03, 0.026, 0.022] }
1467
+ },
1468
+ "upBiasT": {
1469
+ "dtype": "float32",
1470
+ "shape": [4],
1471
+ "data": { "kind": "values", "values": [0.0932, -0.0341, -0.1356, -0.1345] }
1472
+ }
1473
+ },
1474
+ "outputs": {
1475
+ "yT": {
1476
+ "dtype": "float32",
1477
+ "shape": [2, 4],
1478
+ "data": {
1479
+ "kind": "values",
1480
+ "values": [0.2154822, -0.4471286, 0.0238219, -0.4921483, 0.272635, -0.6797003, -0.0049887, -0.738616]
1481
+ },
1482
+ "tolerance": 0.00001,
1483
+ "relTolerance": 0.0001
1484
+ }
1485
+ }
1486
+ },
1487
+ {
1488
+ "name": "pinned_norm_nogb_noub",
1489
+ "provenance": {
1490
+ "notes": "Expected values computed by an independent implementation written from the ONNX Runtime schema text alone, so this case checks the trusted reference as well as the kernels. SimplifiedLayerNormalization with no biases."
1491
+ },
1492
+ "attrs": { "K": 16, "N": 4, "bits": 4, "block_size": 8, "activation": "silu" },
1493
+ "inputs": {
1494
+ "aT": {
1495
+ "dtype": "float32",
1496
+ "shape": [2, 16],
1497
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/pinned_plain_gb_ub_input_aT" } }
1498
+ },
1499
+ "normScaleT": {
1500
+ "dtype": "float32",
1501
+ "shape": [16],
1502
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/pinned_norm_nogb_noub_input_normScaleT" } }
1503
+ },
1504
+ "gateBT": {
1505
+ "dtype": "uint8",
1506
+ "shape": [4, 2, 4],
1507
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/pinned_plain_gb_ub_input_gateBT" } }
1508
+ },
1509
+ "gateScalesT": {
1510
+ "dtype": "float32",
1511
+ "shape": [4, 2],
1512
+ "data": { "kind": "values", "values": [0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1] }
1513
+ },
1514
+ "upBT": {
1515
+ "dtype": "uint8",
1516
+ "shape": [4, 2, 4],
1517
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/pinned_plain_gb_ub_input_upBT" } }
1518
+ },
1519
+ "upScalesT": {
1520
+ "dtype": "float32",
1521
+ "shape": [4, 2],
1522
+ "data": { "kind": "values", "values": [0.05, 0.046, 0.042, 0.038, 0.034, 0.03, 0.026, 0.022] }
1523
+ }
1524
+ },
1525
+ "outputs": {
1526
+ "yT": {
1527
+ "dtype": "float32",
1528
+ "shape": [2, 4],
1529
+ "data": {
1530
+ "kind": "values",
1531
+ "values": [0.0651757, -0.5406582, 0.1351256, -0.4018507, 0.0572953, -0.6108609, 0.1088786, -0.5550907]
1532
+ },
1533
+ "tolerance": 0.00001,
1534
+ "relTolerance": 0.0001
1535
+ }
1536
+ }
1537
+ },
1538
+ {
1539
+ "name": "pinned_skipsum_gb_ub",
1540
+ "provenance": {
1541
+ "notes": "Expected values computed by an independent implementation written from the ONNX Runtime schema text alone, so this case checks the trusted reference as well as the kernels. SkipSimplifiedLayerNormalization with both biases and the residual-sum output."
1542
+ },
1543
+ "attrs": { "K": 16, "N": 4, "bits": 4, "block_size": 8, "activation": "silu" },
1544
+ "inputs": {
1545
+ "aT": {
1546
+ "dtype": "float32",
1547
+ "shape": [2, 16],
1548
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/pinned_plain_gb_ub_input_aT" } }
1549
+ },
1550
+ "skipT": {
1551
+ "dtype": "float32",
1552
+ "shape": [2, 16],
1553
+ "data": {
1554
+ "kind": "values",
1555
+ "values": [0.0537, 0.2754, 0.2738, 0.0827, -0.1607, -0.2913, -0.2055, 0.0807, 0.4361, 0.6796, 0.672, 0.3892, -0.0618, -0.4922, -0.7224, -0.6678, -0.3779, -0.0076, 0.2621, 0.3158, 0.1593, -0.0878, -0.2585, -0.2289, 0.0133, 0.3593, 0.6324, 0.678, 0.4447, 0.0142, -0.4352, -0.7141]
1556
+ }
1557
+ },
1558
+ "normScaleT": {
1559
+ "dtype": "float32",
1560
+ "shape": [16],
1561
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/pinned_norm_nogb_noub_input_normScaleT" } }
1562
+ },
1563
+ "gateBT": {
1564
+ "dtype": "uint8",
1565
+ "shape": [4, 2, 4],
1566
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/pinned_plain_gb_ub_input_gateBT" } }
1567
+ },
1568
+ "gateScalesT": {
1569
+ "dtype": "float32",
1570
+ "shape": [4, 2],
1571
+ "data": { "kind": "values", "values": [0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1] }
1572
+ },
1573
+ "gateBiasT": {
1574
+ "dtype": "float32",
1575
+ "shape": [4],
1576
+ "data": { "kind": "values", "values": [0.1782, 0.1617, -0.0315, -0.1903] }
1577
+ },
1578
+ "upBT": {
1579
+ "dtype": "uint8",
1580
+ "shape": [4, 2, 4],
1581
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/pinned_plain_gb_ub_input_upBT" } }
1582
+ },
1583
+ "upScalesT": {
1584
+ "dtype": "float32",
1585
+ "shape": [4, 2],
1586
+ "data": { "kind": "values", "values": [0.05, 0.046, 0.042, 0.038, 0.034, 0.03, 0.026, 0.022] }
1587
+ },
1588
+ "upBiasT": {
1589
+ "dtype": "float32",
1590
+ "shape": [4],
1591
+ "data": { "kind": "values", "values": [0.0932, -0.0341, -0.1356, -0.1345] }
1592
+ }
1593
+ },
1594
+ "outputs": {
1595
+ "yT": {
1596
+ "dtype": "float32",
1597
+ "shape": [2, 4],
1598
+ "data": {
1599
+ "kind": "values",
1600
+ "values": [-0.052766, -0.1362556, 0.2952684, -1.5736477, 0.0464634, -0.1608242, -0.1441075, -0.5477401]
1601
+ },
1602
+ "tolerance": 0.00001,
1603
+ "relTolerance": 0.0001
1604
+ },
1605
+ "residualT": {
1606
+ "dtype": "float32",
1607
+ "shape": [2, 16],
1608
+ "data": {
1609
+ "kind": "values",
1610
+ "values": [0.9718, 1.3765, 1.3888, 1.0349, 0.4726, -0.087, -0.4751, -0.6336, -0.6225, -0.5657, -0.5691, -0.6529, -0.7371, -0.6869, -0.3961, 0.139, 0.7928, 1.3511, 1.6006, 1.4256, 0.8644, 0.0974, -0.6292, -1.1051, -1.2388, -1.0791, -0.7718, -0.4746, -0.2761, -0.1602, -0.0323, 0.2077]
1611
+ },
1612
+ "tolerance": 0.000001,
1613
+ "relTolerance": 0.000001
1614
+ }
1615
+ }
1616
+ },
1617
+ {
1618
+ "name": "prefill_skip_nogb_noub",
1619
+ "provenance": {
1620
+ "notes": "Five activation rows force the two-pass prefill schedule. Supplying skip and norm_scale while omitting both projection biases exercises staged SkipSimplifiedLayerNormalization without the residual-sum output."
1621
+ },
1622
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
1623
+ "inputs": {
1624
+ "aT": {
1625
+ "dtype": "float32",
1626
+ "shape": [5, 32],
1627
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
1628
+ },
1629
+ "skipT": {
1630
+ "dtype": "float32",
1631
+ "shape": [5, 32],
1632
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.5 }
1633
+ },
1634
+ "normScaleT": {
1635
+ "dtype": "float32",
1636
+ "shape": [32],
1637
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
1638
+ },
1639
+ "gateBT": {
1640
+ "dtype": "uint8",
1641
+ "shape": [8, 2, 8],
1642
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
1643
+ },
1644
+ "gateScalesT": {
1645
+ "dtype": "float32",
1646
+ "shape": [8, 2],
1647
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
1648
+ },
1649
+ "upBT": {
1650
+ "dtype": "uint8",
1651
+ "shape": [8, 2, 8],
1652
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
1653
+ },
1654
+ "upScalesT": {
1655
+ "dtype": "float32",
1656
+ "shape": [8, 2],
1657
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
1658
+ }
1659
+ },
1660
+ "outputs": { "yT": { "dtype": "float32", "shape": [5, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
1661
+ },
1662
+ {
1663
+ "name": "norm_rows_past_one_tile",
1664
+ "provenance": {
1665
+ "notes": "Ten activation rows against a ROW_TILE of eight, so the row axis dispatches two groups and the second holds two real rows and six that clamp onto the last one. It is the only case where the store guard has anything to drop; every other multi-row case fits one group, where the guard cannot fire."
1666
+ },
1667
+ "attrs": { "K": 32, "N": 8, "bits": 4, "block_size": 16, "activation": "silu" },
1668
+ "inputs": {
1669
+ "aT": {
1670
+ "dtype": "float32",
1671
+ "shape": [10, 32],
1672
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.8 }
1673
+ },
1674
+ "normScaleT": {
1675
+ "dtype": "float32",
1676
+ "shape": [32],
1677
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.4, "offset": 1.0 }
1678
+ },
1679
+ "gateBT": {
1680
+ "dtype": "uint8",
1681
+ "shape": [8, 2, 8],
1682
+ "data": { "kind": "cycle", "values": [27, 180, 75, 226, 33, 150, 201, 108, 57, 246, 129, 66, 195] }
1683
+ },
1684
+ "gateScalesT": {
1685
+ "dtype": "float32",
1686
+ "shape": [8, 2],
1687
+ "data": { "kind": "cycle", "values": [0.04, 0.055, 0.05, 0.065, 0.06, 0.075, 0.07] }
1688
+ },
1689
+ "upBT": {
1690
+ "dtype": "uint8",
1691
+ "shape": [8, 2, 8],
1692
+ "data": { "kind": "cycle", "values": [211, 44, 137, 98, 165, 20, 233, 121, 78, 190, 15, 252, 87, 143, 61] }
1693
+ },
1694
+ "upScalesT": {
1695
+ "dtype": "float32",
1696
+ "shape": [8, 2],
1697
+ "data": { "kind": "cycle", "values": [0.045, 0.03, 0.07, 0.05, 0.08, 0.035] }
1698
+ }
1699
+ },
1700
+ "outputs": { "yT": { "dtype": "float32", "shape": [10, 8], "tolerance": 0.0001, "relTolerance": 0.0001 } }
1701
+ }
1702
+ ]
1703
+ }