Xenova HF Staff commited on
Commit
5b47652
·
verified ·
1 Parent(s): 0ef25e5

sync 2e7068faf55e

Browse files
README.md CHANGED
@@ -1,3 +1,87 @@
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.EmbedLayerNormalization
10
+
11
+ `com.microsoft` · ONNX Runtime contrib operator · contrib since_version 1
12
+
13
+ ## Description
14
+
15
+ BERT embedding fusion: looks up word and position tables, optionally adds a segment table, then applies layer normalization. A segment table without IDs uses row 0. `embedding_sum` is the pre-normalization sum. `mask_index` is the first zero or the sequence length; without `mask`, it is zero. Batch and sequence dimensions must be non-empty.
16
+
17
+ See the [ONNX Runtime `EmbedLayerNormalization` contrib-operator spec](https://github.com/microsoft/onnxruntime/blob/main/docs/ContribOperators.md#com.microsoft.EmbedLayerNormalization) for the reference semantics.
18
+
19
+ ## Inputs
20
+
21
+ | Name | Bind key | Logical dtype | WebGPU storage | Rank | Shape | Description | Presence |
22
+ | --- | --- | --- | --- | --- | --- | --- | --- |
23
+ | `input_ids` | `inputIdsT` | `T1` | `int32` | `2` | — | Word ids of shape `(batch_size, sequence_length)`. | required |
24
+ | `segment_ids` | `segmentIdsT` | `T1` | `int32` | `2` | — | Segment ids `(batch_size, sequence_length)`. Requires `segment_embedding`; when omitted with that table present, every token uses row 0. Values must be valid non-negative table-row indices. | optional |
25
+ | `word_embedding` | `wordEmbeddingT` | `T` | same as logical dtype | `2` | — | Non-empty word embedding table `(vocab, hidden_size)`. Every `input_ids` value must be a valid non-negative row index. | required |
26
+ | `position_embedding` | `positionEmbeddingT` | `T` | same as logical dtype | `2` | — | Non-empty position embedding table `(max_positions, hidden_size)`. Without `position_ids`, it must contain at least `sequence_length` rows. | required |
27
+ | `segment_embedding` | `segmentEmbeddingT` | `T` | same as logical dtype | `2` | — | Non-empty segment embedding table `(segments, hidden_size)`. If `segment_ids` is absent, row 0 is used for every token. | optional |
28
+ | `gamma` | `gammaT` | `T` | same as logical dtype | `1` | — | Layer-normalization scale of shape `(hidden_size)`. | required |
29
+ | `beta` | `betaT` | `T` | same as logical dtype | `1` | — | Layer-normalization bias of shape `(hidden_size)`. | required |
30
+ | `mask` | `maskT` | `T1` | `int32` | `2` | — | Attention mask of shape `(batch_size, sequence_length)`. Only used to produce `mask_index`. | optional |
31
+ | `position_ids` | `positionIdsT` | `T1` | `int32` | `2` | — | Position ids `(batch_size, sequence_length)`, or `(1, sequence_length)` to share one row across the batch. Values must be valid non-negative table-row indices; absent uses the position within the sequence. | optional |
32
+
33
+ ## Outputs
34
+
35
+ | Name | Bind key | Logical dtype | WebGPU storage | Rank | Shape | Description | Presence |
36
+ | --- | --- | --- | --- | --- | --- | --- | --- |
37
+ | `output` | `outputT` | `T` | same as logical dtype | `3` | derived; see description | Normalized embeddings of shape `(batch_size, sequence_length, hidden_size)`. | required |
38
+ | `mask_index` | `maskIndexT` | `T1` | `int32` | `1` | `[input_ids[0]]` | Position of the first zero in each mask row, or `sequence_length` when no zero exists; shape `(batch_size)`. It is zero when the optional mask input is absent. | optional |
39
+ | `embedding_sum` | `embeddingSumT` | `T` | same as logical dtype | `3` | derived; see description | The summed embeddings before normalization, including the segment term when present. Float16 uses staged `(word + segment) + position`; float32 uses `(word + position) + segment`. | optional |
40
+
41
+ ## Attributes
42
+
43
+ Attributes and default values (overridable per request):
44
+
45
+ | Attribute | Default | Description |
46
+ | --- | --- | --- |
47
+ | `epsilon` | `9.999999960041972e-13` | Non-negative epsilon added to the layer-normalization variance before taking the square root. |
48
+ | `mask_index_type` | — | Optional shape-inference hint for the `mask_index` output type. The schema's `T1` constraint fixes the runtime tensor type to int32. |
49
+
50
+ ## Type constraints
51
+
52
+ | Variable | Allowed dtypes |
53
+ | --- | --- |
54
+ | `T` | `float32`, `float16` |
55
+ | `T1` | `int32` |
56
+
57
+ ## Files
58
+
59
+ - [`metadata.json`](build/webgpu/metadata.json) — kernel metadata (id, digests, provenance)
60
+ - [`manifest.json`](build/webgpu/manifest.json) — the op contract (source of truth)
61
+ - [`test.json`](build/webgpu/test.json) — correctness cases
62
+ - [`bench.json`](build/webgpu/bench.json) — benchmark + tuning cases
63
+ - [`embed-mask-index.wgsl.jinja`](build/webgpu/embed-mask-index.wgsl.jinja)
64
+ - [`embed-normalize.wgsl.jinja`](build/webgpu/embed-normalize.wgsl.jinja)
65
+ - [`embed-sum.wgsl.jinja`](build/webgpu/embed-sum.wgsl.jinja)
66
+
67
+ ## Use with `@huggingface/kernels`
68
+
69
+ The loader derives every required output's shape and logical dtype from the manifest contract and this call.
70
+ It then allocates the result tensors automatically.
71
+
72
+ The `version: 1` option selects the published kernel contract; it is independent of any operator opset, contrib `since_version`, or model version.
73
+
74
+ Replace each `*Data` placeholder with a typed array containing the corresponding input data.
75
+
76
+ ```js
77
+ import { getKernel } from "@huggingface/kernels";
78
+
79
+ const kernel = await getKernel("webgpu-kernels/com.microsoft.EmbedLayerNormalization", { version: 1 });
80
+ const { outputT } = await kernel({
81
+ inputIdsT: { data: inputIdsTData, shape: [1, 2] },
82
+ wordEmbeddingT: { data: wordEmbeddingTData, shape: [2, 2] },
83
+ positionEmbeddingT: { data: positionEmbeddingTData, shape: [2, 2] },
84
+ gammaT: { data: gammaTData, shape: [2] },
85
+ betaT: { data: betaTData, shape: [2] },
86
+ });
87
+ ```
build/webgpu/bench.json ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "op": "com.microsoft.EmbedLayerNormalization",
3
+ "tunableSpace": { "WORKGROUP_SIZE": [64, 128, 256] },
4
+ "cases": [
5
+ {
6
+ "name": "eln-bert-base-b8-s384-h768",
7
+ "preset": "smoke",
8
+ "vars": { "dtype": "float32" },
9
+ "inputs": {
10
+ "inputIdsT": { "shape": [8, 384], "dtype": "int32", "dist": "randint", "seed": 9301, "min": 0, "max": 30521 },
11
+ "wordEmbeddingT": { "shape": [30522, 768], "dtype": "float32", "dist": "normal", "seed": 9302, "scale": 0.02 },
12
+ "positionEmbeddingT": { "shape": [512, 768], "dtype": "float32", "dist": "normal", "seed": 9303, "scale": 0.02 },
13
+ "gammaT": { "shape": [768], "dtype": "float32", "dist": "normal", "seed": 9304, "scale": 1 },
14
+ "betaT": { "shape": [768], "dtype": "float32", "dist": "normal", "seed": 9305, "scale": 0.1 }
15
+ },
16
+ "outputs": { "outputT": { "shape": [8, 384, 768], "dtype": "float32" } },
17
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "8 * 384 * 768 * 3 * 4" }] }
18
+ },
19
+ {
20
+ "name": "eln-bert-base-b1-s512-h768",
21
+ "preset": "model",
22
+ "provenance": {
23
+ "notes": "BERT class defaults (vocab_size 30522, hidden_size 768, max_position_embeddings 512, type_vocab_size 2) at a single full-length sequence."
24
+ },
25
+ "vars": { "batch": 1, "seq": 512, "hidden": 768, "vocab": 30522 },
26
+ "attrs": { "epsilon": 1e-12 },
27
+ "inputs": {
28
+ "inputIdsT": { "shape": [1, 512], "dtype": "int32", "dist": "randint", "seed": 5100, "min": 0, "max": 30521 },
29
+ "segmentIdsT": { "shape": [1, 512], "dtype": "int32", "dist": "randint", "seed": 5101, "min": 0, "max": 1 },
30
+ "wordEmbeddingT": { "shape": [30522, 768], "dtype": "float32", "dist": "normal", "seed": 5102, "scale": 0.1 },
31
+ "positionEmbeddingT": { "shape": [512, 768], "dtype": "float32", "dist": "normal", "seed": 5103, "scale": 0.1 },
32
+ "segmentEmbeddingT": { "shape": [2, 768], "dtype": "float32", "dist": "normal", "seed": 5104, "scale": 0.1 },
33
+ "gammaT": { "shape": [768], "dtype": "float32", "dist": "uniform", "seed": 5105, "scale": 0.1, "offset": 1 },
34
+ "betaT": { "shape": [768], "dtype": "float32", "dist": "normal", "seed": 5106, "scale": 0.05 },
35
+ "maskT": { "shape": [1, 512], "dtype": "int32", "dist": "randint", "seed": 5107, "min": 0, "max": 1 }
36
+ },
37
+ "outputs": {
38
+ "outputT": { "shape": [1, 512, 768], "dtype": "float32" },
39
+ "maskIndexT": { "shape": [1], "dtype": "int32" }
40
+ },
41
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "args.batch * args.seq * args.hidden * 3 * 4" }] }
42
+ },
43
+ {
44
+ "name": "eln-bert-base-b32-s128-h768",
45
+ "preset": "model",
46
+ "provenance": {
47
+ "notes": "BERT class defaults at a 32-sequence serving batch of 128 tokens, the shape short-text classification actually runs."
48
+ },
49
+ "vars": { "batch": 32, "seq": 128, "hidden": 768, "vocab": 30522 },
50
+ "attrs": { "epsilon": 1e-12 },
51
+ "inputs": {
52
+ "inputIdsT": { "shape": [32, 128], "dtype": "int32", "dist": "randint", "seed": 5200, "min": 0, "max": 30521 },
53
+ "segmentIdsT": { "shape": [32, 128], "dtype": "int32", "dist": "randint", "seed": 5201, "min": 0, "max": 1 },
54
+ "wordEmbeddingT": { "shape": [30522, 768], "dtype": "float32", "dist": "normal", "seed": 5202, "scale": 0.1 },
55
+ "positionEmbeddingT": { "shape": [512, 768], "dtype": "float32", "dist": "normal", "seed": 5203, "scale": 0.1 },
56
+ "segmentEmbeddingT": { "shape": [2, 768], "dtype": "float32", "dist": "normal", "seed": 5204, "scale": 0.1 },
57
+ "gammaT": { "shape": [768], "dtype": "float32", "dist": "uniform", "seed": 5205, "scale": 0.1, "offset": 1 },
58
+ "betaT": { "shape": [768], "dtype": "float32", "dist": "normal", "seed": 5206, "scale": 0.05 },
59
+ "maskT": { "shape": [32, 128], "dtype": "int32", "dist": "randint", "seed": 5207, "min": 0, "max": 1 }
60
+ },
61
+ "outputs": {
62
+ "outputT": { "shape": [32, 128, 768], "dtype": "float32" },
63
+ "maskIndexT": { "shape": [32], "dtype": "int32" }
64
+ },
65
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "args.batch * args.seq * args.hidden * 3 * 4" }] }
66
+ },
67
+ {
68
+ "name": "eln-distilbert-b8-s512-h768",
69
+ "preset": "model",
70
+ "provenance": {
71
+ "notes": "DistilBERT class defaults (vocab_size 30522, dim 768, max_position_embeddings 512); DistilBERT has no token-type embedding, so the segment inputs are absent."
72
+ },
73
+ "vars": { "batch": 8, "seq": 512, "hidden": 768, "vocab": 30522 },
74
+ "attrs": { "epsilon": 1e-12 },
75
+ "inputs": {
76
+ "inputIdsT": { "shape": [8, 512], "dtype": "int32", "dist": "randint", "seed": 5300, "min": 0, "max": 30521 },
77
+ "wordEmbeddingT": { "shape": [30522, 768], "dtype": "float32", "dist": "normal", "seed": 5302, "scale": 0.1 },
78
+ "positionEmbeddingT": { "shape": [512, 768], "dtype": "float32", "dist": "normal", "seed": 5303, "scale": 0.1 },
79
+ "gammaT": { "shape": [768], "dtype": "float32", "dist": "uniform", "seed": 5305, "scale": 0.1, "offset": 1 },
80
+ "betaT": { "shape": [768], "dtype": "float32", "dist": "normal", "seed": 5306, "scale": 0.05 },
81
+ "maskT": { "shape": [8, 512], "dtype": "int32", "dist": "randint", "seed": 5307, "min": 0, "max": 1 }
82
+ },
83
+ "outputs": {
84
+ "outputT": { "shape": [8, 512, 768], "dtype": "float32" },
85
+ "maskIndexT": { "shape": [8], "dtype": "int32" }
86
+ },
87
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "args.batch * args.seq * args.hidden * 3 * 4" }] }
88
+ },
89
+ {
90
+ "name": "eln-deberta-v2-b8-s512-h1536",
91
+ "preset": "model",
92
+ "provenance": {
93
+ "notes": "DeBERTa-v2 class defaults (vocab_size 128100, hidden_size 1536, max_position_embeddings 512, type_vocab_size 0) -- the widest embedding table in this set."
94
+ },
95
+ "vars": { "batch": 8, "seq": 512, "hidden": 1536, "vocab": 128100 },
96
+ "attrs": { "epsilon": 1e-12 },
97
+ "inputs": {
98
+ "inputIdsT": { "shape": [8, 512], "dtype": "int32", "dist": "randint", "seed": 5400, "min": 0, "max": 128099 },
99
+ "wordEmbeddingT": { "shape": [128100, 1536], "dtype": "float32", "dist": "normal", "seed": 5402, "scale": 0.1 },
100
+ "positionEmbeddingT": { "shape": [512, 1536], "dtype": "float32", "dist": "normal", "seed": 5403, "scale": 0.1 },
101
+ "gammaT": { "shape": [1536], "dtype": "float32", "dist": "uniform", "seed": 5405, "scale": 0.1, "offset": 1 },
102
+ "betaT": { "shape": [1536], "dtype": "float32", "dist": "normal", "seed": 5406, "scale": 0.05 }
103
+ },
104
+ "outputs": { "outputT": { "shape": [8, 512, 1536], "dtype": "float32" } },
105
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "args.batch * args.seq * args.hidden * 3 * 4" }] }
106
+ }
107
+ ]
108
+ }
build/webgpu/embed-mask-index.wgsl.jinja ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {{ env.wgsl.resourceDeclarations }}
2
+
3
+ // com.microsoft.EmbedLayerNormalization, mask_index pass. With a mask, return
4
+ // the first zero position or the sequence length when every position is set.
5
+ // Without a mask, initialize the optional output to zero.
6
+ {% if hasMask %}
7
+ const SEQUENCE: u32 = {{ sequenceLength }}u;
8
+ {% endif %}
9
+
10
+ @compute @workgroup_size({{ maskWorkgroupSize }}, 1, 1)
11
+ fn main(@builtin(global_invocation_id) gid: vec3<u32>) {
12
+ let batch = gid.x;
13
+ if (batch >= params.batch) {
14
+ return;
15
+ }
16
+ var first_zero: i32 = 0;
17
+ {% if hasMask %}
18
+ first_zero = i32(SEQUENCE);
19
+ let base = batch * SEQUENCE;
20
+ for (var s: u32 = 0u; s < SEQUENCE; s = s + 1u) {
21
+ if (mask[base + s] == 0) {
22
+ first_zero = i32(s);
23
+ break;
24
+ }
25
+ }
26
+ {% endif %}
27
+ mask_index[batch] = first_zero;
28
+ }
build/webgpu/embed-normalize.wgsl.jinja ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% if usesF16 %}
2
+ enable f16;
3
+ {% endif %}
4
+ {{ env.wgsl.resourceDeclarations }}
5
+
6
+ // com.microsoft.EmbedLayerNormalization, normalization pass.
7
+ // output = (sum - mean) / sqrt(variance + epsilon) * gamma + beta
8
+ // One workgroup owns one (batch, position) row of the summed embedding the
9
+ // previous pass left in `output`, and normalizes it in place. The statistics
10
+ // accumulate in f32 over the stored tensor-type values.
11
+ const HIDDEN: u32 = {{ hidden }}u;
12
+ const EPSILON: f32 = {{ epsilon }};
13
+ const WG: u32 = {{ workgroupSize }}u;
14
+
15
+ var<workgroup> partial: array<f32, WG>;
16
+
17
+ {% macro wgsl_tree_fold_stmt(a, op, idx, svar) %}
18
+ {% if op == "max" %}
19
+ {{ a }}[{{ idx }}] = max({{ a }}[{{ idx }}], {{ a }}[{{ idx }} + {{ svar }}]);
20
+ {%- else %}
21
+ {{ a }}[{{ idx }}] = {{ a }}[{{ idx }}] + {{ a }}[{{ idx }} + {{ svar }}];
22
+ {%- endif %}
23
+ {% endmacro %}
24
+ {% macro wgsl_tree_fold(arrays, op="add", idx="lid", wg="WORKGROUP_SIZE", svar="stride", typed=false, form="tail", breakInline=false, bodyInline=false, barrierFirst=false) %}
25
+ var {{ svar }}{{ ": u32 " if typed else " " }}= {{ wg }} / 2u;
26
+ loop {
27
+ {% if form == "head" %}
28
+ {% if breakInline %}
29
+ if ({{ svar }} == 0u) { break; }
30
+ {% else %}
31
+ if ({{ svar }} == 0u) {
32
+ break;
33
+ }
34
+ {% endif %}
35
+ {% endif %}
36
+ {% if bodyInline %}
37
+ if ({{ idx }} < {{ svar }}) { {{ wgsl_tree_fold_stmt(arrays[0], op, idx, svar) }} }
38
+ {% else %}
39
+ if ({{ idx }} < {{ svar }}) {
40
+ {% for a in arrays %}
41
+ {{ wgsl_tree_fold_stmt(a, op, idx, svar) }}
42
+ {% endfor %}
43
+ }
44
+ {% endif %}
45
+ {% if form == "head" %}
46
+ {% if barrierFirst %}
47
+ workgroupBarrier();
48
+ {{ svar }} = {{ svar }} / 2u;
49
+ {% else %}
50
+ {{ svar }} = {{ svar }} / 2u;
51
+ workgroupBarrier();
52
+ {% endif %}
53
+ {% else %}
54
+ workgroupBarrier();
55
+ if ({{ svar }} == 1u) {
56
+ break;
57
+ }
58
+ {{ svar }} = {{ svar }} / 2u;
59
+ {% endif %}
60
+ }
61
+ {%- endmacro %}
62
+
63
+ // Reusing partial after this reduction requires a barrier between the read of
64
+ // partial[0] and the next write, or the next round can race the prior readers.
65
+ {% set trailingBarrier = trailingBarrier is defined and trailingBarrier %}
66
+ fn reduce_sum(value: f32, tid: u32) -> f32 {
67
+ partial[tid] = value;
68
+ workgroupBarrier();
69
+ {{ wgsl_tree_fold(["partial"], idx="tid", wg="WG", form="head") }}
70
+ {% if trailingBarrier %}
71
+ let total = partial[0];
72
+ workgroupBarrier();
73
+ return total;
74
+ {% else %}
75
+ return partial[0];
76
+ {% endif %}
77
+ }
78
+
79
+
80
+ @compute @workgroup_size(WG, 1, 1)
81
+ fn main(@builtin(workgroup_id) wg: vec3<u32>,
82
+ @builtin(num_workgroups) nwg: vec3<u32>,
83
+ @builtin(local_invocation_id) lid: vec3<u32>) {
84
+ // 2D-folded row index: wg.y carries the high bits past the
85
+ // maxComputeWorkgroupsPerDimension dispatch limit.
86
+ let token = wg.x + wg.y * nwg.x;
87
+ if (token >= params.tokens) {
88
+ return;
89
+ }
90
+ let tid = lid.x;
91
+ let base = token * HIDDEN;
92
+
93
+ var local_sum = 0.0;
94
+ for (var i = tid; i < HIDDEN; i = i + WG) {
95
+ local_sum = local_sum + f32(output[base + i]);
96
+ }
97
+ let mean = reduce_sum(local_sum, tid) / f32(HIDDEN);
98
+ // Separates the mean reduction's read of partial[0] from the variance
99
+ // reduction's writes to the same workgroup array.
100
+ workgroupBarrier();
101
+
102
+ var local_sq = 0.0;
103
+ for (var i = tid; i < HIDDEN; i = i + WG) {
104
+ let centred = f32(output[base + i]) - mean;
105
+ local_sq = local_sq + centred * centred;
106
+ }
107
+ let deviation = sqrt(reduce_sum(local_sq, tid) / f32(HIDDEN) + EPSILON);
108
+ workgroupBarrier();
109
+
110
+ for (var i = tid; i < HIDDEN; i = i + WG) {
111
+ let centred = f32(output[base + i]) - mean;
112
+ output[base + i] = {{ scalar }}(centred / deviation * f32(gamma[i]) + f32(beta[i]));
113
+ }
114
+ }
build/webgpu/embed-sum.wgsl.jinja ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% if usesF16 %}
2
+ enable f16;
3
+ {% endif %}
4
+ {{ env.wgsl.resourceDeclarations }}
5
+
6
+ // com.microsoft.EmbedLayerNormalization, embedding-sum pass.
7
+ // sum = word_embedding[input_ids[t]] + position_embedding[p(t)]
8
+ // (+ segment_embedding[segment_ids[t] or 0])
9
+ // One workgroup writes one token's row of the summed embedding into `output`,
10
+ // where the normalization pass reads it back. The row bases -- which word,
11
+ // position and segment rows this token gathers -- are the same for every element
12
+ // of the row, so they are resolved once per workgroup.
13
+ // The sum is materialized in the tensor type -- it is also the optional
14
+ // `embedding_sum` output -- so the statistics the next pass computes describe
15
+ // the values this op emits rather than an unobservable wider intermediate.
16
+ const HIDDEN: u32 = {{ hidden }}u;
17
+ {% if not hasPositionIds or broadcastPositionIds %}
18
+ // Read only where the position row comes from the position within the sequence:
19
+ // a per-token position_ids indexes directly instead.
20
+ const SEQUENCE: u32 = {{ sequenceLength }}u;
21
+ {% endif %}
22
+ const WG: u32 = {{ workgroupSize }}u;
23
+ // Defensive row clamps keep an invalid id from reading outside an embedding
24
+ // table. Request validation rejects such ids before a valid dispatch.
25
+ const WORD_ROWS: u32 = {{ wordRows }}u;
26
+ const POSITION_ROWS: u32 = {{ positionRows }}u;
27
+ {% if hasSegment and hasSegmentIds %}
28
+ const SEGMENT_ROWS: u32 = {{ segmentRows }}u;
29
+ {% endif %}
30
+
31
+ @compute @workgroup_size(WG, 1, 1)
32
+ fn main(@builtin(workgroup_id) wg: vec3<u32>,
33
+ @builtin(num_workgroups) nwg: vec3<u32>,
34
+ @builtin(local_invocation_id) lid: vec3<u32>) {
35
+ // 2D-folded row index: wg.y carries the high bits past the
36
+ // maxComputeWorkgroupsPerDimension dispatch limit.
37
+ let token = wg.x + wg.y * nwg.x;
38
+ if (token >= params.tokens) {
39
+ return;
40
+ }
41
+ let tid = lid.x;
42
+ let base = token * HIDDEN;
43
+
44
+ let word_row = min(u32(max(input_ids[token], 0)), WORD_ROWS - 1u) * HIDDEN;
45
+ {% if hasPositionIds %}
46
+ {% if broadcastPositionIds %}
47
+ // A position_ids of shape (1, sequence_length) is shared by every batch, so
48
+ // the row index drops back to the position within the sequence.
49
+ let position_id = position_ids[token % SEQUENCE];
50
+ {% else %}
51
+ let position_id = position_ids[token];
52
+ {% endif %}
53
+ let position_row = min(u32(max(position_id, 0)), POSITION_ROWS - 1u) * HIDDEN;
54
+ {% else %}
55
+ let position_row = min(token % SEQUENCE, POSITION_ROWS - 1u) * HIDDEN;
56
+ {% endif %}
57
+ {% if hasSegment %}
58
+ {% if hasSegmentIds %}
59
+ let segment_row = min(u32(max(segment_ids[token], 0)), SEGMENT_ROWS - 1u) * HIDDEN;
60
+ {% else %}
61
+ let segment_row = 0u;
62
+ {% endif %}
63
+ {% endif %}
64
+
65
+ for (var i = tid; i < HIDDEN; i = i + WG) {
66
+ // Materialize each addition in T; association is observable for f16.
67
+ {% if hasSegment and scalar == "f16" %}
68
+ var stored = {{ scalar }}(f32(word_embedding[word_row + i]) + f32(segment_embedding[segment_row + i]));
69
+ stored = {{ scalar }}(f32(stored) + f32(position_embedding[position_row + i]));
70
+ {% else %}
71
+ var stored = {{ scalar }}(f32(word_embedding[word_row + i]) + f32(position_embedding[position_row + i]));
72
+ {% if hasSegment %}
73
+ stored = {{ scalar }}(f32(stored) + f32(segment_embedding[segment_row + i]));
74
+ {% endif %}
75
+ {% endif %}
76
+ {% if writeEmbeddingSum %}
77
+ embedding_sum[base + i] = stored;
78
+ {% endif %}
79
+ output[base + i] = stored;
80
+ }
81
+ }
build/webgpu/manifest.json ADDED
@@ -0,0 +1,1708 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "domain": "com.microsoft",
3
+ "name": "EmbedLayerNormalization",
4
+ "sinceVersion": 1,
5
+ "description": "BERT embedding fusion: looks up word and position tables, optionally adds a segment table, then applies layer normalization. A segment table without IDs uses row 0. `embedding_sum` is the pre-normalization sum. `mask_index` is the first zero or the sequence length; without `mask`, it is zero. Batch and sequence dimensions must be non-empty.",
6
+ "inputs": [
7
+ {
8
+ "role": "input_ids",
9
+ "dtype": "T1",
10
+ "rank": 2,
11
+ "description": "Word ids of shape `(batch_size, sequence_length)`."
12
+ },
13
+ {
14
+ "role": "segment_ids",
15
+ "dtype": "T1",
16
+ "rank": 2,
17
+ "optional": true,
18
+ "description": "Segment ids `(batch_size, sequence_length)`. Requires `segment_embedding`; when omitted with that table present, every token uses row 0. Values must be valid non-negative table-row indices."
19
+ },
20
+ {
21
+ "role": "word_embedding",
22
+ "dtype": "T",
23
+ "rank": 2,
24
+ "description": "Non-empty word embedding table `(vocab, hidden_size)`. Every `input_ids` value must be a valid non-negative row index."
25
+ },
26
+ {
27
+ "role": "position_embedding",
28
+ "dtype": "T",
29
+ "rank": 2,
30
+ "description": "Non-empty position embedding table `(max_positions, hidden_size)`. Without `position_ids`, it must contain at least `sequence_length` rows."
31
+ },
32
+ {
33
+ "role": "segment_embedding",
34
+ "dtype": "T",
35
+ "rank": 2,
36
+ "optional": true,
37
+ "description": "Non-empty segment embedding table `(segments, hidden_size)`. If `segment_ids` is absent, row 0 is used for every token."
38
+ },
39
+ { "role": "gamma", "dtype": "T", "rank": 1, "description": "Layer-normalization scale of shape `(hidden_size)`." },
40
+ { "role": "beta", "dtype": "T", "rank": 1, "description": "Layer-normalization bias of shape `(hidden_size)`." },
41
+ {
42
+ "role": "mask",
43
+ "dtype": "T1",
44
+ "rank": 2,
45
+ "optional": true,
46
+ "description": "Attention mask of shape `(batch_size, sequence_length)`. Only used to produce `mask_index`."
47
+ },
48
+ {
49
+ "role": "position_ids",
50
+ "dtype": "T1",
51
+ "rank": 2,
52
+ "optional": true,
53
+ "description": "Position ids `(batch_size, sequence_length)`, or `(1, sequence_length)` to share one row across the batch. Values must be valid non-negative table-row indices; absent uses the position within the sequence."
54
+ }
55
+ ],
56
+ "outputs": [
57
+ {
58
+ "role": "output",
59
+ "dtype": "T",
60
+ "rank": 3,
61
+ "shape": "[dim(shapes.inputIdsT, 0), dim(shapes.inputIdsT, 1), hidden]",
62
+ "description": "Normalized embeddings of shape `(batch_size, sequence_length, hidden_size)`."
63
+ },
64
+ {
65
+ "role": "mask_index",
66
+ "dtype": "T1",
67
+ "rank": 1,
68
+ "optional": true,
69
+ "shape": "[dim(shapes.inputIdsT, 0)]",
70
+ "description": "Position of the first zero in each mask row, or `sequence_length` when no zero exists; shape `(batch_size)`. It is zero when the optional mask input is absent."
71
+ },
72
+ {
73
+ "role": "embedding_sum",
74
+ "dtype": "T",
75
+ "rank": 3,
76
+ "optional": true,
77
+ "shape": "[dim(shapes.inputIdsT, 0), dim(shapes.inputIdsT, 1), hidden]",
78
+ "description": "The summed embeddings before normalization, including the segment term when present. Float16 uses staged `(word + segment) + position`; float32 uses `(word + position) + segment`."
79
+ }
80
+ ],
81
+ "attributes": { "epsilon": 9.999999960041972e-13 },
82
+ "attributeDescriptions": {
83
+ "epsilon": "Non-negative epsilon added to the layer-normalization variance before taking the square root.",
84
+ "mask_index_type": "Optional shape-inference hint for the `mask_index` output type. The schema's `T1` constraint fixes the runtime tensor type to int32."
85
+ },
86
+ "attributeConstraints": { "mask_index_type": { "values": [0, 1] } },
87
+ "typeConstraints": { "T": ["float32", "float16"], "T1": ["int32"] },
88
+ "args": {
89
+ "inputIdsT": { "kind": "tensor", "semantic": "input_ids", "role": "input", "dtype": "int32" },
90
+ "segmentIdsT": { "kind": "tensor", "semantic": "segment_ids", "role": "input", "dtype": "int32", "required": false },
91
+ "wordEmbeddingT": { "kind": "tensor", "semantic": "word_embedding", "role": "weights" },
92
+ "positionEmbeddingT": { "kind": "tensor", "semantic": "position_embedding", "role": "weights" },
93
+ "segmentEmbeddingT": { "kind": "tensor", "semantic": "segment_embedding", "role": "weights", "required": false },
94
+ "gammaT": { "kind": "tensor", "semantic": "gamma", "role": "weights" },
95
+ "betaT": { "kind": "tensor", "semantic": "beta", "role": "weights" },
96
+ "maskT": { "kind": "tensor", "semantic": "mask", "role": "input", "dtype": "int32", "required": false },
97
+ "positionIdsT": {
98
+ "kind": "tensor",
99
+ "semantic": "position_ids",
100
+ "role": "input",
101
+ "dtype": "int32",
102
+ "required": false
103
+ },
104
+ "outputT": { "kind": "tensor", "semantic": "output", "role": "output" },
105
+ "maskIndexT": { "kind": "tensor", "semantic": "mask_index", "role": "output", "dtype": "int32", "required": false },
106
+ "embeddingSumT": { "kind": "tensor", "semantic": "embedding_sum", "role": "output", "required": false }
107
+ },
108
+ "tunables": { "WORKGROUP_SIZE": 128, "MASK_WORKGROUP_SIZE": 64 },
109
+ "derive": {
110
+ "batchSize": "dim(shapes.inputIdsT, 0)",
111
+ "sequenceLength": "dim(shapes.inputIdsT, 1)",
112
+ "tokens": "batchSize * sequenceLength",
113
+ "hidden": "dim(shapes.wordEmbeddingT, 1)",
114
+ "epsilonValue": "attrs.epsilon",
115
+ "epsilonOk": "epsilonValue >= 0",
116
+ "tableShapeOk": "ranks.wordEmbeddingT == 2 and dim(shapes.wordEmbeddingT, 0) > 0 and ranks.positionEmbeddingT == 2 and dim(shapes.positionEmbeddingT, 0) > 0 and dim(shapes.positionEmbeddingT, 1) == hidden and ranks.gammaT == 1 and ranks.betaT == 1 and dim(shapes.gammaT, 0) == hidden and dim(shapes.betaT, 0) == hidden and hidden > 0",
117
+ "segmentContract": "(not present.segmentIdsT or present.segmentEmbeddingT) and (ranks.segmentIdsT == 2 and sameShape(shapes.segmentIdsT, shapes.inputIdsT) if present.segmentIdsT else true) and (ranks.segmentEmbeddingT == 2 and dim(shapes.segmentEmbeddingT, 0) > 0 and dim(shapes.segmentEmbeddingT, 1) == hidden if present.segmentEmbeddingT else true)",
118
+ "positionIdsContract": "(ranks.positionIdsT == 2 and dim(shapes.positionIdsT, 1) == sequenceLength and (dim(shapes.positionIdsT, 0) == batchSize or dim(shapes.positionIdsT, 0) == 1) if present.positionIdsT else dim(shapes.positionEmbeddingT, 0) >= sequenceLength)",
119
+ "broadcastPositionIds": "dim(shapes.positionIdsT, 0) == 1 if present.positionIdsT else false",
120
+ "maskContract": "ranks.maskT == 2 and sameShape(shapes.maskT, shapes.inputIdsT) if present.maskT else true",
121
+ "maskIndexTypeOk": "not has(attrs, \"mask_index_type\") or attrs.mask_index_type == 0 or attrs.mask_index_type == 1",
122
+ "ioShapeOk": "ranks.inputIdsT == 2 and ranks.outputT == 3 and dim(shapes.outputT, 0) == batchSize and dim(shapes.outputT, 1) == sequenceLength and dim(shapes.outputT, 2) == hidden and tensorDtypes.outputT == tensorDtypes.wordEmbeddingT and tensorDtypes.positionEmbeddingT == tensorDtypes.wordEmbeddingT and tensorDtypes.gammaT == tensorDtypes.wordEmbeddingT and tensorDtypes.betaT == tensorDtypes.wordEmbeddingT and f16Ok(tensorDtypes.wordEmbeddingT)",
123
+ "embeddingSumContract": "ranks.embeddingSumT == 3 and sameShape(shapes.embeddingSumT, shapes.outputT) and tensorDtypes.embeddingSumT == tensorDtypes.wordEmbeddingT if present.embeddingSumT else true",
124
+ "maskIndexShapeOk": "ranks.maskIndexT == 1 and dim(shapes.maskIndexT, 0) == batchSize if present.maskIndexT else true",
125
+ "embedContractOk": "epsilonOk and tableShapeOk and segmentContract and positionIdsContract and maskContract and maskIndexTypeOk and ioShapeOk and embeddingSumContract and maskIndexShapeOk and batchSize > 0 and sequenceLength > 0",
126
+ "dispatchFits": "tunables.WORKGROUP_SIZE <= device.limits.maxComputeInvocationsPerWorkgroup and tunables.MASK_WORKGROUP_SIZE <= device.limits.maxComputeInvocationsPerWorkgroup"
127
+ },
128
+ "constants": {
129
+ "aScalar": "dtypes.T",
130
+ "scalar": "dtypes.T",
131
+ "usesF16": "dtypes.T == \"f16\"",
132
+ "hidden": "hidden",
133
+ "sequenceLength": "sequenceLength",
134
+ "epsilon": "epsilonValue",
135
+ "workgroupSize": "tunables.WORKGROUP_SIZE",
136
+ "maskWorkgroupSize": "tunables.MASK_WORKGROUP_SIZE",
137
+ "wordRows": "dim(shapes.wordEmbeddingT, 0)",
138
+ "positionRows": "dim(shapes.positionEmbeddingT, 0)",
139
+ "segmentRows": "dim(shapes.segmentEmbeddingT, 0) if present.segmentEmbeddingT else 1",
140
+ "hasSegment": "present.segmentEmbeddingT",
141
+ "hasSegmentIds": "present.segmentIdsT",
142
+ "hasPositionIds": "present.positionIdsT",
143
+ "broadcastPositionIds": "broadcastPositionIds",
144
+ "writeEmbeddingSum": "present.embeddingSumT",
145
+ "hasMask": "present.maskT",
146
+ "HIDDEN_LEN": "hidden"
147
+ },
148
+ "bindingSets": {
149
+ "embed_noseg_nopos_nosum": [
150
+ {
151
+ "name": "input_ids",
152
+ "arg": "inputIdsT",
153
+ "semantic": "input_ids",
154
+ "buffer": { "type": "read-only-storage" },
155
+ "elementType": "i32"
156
+ },
157
+ {
158
+ "name": "word_embedding",
159
+ "arg": "wordEmbeddingT",
160
+ "semantic": "word_embedding",
161
+ "buffer": { "type": "read-only-storage" },
162
+ "elementType": "$aScalar"
163
+ },
164
+ {
165
+ "name": "position_embedding",
166
+ "arg": "positionEmbeddingT",
167
+ "semantic": "position_embedding",
168
+ "buffer": { "type": "read-only-storage" },
169
+ "elementType": "$aScalar"
170
+ },
171
+ {
172
+ "name": "output",
173
+ "arg": "outputT",
174
+ "semantic": "output",
175
+ "buffer": { "type": "storage" },
176
+ "elementType": "$aScalar"
177
+ },
178
+ {
179
+ "name": "params",
180
+ "semantic": "kernel.params",
181
+ "buffer": { "type": "uniform" },
182
+ "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] }
183
+ }
184
+ ],
185
+ "embed_noseg_nopos_sum": [
186
+ {
187
+ "name": "input_ids",
188
+ "arg": "inputIdsT",
189
+ "semantic": "input_ids",
190
+ "buffer": { "type": "read-only-storage" },
191
+ "elementType": "i32"
192
+ },
193
+ {
194
+ "name": "word_embedding",
195
+ "arg": "wordEmbeddingT",
196
+ "semantic": "word_embedding",
197
+ "buffer": { "type": "read-only-storage" },
198
+ "elementType": "$aScalar"
199
+ },
200
+ {
201
+ "name": "position_embedding",
202
+ "arg": "positionEmbeddingT",
203
+ "semantic": "position_embedding",
204
+ "buffer": { "type": "read-only-storage" },
205
+ "elementType": "$aScalar"
206
+ },
207
+ {
208
+ "name": "output",
209
+ "arg": "outputT",
210
+ "semantic": "output",
211
+ "buffer": { "type": "storage" },
212
+ "elementType": "$aScalar"
213
+ },
214
+ {
215
+ "name": "embedding_sum",
216
+ "arg": "embeddingSumT",
217
+ "semantic": "embedding_sum",
218
+ "buffer": { "type": "storage" },
219
+ "elementType": "$aScalar"
220
+ },
221
+ {
222
+ "name": "params",
223
+ "semantic": "kernel.params",
224
+ "buffer": { "type": "uniform" },
225
+ "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] }
226
+ }
227
+ ],
228
+ "embed_noseg_posids_nosum": [
229
+ {
230
+ "name": "input_ids",
231
+ "arg": "inputIdsT",
232
+ "semantic": "input_ids",
233
+ "buffer": { "type": "read-only-storage" },
234
+ "elementType": "i32"
235
+ },
236
+ {
237
+ "name": "position_ids",
238
+ "arg": "positionIdsT",
239
+ "semantic": "position_ids",
240
+ "buffer": { "type": "read-only-storage" },
241
+ "elementType": "i32"
242
+ },
243
+ {
244
+ "name": "word_embedding",
245
+ "arg": "wordEmbeddingT",
246
+ "semantic": "word_embedding",
247
+ "buffer": { "type": "read-only-storage" },
248
+ "elementType": "$aScalar"
249
+ },
250
+ {
251
+ "name": "position_embedding",
252
+ "arg": "positionEmbeddingT",
253
+ "semantic": "position_embedding",
254
+ "buffer": { "type": "read-only-storage" },
255
+ "elementType": "$aScalar"
256
+ },
257
+ {
258
+ "name": "output",
259
+ "arg": "outputT",
260
+ "semantic": "output",
261
+ "buffer": { "type": "storage" },
262
+ "elementType": "$aScalar"
263
+ },
264
+ {
265
+ "name": "params",
266
+ "semantic": "kernel.params",
267
+ "buffer": { "type": "uniform" },
268
+ "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] }
269
+ }
270
+ ],
271
+ "embed_noseg_posids_sum": [
272
+ {
273
+ "name": "input_ids",
274
+ "arg": "inputIdsT",
275
+ "semantic": "input_ids",
276
+ "buffer": { "type": "read-only-storage" },
277
+ "elementType": "i32"
278
+ },
279
+ {
280
+ "name": "position_ids",
281
+ "arg": "positionIdsT",
282
+ "semantic": "position_ids",
283
+ "buffer": { "type": "read-only-storage" },
284
+ "elementType": "i32"
285
+ },
286
+ {
287
+ "name": "word_embedding",
288
+ "arg": "wordEmbeddingT",
289
+ "semantic": "word_embedding",
290
+ "buffer": { "type": "read-only-storage" },
291
+ "elementType": "$aScalar"
292
+ },
293
+ {
294
+ "name": "position_embedding",
295
+ "arg": "positionEmbeddingT",
296
+ "semantic": "position_embedding",
297
+ "buffer": { "type": "read-only-storage" },
298
+ "elementType": "$aScalar"
299
+ },
300
+ {
301
+ "name": "output",
302
+ "arg": "outputT",
303
+ "semantic": "output",
304
+ "buffer": { "type": "storage" },
305
+ "elementType": "$aScalar"
306
+ },
307
+ {
308
+ "name": "embedding_sum",
309
+ "arg": "embeddingSumT",
310
+ "semantic": "embedding_sum",
311
+ "buffer": { "type": "storage" },
312
+ "elementType": "$aScalar"
313
+ },
314
+ {
315
+ "name": "params",
316
+ "semantic": "kernel.params",
317
+ "buffer": { "type": "uniform" },
318
+ "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] }
319
+ }
320
+ ],
321
+ "embed_segdefault_nopos_nosum": [
322
+ {
323
+ "name": "input_ids",
324
+ "arg": "inputIdsT",
325
+ "semantic": "input_ids",
326
+ "buffer": { "type": "read-only-storage" },
327
+ "elementType": "i32"
328
+ },
329
+ {
330
+ "name": "word_embedding",
331
+ "arg": "wordEmbeddingT",
332
+ "semantic": "word_embedding",
333
+ "buffer": { "type": "read-only-storage" },
334
+ "elementType": "$aScalar"
335
+ },
336
+ {
337
+ "name": "position_embedding",
338
+ "arg": "positionEmbeddingT",
339
+ "semantic": "position_embedding",
340
+ "buffer": { "type": "read-only-storage" },
341
+ "elementType": "$aScalar"
342
+ },
343
+ {
344
+ "name": "segment_embedding",
345
+ "arg": "segmentEmbeddingT",
346
+ "semantic": "segment_embedding",
347
+ "buffer": { "type": "read-only-storage" },
348
+ "elementType": "$aScalar"
349
+ },
350
+ {
351
+ "name": "output",
352
+ "arg": "outputT",
353
+ "semantic": "output",
354
+ "buffer": { "type": "storage" },
355
+ "elementType": "$aScalar"
356
+ },
357
+ {
358
+ "name": "params",
359
+ "semantic": "kernel.params",
360
+ "buffer": { "type": "uniform" },
361
+ "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] }
362
+ }
363
+ ],
364
+ "embed_segdefault_nopos_sum": [
365
+ {
366
+ "name": "input_ids",
367
+ "arg": "inputIdsT",
368
+ "semantic": "input_ids",
369
+ "buffer": { "type": "read-only-storage" },
370
+ "elementType": "i32"
371
+ },
372
+ {
373
+ "name": "word_embedding",
374
+ "arg": "wordEmbeddingT",
375
+ "semantic": "word_embedding",
376
+ "buffer": { "type": "read-only-storage" },
377
+ "elementType": "$aScalar"
378
+ },
379
+ {
380
+ "name": "position_embedding",
381
+ "arg": "positionEmbeddingT",
382
+ "semantic": "position_embedding",
383
+ "buffer": { "type": "read-only-storage" },
384
+ "elementType": "$aScalar"
385
+ },
386
+ {
387
+ "name": "segment_embedding",
388
+ "arg": "segmentEmbeddingT",
389
+ "semantic": "segment_embedding",
390
+ "buffer": { "type": "read-only-storage" },
391
+ "elementType": "$aScalar"
392
+ },
393
+ {
394
+ "name": "output",
395
+ "arg": "outputT",
396
+ "semantic": "output",
397
+ "buffer": { "type": "storage" },
398
+ "elementType": "$aScalar"
399
+ },
400
+ {
401
+ "name": "embedding_sum",
402
+ "arg": "embeddingSumT",
403
+ "semantic": "embedding_sum",
404
+ "buffer": { "type": "storage" },
405
+ "elementType": "$aScalar"
406
+ },
407
+ {
408
+ "name": "params",
409
+ "semantic": "kernel.params",
410
+ "buffer": { "type": "uniform" },
411
+ "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] }
412
+ }
413
+ ],
414
+ "embed_segdefault_posids_nosum": [
415
+ {
416
+ "name": "input_ids",
417
+ "arg": "inputIdsT",
418
+ "semantic": "input_ids",
419
+ "buffer": { "type": "read-only-storage" },
420
+ "elementType": "i32"
421
+ },
422
+ {
423
+ "name": "position_ids",
424
+ "arg": "positionIdsT",
425
+ "semantic": "position_ids",
426
+ "buffer": { "type": "read-only-storage" },
427
+ "elementType": "i32"
428
+ },
429
+ {
430
+ "name": "word_embedding",
431
+ "arg": "wordEmbeddingT",
432
+ "semantic": "word_embedding",
433
+ "buffer": { "type": "read-only-storage" },
434
+ "elementType": "$aScalar"
435
+ },
436
+ {
437
+ "name": "position_embedding",
438
+ "arg": "positionEmbeddingT",
439
+ "semantic": "position_embedding",
440
+ "buffer": { "type": "read-only-storage" },
441
+ "elementType": "$aScalar"
442
+ },
443
+ {
444
+ "name": "segment_embedding",
445
+ "arg": "segmentEmbeddingT",
446
+ "semantic": "segment_embedding",
447
+ "buffer": { "type": "read-only-storage" },
448
+ "elementType": "$aScalar"
449
+ },
450
+ {
451
+ "name": "output",
452
+ "arg": "outputT",
453
+ "semantic": "output",
454
+ "buffer": { "type": "storage" },
455
+ "elementType": "$aScalar"
456
+ },
457
+ {
458
+ "name": "params",
459
+ "semantic": "kernel.params",
460
+ "buffer": { "type": "uniform" },
461
+ "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] }
462
+ }
463
+ ],
464
+ "embed_segdefault_posids_sum": [
465
+ {
466
+ "name": "input_ids",
467
+ "arg": "inputIdsT",
468
+ "semantic": "input_ids",
469
+ "buffer": { "type": "read-only-storage" },
470
+ "elementType": "i32"
471
+ },
472
+ {
473
+ "name": "position_ids",
474
+ "arg": "positionIdsT",
475
+ "semantic": "position_ids",
476
+ "buffer": { "type": "read-only-storage" },
477
+ "elementType": "i32"
478
+ },
479
+ {
480
+ "name": "word_embedding",
481
+ "arg": "wordEmbeddingT",
482
+ "semantic": "word_embedding",
483
+ "buffer": { "type": "read-only-storage" },
484
+ "elementType": "$aScalar"
485
+ },
486
+ {
487
+ "name": "position_embedding",
488
+ "arg": "positionEmbeddingT",
489
+ "semantic": "position_embedding",
490
+ "buffer": { "type": "read-only-storage" },
491
+ "elementType": "$aScalar"
492
+ },
493
+ {
494
+ "name": "segment_embedding",
495
+ "arg": "segmentEmbeddingT",
496
+ "semantic": "segment_embedding",
497
+ "buffer": { "type": "read-only-storage" },
498
+ "elementType": "$aScalar"
499
+ },
500
+ {
501
+ "name": "output",
502
+ "arg": "outputT",
503
+ "semantic": "output",
504
+ "buffer": { "type": "storage" },
505
+ "elementType": "$aScalar"
506
+ },
507
+ {
508
+ "name": "embedding_sum",
509
+ "arg": "embeddingSumT",
510
+ "semantic": "embedding_sum",
511
+ "buffer": { "type": "storage" },
512
+ "elementType": "$aScalar"
513
+ },
514
+ {
515
+ "name": "params",
516
+ "semantic": "kernel.params",
517
+ "buffer": { "type": "uniform" },
518
+ "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] }
519
+ }
520
+ ],
521
+ "embed_seg_nopos_nosum": [
522
+ {
523
+ "name": "input_ids",
524
+ "arg": "inputIdsT",
525
+ "semantic": "input_ids",
526
+ "buffer": { "type": "read-only-storage" },
527
+ "elementType": "i32"
528
+ },
529
+ {
530
+ "name": "segment_ids",
531
+ "arg": "segmentIdsT",
532
+ "semantic": "segment_ids",
533
+ "buffer": { "type": "read-only-storage" },
534
+ "elementType": "i32"
535
+ },
536
+ {
537
+ "name": "word_embedding",
538
+ "arg": "wordEmbeddingT",
539
+ "semantic": "word_embedding",
540
+ "buffer": { "type": "read-only-storage" },
541
+ "elementType": "$aScalar"
542
+ },
543
+ {
544
+ "name": "position_embedding",
545
+ "arg": "positionEmbeddingT",
546
+ "semantic": "position_embedding",
547
+ "buffer": { "type": "read-only-storage" },
548
+ "elementType": "$aScalar"
549
+ },
550
+ {
551
+ "name": "segment_embedding",
552
+ "arg": "segmentEmbeddingT",
553
+ "semantic": "segment_embedding",
554
+ "buffer": { "type": "read-only-storage" },
555
+ "elementType": "$aScalar"
556
+ },
557
+ {
558
+ "name": "output",
559
+ "arg": "outputT",
560
+ "semantic": "output",
561
+ "buffer": { "type": "storage" },
562
+ "elementType": "$aScalar"
563
+ },
564
+ {
565
+ "name": "params",
566
+ "semantic": "kernel.params",
567
+ "buffer": { "type": "uniform" },
568
+ "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] }
569
+ }
570
+ ],
571
+ "embed_seg_nopos_sum": [
572
+ {
573
+ "name": "input_ids",
574
+ "arg": "inputIdsT",
575
+ "semantic": "input_ids",
576
+ "buffer": { "type": "read-only-storage" },
577
+ "elementType": "i32"
578
+ },
579
+ {
580
+ "name": "segment_ids",
581
+ "arg": "segmentIdsT",
582
+ "semantic": "segment_ids",
583
+ "buffer": { "type": "read-only-storage" },
584
+ "elementType": "i32"
585
+ },
586
+ {
587
+ "name": "word_embedding",
588
+ "arg": "wordEmbeddingT",
589
+ "semantic": "word_embedding",
590
+ "buffer": { "type": "read-only-storage" },
591
+ "elementType": "$aScalar"
592
+ },
593
+ {
594
+ "name": "position_embedding",
595
+ "arg": "positionEmbeddingT",
596
+ "semantic": "position_embedding",
597
+ "buffer": { "type": "read-only-storage" },
598
+ "elementType": "$aScalar"
599
+ },
600
+ {
601
+ "name": "segment_embedding",
602
+ "arg": "segmentEmbeddingT",
603
+ "semantic": "segment_embedding",
604
+ "buffer": { "type": "read-only-storage" },
605
+ "elementType": "$aScalar"
606
+ },
607
+ {
608
+ "name": "output",
609
+ "arg": "outputT",
610
+ "semantic": "output",
611
+ "buffer": { "type": "storage" },
612
+ "elementType": "$aScalar"
613
+ },
614
+ {
615
+ "name": "embedding_sum",
616
+ "arg": "embeddingSumT",
617
+ "semantic": "embedding_sum",
618
+ "buffer": { "type": "storage" },
619
+ "elementType": "$aScalar"
620
+ },
621
+ {
622
+ "name": "params",
623
+ "semantic": "kernel.params",
624
+ "buffer": { "type": "uniform" },
625
+ "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] }
626
+ }
627
+ ],
628
+ "embed_seg_posids_nosum": [
629
+ {
630
+ "name": "input_ids",
631
+ "arg": "inputIdsT",
632
+ "semantic": "input_ids",
633
+ "buffer": { "type": "read-only-storage" },
634
+ "elementType": "i32"
635
+ },
636
+ {
637
+ "name": "segment_ids",
638
+ "arg": "segmentIdsT",
639
+ "semantic": "segment_ids",
640
+ "buffer": { "type": "read-only-storage" },
641
+ "elementType": "i32"
642
+ },
643
+ {
644
+ "name": "position_ids",
645
+ "arg": "positionIdsT",
646
+ "semantic": "position_ids",
647
+ "buffer": { "type": "read-only-storage" },
648
+ "elementType": "i32"
649
+ },
650
+ {
651
+ "name": "word_embedding",
652
+ "arg": "wordEmbeddingT",
653
+ "semantic": "word_embedding",
654
+ "buffer": { "type": "read-only-storage" },
655
+ "elementType": "$aScalar"
656
+ },
657
+ {
658
+ "name": "position_embedding",
659
+ "arg": "positionEmbeddingT",
660
+ "semantic": "position_embedding",
661
+ "buffer": { "type": "read-only-storage" },
662
+ "elementType": "$aScalar"
663
+ },
664
+ {
665
+ "name": "segment_embedding",
666
+ "arg": "segmentEmbeddingT",
667
+ "semantic": "segment_embedding",
668
+ "buffer": { "type": "read-only-storage" },
669
+ "elementType": "$aScalar"
670
+ },
671
+ {
672
+ "name": "output",
673
+ "arg": "outputT",
674
+ "semantic": "output",
675
+ "buffer": { "type": "storage" },
676
+ "elementType": "$aScalar"
677
+ },
678
+ {
679
+ "name": "params",
680
+ "semantic": "kernel.params",
681
+ "buffer": { "type": "uniform" },
682
+ "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] }
683
+ }
684
+ ],
685
+ "embed_seg_posids_sum": [
686
+ {
687
+ "name": "input_ids",
688
+ "arg": "inputIdsT",
689
+ "semantic": "input_ids",
690
+ "buffer": { "type": "read-only-storage" },
691
+ "elementType": "i32"
692
+ },
693
+ {
694
+ "name": "segment_ids",
695
+ "arg": "segmentIdsT",
696
+ "semantic": "segment_ids",
697
+ "buffer": { "type": "read-only-storage" },
698
+ "elementType": "i32"
699
+ },
700
+ {
701
+ "name": "position_ids",
702
+ "arg": "positionIdsT",
703
+ "semantic": "position_ids",
704
+ "buffer": { "type": "read-only-storage" },
705
+ "elementType": "i32"
706
+ },
707
+ {
708
+ "name": "word_embedding",
709
+ "arg": "wordEmbeddingT",
710
+ "semantic": "word_embedding",
711
+ "buffer": { "type": "read-only-storage" },
712
+ "elementType": "$aScalar"
713
+ },
714
+ {
715
+ "name": "position_embedding",
716
+ "arg": "positionEmbeddingT",
717
+ "semantic": "position_embedding",
718
+ "buffer": { "type": "read-only-storage" },
719
+ "elementType": "$aScalar"
720
+ },
721
+ {
722
+ "name": "segment_embedding",
723
+ "arg": "segmentEmbeddingT",
724
+ "semantic": "segment_embedding",
725
+ "buffer": { "type": "read-only-storage" },
726
+ "elementType": "$aScalar"
727
+ },
728
+ {
729
+ "name": "output",
730
+ "arg": "outputT",
731
+ "semantic": "output",
732
+ "buffer": { "type": "storage" },
733
+ "elementType": "$aScalar"
734
+ },
735
+ {
736
+ "name": "embedding_sum",
737
+ "arg": "embeddingSumT",
738
+ "semantic": "embedding_sum",
739
+ "buffer": { "type": "storage" },
740
+ "elementType": "$aScalar"
741
+ },
742
+ {
743
+ "name": "params",
744
+ "semantic": "kernel.params",
745
+ "buffer": { "type": "uniform" },
746
+ "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] }
747
+ }
748
+ ],
749
+ "normalizeSet": [
750
+ {
751
+ "name": "output",
752
+ "arg": "outputT",
753
+ "semantic": "output",
754
+ "buffer": { "type": "storage" },
755
+ "elementType": "$aScalar"
756
+ },
757
+ {
758
+ "name": "gamma",
759
+ "arg": "gammaT",
760
+ "semantic": "gamma",
761
+ "buffer": { "type": "read-only-storage" },
762
+ "elementType": "$aScalar",
763
+ "length": "$HIDDEN_LEN"
764
+ },
765
+ {
766
+ "name": "beta",
767
+ "arg": "betaT",
768
+ "semantic": "beta",
769
+ "buffer": { "type": "read-only-storage" },
770
+ "elementType": "$aScalar",
771
+ "length": "$HIDDEN_LEN"
772
+ },
773
+ {
774
+ "name": "params",
775
+ "semantic": "kernel.params",
776
+ "buffer": { "type": "uniform" },
777
+ "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] }
778
+ }
779
+ ],
780
+ "maskIndexSet": [
781
+ {
782
+ "name": "mask",
783
+ "arg": "maskT",
784
+ "semantic": "mask",
785
+ "buffer": { "type": "read-only-storage" },
786
+ "elementType": "i32"
787
+ },
788
+ {
789
+ "name": "mask_index",
790
+ "arg": "maskIndexT",
791
+ "semantic": "mask_index",
792
+ "buffer": { "type": "storage" },
793
+ "elementType": "i32"
794
+ },
795
+ {
796
+ "name": "params",
797
+ "semantic": "kernel.params",
798
+ "buffer": { "type": "uniform" },
799
+ "struct": { "name": "Params", "fields": [{ "name": "batch", "type": "u32", "value": "batchSize" }] }
800
+ }
801
+ ],
802
+ "zeroMaskIndexSet": [
803
+ {
804
+ "name": "mask_index",
805
+ "arg": "maskIndexT",
806
+ "semantic": "mask_index",
807
+ "buffer": { "type": "storage" },
808
+ "elementType": "i32"
809
+ },
810
+ {
811
+ "name": "params",
812
+ "semantic": "kernel.params",
813
+ "buffer": { "type": "uniform" },
814
+ "struct": { "name": "Params", "fields": [{ "name": "batch", "type": "u32", "value": "batchSize" }] }
815
+ }
816
+ ]
817
+ },
818
+ "variants": [
819
+ {
820
+ "id": "noseg_nopos_nosum_nomask",
821
+ "when": ["embedContractOk", "dispatchFits", "not present.segmentEmbeddingT", "not present.positionIdsT", "not present.embeddingSumT", "not present.maskIndexT"],
822
+ "passes": [
823
+ {
824
+ "id": "sum",
825
+ "name": "EmbedLayerNormalization.EmbeddingSum",
826
+ "shader": "embed-sum.wgsl.jinja",
827
+ "bindings": "embed_noseg_nopos_nosum",
828
+ "dispatch": { "workgroups": "tokens" }
829
+ },
830
+ {
831
+ "id": "normalize",
832
+ "name": "EmbedLayerNormalization.Normalize",
833
+ "shader": "embed-normalize.wgsl.jinja",
834
+ "bindings": "normalizeSet",
835
+ "dispatch": { "workgroups": "tokens" }
836
+ }
837
+ ]
838
+ },
839
+ {
840
+ "id": "noseg_nopos_nosum_mask",
841
+ "when": ["embedContractOk", "dispatchFits", "not present.segmentEmbeddingT", "not present.positionIdsT", "not present.embeddingSumT", "present.maskIndexT", "present.maskT"],
842
+ "passes": [
843
+ {
844
+ "id": "sum",
845
+ "name": "EmbedLayerNormalization.EmbeddingSum",
846
+ "shader": "embed-sum.wgsl.jinja",
847
+ "bindings": "embed_noseg_nopos_nosum",
848
+ "dispatch": { "workgroups": "tokens" }
849
+ },
850
+ {
851
+ "id": "normalize",
852
+ "name": "EmbedLayerNormalization.Normalize",
853
+ "shader": "embed-normalize.wgsl.jinja",
854
+ "bindings": "normalizeSet",
855
+ "dispatch": { "workgroups": "tokens" }
856
+ },
857
+ {
858
+ "id": "maskIndex",
859
+ "name": "EmbedLayerNormalization.MaskIndex",
860
+ "shader": "embed-mask-index.wgsl.jinja",
861
+ "bindings": "maskIndexSet",
862
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
863
+ }
864
+ ]
865
+ },
866
+ {
867
+ "id": "noseg_nopos_sum_nomask",
868
+ "when": ["embedContractOk", "dispatchFits", "not present.segmentEmbeddingT", "not present.positionIdsT", "present.embeddingSumT", "not present.maskIndexT"],
869
+ "passes": [
870
+ {
871
+ "id": "sum",
872
+ "name": "EmbedLayerNormalization.EmbeddingSum",
873
+ "shader": "embed-sum.wgsl.jinja",
874
+ "bindings": "embed_noseg_nopos_sum",
875
+ "dispatch": { "workgroups": "tokens" }
876
+ },
877
+ {
878
+ "id": "normalize",
879
+ "name": "EmbedLayerNormalization.Normalize",
880
+ "shader": "embed-normalize.wgsl.jinja",
881
+ "bindings": "normalizeSet",
882
+ "dispatch": { "workgroups": "tokens" }
883
+ }
884
+ ]
885
+ },
886
+ {
887
+ "id": "noseg_nopos_sum_mask",
888
+ "when": ["embedContractOk", "dispatchFits", "not present.segmentEmbeddingT", "not present.positionIdsT", "present.embeddingSumT", "present.maskIndexT", "present.maskT"],
889
+ "passes": [
890
+ {
891
+ "id": "sum",
892
+ "name": "EmbedLayerNormalization.EmbeddingSum",
893
+ "shader": "embed-sum.wgsl.jinja",
894
+ "bindings": "embed_noseg_nopos_sum",
895
+ "dispatch": { "workgroups": "tokens" }
896
+ },
897
+ {
898
+ "id": "normalize",
899
+ "name": "EmbedLayerNormalization.Normalize",
900
+ "shader": "embed-normalize.wgsl.jinja",
901
+ "bindings": "normalizeSet",
902
+ "dispatch": { "workgroups": "tokens" }
903
+ },
904
+ {
905
+ "id": "maskIndex",
906
+ "name": "EmbedLayerNormalization.MaskIndex",
907
+ "shader": "embed-mask-index.wgsl.jinja",
908
+ "bindings": "maskIndexSet",
909
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
910
+ }
911
+ ]
912
+ },
913
+ {
914
+ "id": "noseg_posids_nosum_nomask",
915
+ "when": ["embedContractOk", "dispatchFits", "not present.segmentEmbeddingT", "present.positionIdsT", "not present.embeddingSumT", "not present.maskIndexT"],
916
+ "passes": [
917
+ {
918
+ "id": "sum",
919
+ "name": "EmbedLayerNormalization.EmbeddingSum",
920
+ "shader": "embed-sum.wgsl.jinja",
921
+ "bindings": "embed_noseg_posids_nosum",
922
+ "dispatch": { "workgroups": "tokens" }
923
+ },
924
+ {
925
+ "id": "normalize",
926
+ "name": "EmbedLayerNormalization.Normalize",
927
+ "shader": "embed-normalize.wgsl.jinja",
928
+ "bindings": "normalizeSet",
929
+ "dispatch": { "workgroups": "tokens" }
930
+ }
931
+ ]
932
+ },
933
+ {
934
+ "id": "noseg_posids_nosum_mask",
935
+ "when": ["embedContractOk", "dispatchFits", "not present.segmentEmbeddingT", "present.positionIdsT", "not present.embeddingSumT", "present.maskIndexT", "present.maskT"],
936
+ "passes": [
937
+ {
938
+ "id": "sum",
939
+ "name": "EmbedLayerNormalization.EmbeddingSum",
940
+ "shader": "embed-sum.wgsl.jinja",
941
+ "bindings": "embed_noseg_posids_nosum",
942
+ "dispatch": { "workgroups": "tokens" }
943
+ },
944
+ {
945
+ "id": "normalize",
946
+ "name": "EmbedLayerNormalization.Normalize",
947
+ "shader": "embed-normalize.wgsl.jinja",
948
+ "bindings": "normalizeSet",
949
+ "dispatch": { "workgroups": "tokens" }
950
+ },
951
+ {
952
+ "id": "maskIndex",
953
+ "name": "EmbedLayerNormalization.MaskIndex",
954
+ "shader": "embed-mask-index.wgsl.jinja",
955
+ "bindings": "maskIndexSet",
956
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
957
+ }
958
+ ]
959
+ },
960
+ {
961
+ "id": "noseg_posids_sum_nomask",
962
+ "when": ["embedContractOk", "dispatchFits", "not present.segmentEmbeddingT", "present.positionIdsT", "present.embeddingSumT", "not present.maskIndexT"],
963
+ "passes": [
964
+ {
965
+ "id": "sum",
966
+ "name": "EmbedLayerNormalization.EmbeddingSum",
967
+ "shader": "embed-sum.wgsl.jinja",
968
+ "bindings": "embed_noseg_posids_sum",
969
+ "dispatch": { "workgroups": "tokens" }
970
+ },
971
+ {
972
+ "id": "normalize",
973
+ "name": "EmbedLayerNormalization.Normalize",
974
+ "shader": "embed-normalize.wgsl.jinja",
975
+ "bindings": "normalizeSet",
976
+ "dispatch": { "workgroups": "tokens" }
977
+ }
978
+ ]
979
+ },
980
+ {
981
+ "id": "noseg_posids_sum_mask",
982
+ "when": ["embedContractOk", "dispatchFits", "not present.segmentEmbeddingT", "present.positionIdsT", "present.embeddingSumT", "present.maskIndexT", "present.maskT"],
983
+ "passes": [
984
+ {
985
+ "id": "sum",
986
+ "name": "EmbedLayerNormalization.EmbeddingSum",
987
+ "shader": "embed-sum.wgsl.jinja",
988
+ "bindings": "embed_noseg_posids_sum",
989
+ "dispatch": { "workgroups": "tokens" }
990
+ },
991
+ {
992
+ "id": "normalize",
993
+ "name": "EmbedLayerNormalization.Normalize",
994
+ "shader": "embed-normalize.wgsl.jinja",
995
+ "bindings": "normalizeSet",
996
+ "dispatch": { "workgroups": "tokens" }
997
+ },
998
+ {
999
+ "id": "maskIndex",
1000
+ "name": "EmbedLayerNormalization.MaskIndex",
1001
+ "shader": "embed-mask-index.wgsl.jinja",
1002
+ "bindings": "maskIndexSet",
1003
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
1004
+ }
1005
+ ]
1006
+ },
1007
+ {
1008
+ "id": "seg_nopos_nosum_nomask",
1009
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "present.segmentIdsT", "not present.positionIdsT", "not present.embeddingSumT", "not present.maskIndexT"],
1010
+ "passes": [
1011
+ {
1012
+ "id": "sum",
1013
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1014
+ "shader": "embed-sum.wgsl.jinja",
1015
+ "bindings": "embed_seg_nopos_nosum",
1016
+ "dispatch": { "workgroups": "tokens" }
1017
+ },
1018
+ {
1019
+ "id": "normalize",
1020
+ "name": "EmbedLayerNormalization.Normalize",
1021
+ "shader": "embed-normalize.wgsl.jinja",
1022
+ "bindings": "normalizeSet",
1023
+ "dispatch": { "workgroups": "tokens" }
1024
+ }
1025
+ ]
1026
+ },
1027
+ {
1028
+ "id": "seg_nopos_nosum_mask",
1029
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "present.segmentIdsT", "not present.positionIdsT", "not present.embeddingSumT", "present.maskIndexT", "present.maskT"],
1030
+ "passes": [
1031
+ {
1032
+ "id": "sum",
1033
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1034
+ "shader": "embed-sum.wgsl.jinja",
1035
+ "bindings": "embed_seg_nopos_nosum",
1036
+ "dispatch": { "workgroups": "tokens" }
1037
+ },
1038
+ {
1039
+ "id": "normalize",
1040
+ "name": "EmbedLayerNormalization.Normalize",
1041
+ "shader": "embed-normalize.wgsl.jinja",
1042
+ "bindings": "normalizeSet",
1043
+ "dispatch": { "workgroups": "tokens" }
1044
+ },
1045
+ {
1046
+ "id": "maskIndex",
1047
+ "name": "EmbedLayerNormalization.MaskIndex",
1048
+ "shader": "embed-mask-index.wgsl.jinja",
1049
+ "bindings": "maskIndexSet",
1050
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
1051
+ }
1052
+ ]
1053
+ },
1054
+ {
1055
+ "id": "seg_nopos_sum_nomask",
1056
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "present.segmentIdsT", "not present.positionIdsT", "present.embeddingSumT", "not present.maskIndexT"],
1057
+ "passes": [
1058
+ {
1059
+ "id": "sum",
1060
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1061
+ "shader": "embed-sum.wgsl.jinja",
1062
+ "bindings": "embed_seg_nopos_sum",
1063
+ "dispatch": { "workgroups": "tokens" }
1064
+ },
1065
+ {
1066
+ "id": "normalize",
1067
+ "name": "EmbedLayerNormalization.Normalize",
1068
+ "shader": "embed-normalize.wgsl.jinja",
1069
+ "bindings": "normalizeSet",
1070
+ "dispatch": { "workgroups": "tokens" }
1071
+ }
1072
+ ]
1073
+ },
1074
+ {
1075
+ "id": "seg_nopos_sum_mask",
1076
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "present.segmentIdsT", "not present.positionIdsT", "present.embeddingSumT", "present.maskIndexT", "present.maskT"],
1077
+ "passes": [
1078
+ {
1079
+ "id": "sum",
1080
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1081
+ "shader": "embed-sum.wgsl.jinja",
1082
+ "bindings": "embed_seg_nopos_sum",
1083
+ "dispatch": { "workgroups": "tokens" }
1084
+ },
1085
+ {
1086
+ "id": "normalize",
1087
+ "name": "EmbedLayerNormalization.Normalize",
1088
+ "shader": "embed-normalize.wgsl.jinja",
1089
+ "bindings": "normalizeSet",
1090
+ "dispatch": { "workgroups": "tokens" }
1091
+ },
1092
+ {
1093
+ "id": "maskIndex",
1094
+ "name": "EmbedLayerNormalization.MaskIndex",
1095
+ "shader": "embed-mask-index.wgsl.jinja",
1096
+ "bindings": "maskIndexSet",
1097
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
1098
+ }
1099
+ ]
1100
+ },
1101
+ {
1102
+ "id": "seg_posids_nosum_nomask",
1103
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "present.segmentIdsT", "present.positionIdsT", "not present.embeddingSumT", "not present.maskIndexT"],
1104
+ "passes": [
1105
+ {
1106
+ "id": "sum",
1107
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1108
+ "shader": "embed-sum.wgsl.jinja",
1109
+ "bindings": "embed_seg_posids_nosum",
1110
+ "dispatch": { "workgroups": "tokens" }
1111
+ },
1112
+ {
1113
+ "id": "normalize",
1114
+ "name": "EmbedLayerNormalization.Normalize",
1115
+ "shader": "embed-normalize.wgsl.jinja",
1116
+ "bindings": "normalizeSet",
1117
+ "dispatch": { "workgroups": "tokens" }
1118
+ }
1119
+ ]
1120
+ },
1121
+ {
1122
+ "id": "seg_posids_nosum_mask",
1123
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "present.segmentIdsT", "present.positionIdsT", "not present.embeddingSumT", "present.maskIndexT", "present.maskT"],
1124
+ "passes": [
1125
+ {
1126
+ "id": "sum",
1127
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1128
+ "shader": "embed-sum.wgsl.jinja",
1129
+ "bindings": "embed_seg_posids_nosum",
1130
+ "dispatch": { "workgroups": "tokens" }
1131
+ },
1132
+ {
1133
+ "id": "normalize",
1134
+ "name": "EmbedLayerNormalization.Normalize",
1135
+ "shader": "embed-normalize.wgsl.jinja",
1136
+ "bindings": "normalizeSet",
1137
+ "dispatch": { "workgroups": "tokens" }
1138
+ },
1139
+ {
1140
+ "id": "maskIndex",
1141
+ "name": "EmbedLayerNormalization.MaskIndex",
1142
+ "shader": "embed-mask-index.wgsl.jinja",
1143
+ "bindings": "maskIndexSet",
1144
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
1145
+ }
1146
+ ]
1147
+ },
1148
+ {
1149
+ "id": "seg_posids_sum_nomask",
1150
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "present.segmentIdsT", "present.positionIdsT", "present.embeddingSumT", "not present.maskIndexT"],
1151
+ "passes": [
1152
+ {
1153
+ "id": "sum",
1154
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1155
+ "shader": "embed-sum.wgsl.jinja",
1156
+ "bindings": "embed_seg_posids_sum",
1157
+ "dispatch": { "workgroups": "tokens" }
1158
+ },
1159
+ {
1160
+ "id": "normalize",
1161
+ "name": "EmbedLayerNormalization.Normalize",
1162
+ "shader": "embed-normalize.wgsl.jinja",
1163
+ "bindings": "normalizeSet",
1164
+ "dispatch": { "workgroups": "tokens" }
1165
+ }
1166
+ ]
1167
+ },
1168
+ {
1169
+ "id": "seg_posids_sum_mask",
1170
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "present.segmentIdsT", "present.positionIdsT", "present.embeddingSumT", "present.maskIndexT", "present.maskT"],
1171
+ "passes": [
1172
+ {
1173
+ "id": "sum",
1174
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1175
+ "shader": "embed-sum.wgsl.jinja",
1176
+ "bindings": "embed_seg_posids_sum",
1177
+ "dispatch": { "workgroups": "tokens" }
1178
+ },
1179
+ {
1180
+ "id": "normalize",
1181
+ "name": "EmbedLayerNormalization.Normalize",
1182
+ "shader": "embed-normalize.wgsl.jinja",
1183
+ "bindings": "normalizeSet",
1184
+ "dispatch": { "workgroups": "tokens" }
1185
+ },
1186
+ {
1187
+ "id": "maskIndex",
1188
+ "name": "EmbedLayerNormalization.MaskIndex",
1189
+ "shader": "embed-mask-index.wgsl.jinja",
1190
+ "bindings": "maskIndexSet",
1191
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
1192
+ }
1193
+ ]
1194
+ },
1195
+ {
1196
+ "id": "segdefault_nopos_nosum_nomask",
1197
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "not present.segmentIdsT", "present.positionIdsT == (\"nopos\" == \"posids\")", "present.embeddingSumT == (\"nosum\" == \"sum\")", "not present.maskIndexT"],
1198
+ "passes": [
1199
+ {
1200
+ "id": "sum",
1201
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1202
+ "shader": "embed-sum.wgsl.jinja",
1203
+ "bindings": "embed_segdefault_nopos_nosum",
1204
+ "dispatch": { "workgroups": "tokens" }
1205
+ },
1206
+ {
1207
+ "id": "normalize",
1208
+ "name": "EmbedLayerNormalization.Normalize",
1209
+ "shader": "embed-normalize.wgsl.jinja",
1210
+ "bindings": "normalizeSet",
1211
+ "dispatch": { "workgroups": "tokens" }
1212
+ }
1213
+ ]
1214
+ },
1215
+ {
1216
+ "id": "segdefault_nopos_nosum_mask",
1217
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "not present.segmentIdsT", "present.positionIdsT == (\"nopos\" == \"posids\")", "present.embeddingSumT == (\"nosum\" == \"sum\")", "present.maskIndexT", "present.maskT"],
1218
+ "passes": [
1219
+ {
1220
+ "id": "sum",
1221
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1222
+ "shader": "embed-sum.wgsl.jinja",
1223
+ "bindings": "embed_segdefault_nopos_nosum",
1224
+ "dispatch": { "workgroups": "tokens" }
1225
+ },
1226
+ {
1227
+ "id": "normalize",
1228
+ "name": "EmbedLayerNormalization.Normalize",
1229
+ "shader": "embed-normalize.wgsl.jinja",
1230
+ "bindings": "normalizeSet",
1231
+ "dispatch": { "workgroups": "tokens" }
1232
+ },
1233
+ {
1234
+ "id": "maskIndex",
1235
+ "name": "EmbedLayerNormalization.MaskIndex",
1236
+ "shader": "embed-mask-index.wgsl.jinja",
1237
+ "bindings": "maskIndexSet",
1238
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
1239
+ }
1240
+ ]
1241
+ },
1242
+ {
1243
+ "id": "segdefault_nopos_sum_nomask",
1244
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "not present.segmentIdsT", "present.positionIdsT == (\"nopos\" == \"posids\")", "present.embeddingSumT == (\"sum\" == \"sum\")", "not present.maskIndexT"],
1245
+ "passes": [
1246
+ {
1247
+ "id": "sum",
1248
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1249
+ "shader": "embed-sum.wgsl.jinja",
1250
+ "bindings": "embed_segdefault_nopos_sum",
1251
+ "dispatch": { "workgroups": "tokens" }
1252
+ },
1253
+ {
1254
+ "id": "normalize",
1255
+ "name": "EmbedLayerNormalization.Normalize",
1256
+ "shader": "embed-normalize.wgsl.jinja",
1257
+ "bindings": "normalizeSet",
1258
+ "dispatch": { "workgroups": "tokens" }
1259
+ }
1260
+ ]
1261
+ },
1262
+ {
1263
+ "id": "segdefault_nopos_sum_mask",
1264
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "not present.segmentIdsT", "present.positionIdsT == (\"nopos\" == \"posids\")", "present.embeddingSumT == (\"sum\" == \"sum\")", "present.maskIndexT", "present.maskT"],
1265
+ "passes": [
1266
+ {
1267
+ "id": "sum",
1268
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1269
+ "shader": "embed-sum.wgsl.jinja",
1270
+ "bindings": "embed_segdefault_nopos_sum",
1271
+ "dispatch": { "workgroups": "tokens" }
1272
+ },
1273
+ {
1274
+ "id": "normalize",
1275
+ "name": "EmbedLayerNormalization.Normalize",
1276
+ "shader": "embed-normalize.wgsl.jinja",
1277
+ "bindings": "normalizeSet",
1278
+ "dispatch": { "workgroups": "tokens" }
1279
+ },
1280
+ {
1281
+ "id": "maskIndex",
1282
+ "name": "EmbedLayerNormalization.MaskIndex",
1283
+ "shader": "embed-mask-index.wgsl.jinja",
1284
+ "bindings": "maskIndexSet",
1285
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
1286
+ }
1287
+ ]
1288
+ },
1289
+ {
1290
+ "id": "segdefault_posids_nosum_nomask",
1291
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "not present.segmentIdsT", "present.positionIdsT == (\"posids\" == \"posids\")", "present.embeddingSumT == (\"nosum\" == \"sum\")", "not present.maskIndexT"],
1292
+ "passes": [
1293
+ {
1294
+ "id": "sum",
1295
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1296
+ "shader": "embed-sum.wgsl.jinja",
1297
+ "bindings": "embed_segdefault_posids_nosum",
1298
+ "dispatch": { "workgroups": "tokens" }
1299
+ },
1300
+ {
1301
+ "id": "normalize",
1302
+ "name": "EmbedLayerNormalization.Normalize",
1303
+ "shader": "embed-normalize.wgsl.jinja",
1304
+ "bindings": "normalizeSet",
1305
+ "dispatch": { "workgroups": "tokens" }
1306
+ }
1307
+ ]
1308
+ },
1309
+ {
1310
+ "id": "segdefault_posids_nosum_mask",
1311
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "not present.segmentIdsT", "present.positionIdsT == (\"posids\" == \"posids\")", "present.embeddingSumT == (\"nosum\" == \"sum\")", "present.maskIndexT", "present.maskT"],
1312
+ "passes": [
1313
+ {
1314
+ "id": "sum",
1315
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1316
+ "shader": "embed-sum.wgsl.jinja",
1317
+ "bindings": "embed_segdefault_posids_nosum",
1318
+ "dispatch": { "workgroups": "tokens" }
1319
+ },
1320
+ {
1321
+ "id": "normalize",
1322
+ "name": "EmbedLayerNormalization.Normalize",
1323
+ "shader": "embed-normalize.wgsl.jinja",
1324
+ "bindings": "normalizeSet",
1325
+ "dispatch": { "workgroups": "tokens" }
1326
+ },
1327
+ {
1328
+ "id": "maskIndex",
1329
+ "name": "EmbedLayerNormalization.MaskIndex",
1330
+ "shader": "embed-mask-index.wgsl.jinja",
1331
+ "bindings": "maskIndexSet",
1332
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
1333
+ }
1334
+ ]
1335
+ },
1336
+ {
1337
+ "id": "segdefault_posids_sum_nomask",
1338
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "not present.segmentIdsT", "present.positionIdsT == (\"posids\" == \"posids\")", "present.embeddingSumT == (\"sum\" == \"sum\")", "not present.maskIndexT"],
1339
+ "passes": [
1340
+ {
1341
+ "id": "sum",
1342
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1343
+ "shader": "embed-sum.wgsl.jinja",
1344
+ "bindings": "embed_segdefault_posids_sum",
1345
+ "dispatch": { "workgroups": "tokens" }
1346
+ },
1347
+ {
1348
+ "id": "normalize",
1349
+ "name": "EmbedLayerNormalization.Normalize",
1350
+ "shader": "embed-normalize.wgsl.jinja",
1351
+ "bindings": "normalizeSet",
1352
+ "dispatch": { "workgroups": "tokens" }
1353
+ }
1354
+ ]
1355
+ },
1356
+ {
1357
+ "id": "segdefault_posids_sum_mask",
1358
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "not present.segmentIdsT", "present.positionIdsT == (\"posids\" == \"posids\")", "present.embeddingSumT == (\"sum\" == \"sum\")", "present.maskIndexT", "present.maskT"],
1359
+ "passes": [
1360
+ {
1361
+ "id": "sum",
1362
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1363
+ "shader": "embed-sum.wgsl.jinja",
1364
+ "bindings": "embed_segdefault_posids_sum",
1365
+ "dispatch": { "workgroups": "tokens" }
1366
+ },
1367
+ {
1368
+ "id": "normalize",
1369
+ "name": "EmbedLayerNormalization.Normalize",
1370
+ "shader": "embed-normalize.wgsl.jinja",
1371
+ "bindings": "normalizeSet",
1372
+ "dispatch": { "workgroups": "tokens" }
1373
+ },
1374
+ {
1375
+ "id": "maskIndex",
1376
+ "name": "EmbedLayerNormalization.MaskIndex",
1377
+ "shader": "embed-mask-index.wgsl.jinja",
1378
+ "bindings": "maskIndexSet",
1379
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
1380
+ }
1381
+ ]
1382
+ },
1383
+ {
1384
+ "id": "noseg_nopos_nosum_mask_without_input",
1385
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"noseg\" != \"noseg\")", "present.segmentIdsT == (\"noseg\" == \"seg\")", "present.positionIdsT == (\"nopos\" == \"posids\")", "present.embeddingSumT == (\"nosum\" == \"sum\")", "present.maskIndexT", "not present.maskT"],
1386
+ "passes": [
1387
+ {
1388
+ "id": "sum",
1389
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1390
+ "shader": "embed-sum.wgsl.jinja",
1391
+ "bindings": "embed_noseg_nopos_nosum",
1392
+ "dispatch": { "workgroups": "tokens" }
1393
+ },
1394
+ {
1395
+ "id": "normalize",
1396
+ "name": "EmbedLayerNormalization.Normalize",
1397
+ "shader": "embed-normalize.wgsl.jinja",
1398
+ "bindings": "normalizeSet",
1399
+ "dispatch": { "workgroups": "tokens" }
1400
+ },
1401
+ {
1402
+ "id": "maskIndex",
1403
+ "name": "EmbedLayerNormalization.ZeroMaskIndex",
1404
+ "shader": "embed-mask-index.wgsl.jinja",
1405
+ "bindings": "zeroMaskIndexSet",
1406
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
1407
+ }
1408
+ ]
1409
+ },
1410
+ {
1411
+ "id": "noseg_nopos_sum_mask_without_input",
1412
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"noseg\" != \"noseg\")", "present.segmentIdsT == (\"noseg\" == \"seg\")", "present.positionIdsT == (\"nopos\" == \"posids\")", "present.embeddingSumT == (\"sum\" == \"sum\")", "present.maskIndexT", "not present.maskT"],
1413
+ "passes": [
1414
+ {
1415
+ "id": "sum",
1416
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1417
+ "shader": "embed-sum.wgsl.jinja",
1418
+ "bindings": "embed_noseg_nopos_sum",
1419
+ "dispatch": { "workgroups": "tokens" }
1420
+ },
1421
+ {
1422
+ "id": "normalize",
1423
+ "name": "EmbedLayerNormalization.Normalize",
1424
+ "shader": "embed-normalize.wgsl.jinja",
1425
+ "bindings": "normalizeSet",
1426
+ "dispatch": { "workgroups": "tokens" }
1427
+ },
1428
+ {
1429
+ "id": "maskIndex",
1430
+ "name": "EmbedLayerNormalization.ZeroMaskIndex",
1431
+ "shader": "embed-mask-index.wgsl.jinja",
1432
+ "bindings": "zeroMaskIndexSet",
1433
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
1434
+ }
1435
+ ]
1436
+ },
1437
+ {
1438
+ "id": "noseg_posids_nosum_mask_without_input",
1439
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"noseg\" != \"noseg\")", "present.segmentIdsT == (\"noseg\" == \"seg\")", "present.positionIdsT == (\"posids\" == \"posids\")", "present.embeddingSumT == (\"nosum\" == \"sum\")", "present.maskIndexT", "not present.maskT"],
1440
+ "passes": [
1441
+ {
1442
+ "id": "sum",
1443
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1444
+ "shader": "embed-sum.wgsl.jinja",
1445
+ "bindings": "embed_noseg_posids_nosum",
1446
+ "dispatch": { "workgroups": "tokens" }
1447
+ },
1448
+ {
1449
+ "id": "normalize",
1450
+ "name": "EmbedLayerNormalization.Normalize",
1451
+ "shader": "embed-normalize.wgsl.jinja",
1452
+ "bindings": "normalizeSet",
1453
+ "dispatch": { "workgroups": "tokens" }
1454
+ },
1455
+ {
1456
+ "id": "maskIndex",
1457
+ "name": "EmbedLayerNormalization.ZeroMaskIndex",
1458
+ "shader": "embed-mask-index.wgsl.jinja",
1459
+ "bindings": "zeroMaskIndexSet",
1460
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
1461
+ }
1462
+ ]
1463
+ },
1464
+ {
1465
+ "id": "noseg_posids_sum_mask_without_input",
1466
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"noseg\" != \"noseg\")", "present.segmentIdsT == (\"noseg\" == \"seg\")", "present.positionIdsT == (\"posids\" == \"posids\")", "present.embeddingSumT == (\"sum\" == \"sum\")", "present.maskIndexT", "not present.maskT"],
1467
+ "passes": [
1468
+ {
1469
+ "id": "sum",
1470
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1471
+ "shader": "embed-sum.wgsl.jinja",
1472
+ "bindings": "embed_noseg_posids_sum",
1473
+ "dispatch": { "workgroups": "tokens" }
1474
+ },
1475
+ {
1476
+ "id": "normalize",
1477
+ "name": "EmbedLayerNormalization.Normalize",
1478
+ "shader": "embed-normalize.wgsl.jinja",
1479
+ "bindings": "normalizeSet",
1480
+ "dispatch": { "workgroups": "tokens" }
1481
+ },
1482
+ {
1483
+ "id": "maskIndex",
1484
+ "name": "EmbedLayerNormalization.ZeroMaskIndex",
1485
+ "shader": "embed-mask-index.wgsl.jinja",
1486
+ "bindings": "zeroMaskIndexSet",
1487
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
1488
+ }
1489
+ ]
1490
+ },
1491
+ {
1492
+ "id": "segdefault_nopos_nosum_mask_without_input",
1493
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"segdefault\" != \"noseg\")", "present.segmentIdsT == (\"segdefault\" == \"seg\")", "present.positionIdsT == (\"nopos\" == \"posids\")", "present.embeddingSumT == (\"nosum\" == \"sum\")", "present.maskIndexT", "not present.maskT"],
1494
+ "passes": [
1495
+ {
1496
+ "id": "sum",
1497
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1498
+ "shader": "embed-sum.wgsl.jinja",
1499
+ "bindings": "embed_segdefault_nopos_nosum",
1500
+ "dispatch": { "workgroups": "tokens" }
1501
+ },
1502
+ {
1503
+ "id": "normalize",
1504
+ "name": "EmbedLayerNormalization.Normalize",
1505
+ "shader": "embed-normalize.wgsl.jinja",
1506
+ "bindings": "normalizeSet",
1507
+ "dispatch": { "workgroups": "tokens" }
1508
+ },
1509
+ {
1510
+ "id": "maskIndex",
1511
+ "name": "EmbedLayerNormalization.ZeroMaskIndex",
1512
+ "shader": "embed-mask-index.wgsl.jinja",
1513
+ "bindings": "zeroMaskIndexSet",
1514
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
1515
+ }
1516
+ ]
1517
+ },
1518
+ {
1519
+ "id": "segdefault_nopos_sum_mask_without_input",
1520
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"segdefault\" != \"noseg\")", "present.segmentIdsT == (\"segdefault\" == \"seg\")", "present.positionIdsT == (\"nopos\" == \"posids\")", "present.embeddingSumT == (\"sum\" == \"sum\")", "present.maskIndexT", "not present.maskT"],
1521
+ "passes": [
1522
+ {
1523
+ "id": "sum",
1524
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1525
+ "shader": "embed-sum.wgsl.jinja",
1526
+ "bindings": "embed_segdefault_nopos_sum",
1527
+ "dispatch": { "workgroups": "tokens" }
1528
+ },
1529
+ {
1530
+ "id": "normalize",
1531
+ "name": "EmbedLayerNormalization.Normalize",
1532
+ "shader": "embed-normalize.wgsl.jinja",
1533
+ "bindings": "normalizeSet",
1534
+ "dispatch": { "workgroups": "tokens" }
1535
+ },
1536
+ {
1537
+ "id": "maskIndex",
1538
+ "name": "EmbedLayerNormalization.ZeroMaskIndex",
1539
+ "shader": "embed-mask-index.wgsl.jinja",
1540
+ "bindings": "zeroMaskIndexSet",
1541
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
1542
+ }
1543
+ ]
1544
+ },
1545
+ {
1546
+ "id": "segdefault_posids_nosum_mask_without_input",
1547
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"segdefault\" != \"noseg\")", "present.segmentIdsT == (\"segdefault\" == \"seg\")", "present.positionIdsT == (\"posids\" == \"posids\")", "present.embeddingSumT == (\"nosum\" == \"sum\")", "present.maskIndexT", "not present.maskT"],
1548
+ "passes": [
1549
+ {
1550
+ "id": "sum",
1551
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1552
+ "shader": "embed-sum.wgsl.jinja",
1553
+ "bindings": "embed_segdefault_posids_nosum",
1554
+ "dispatch": { "workgroups": "tokens" }
1555
+ },
1556
+ {
1557
+ "id": "normalize",
1558
+ "name": "EmbedLayerNormalization.Normalize",
1559
+ "shader": "embed-normalize.wgsl.jinja",
1560
+ "bindings": "normalizeSet",
1561
+ "dispatch": { "workgroups": "tokens" }
1562
+ },
1563
+ {
1564
+ "id": "maskIndex",
1565
+ "name": "EmbedLayerNormalization.ZeroMaskIndex",
1566
+ "shader": "embed-mask-index.wgsl.jinja",
1567
+ "bindings": "zeroMaskIndexSet",
1568
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
1569
+ }
1570
+ ]
1571
+ },
1572
+ {
1573
+ "id": "segdefault_posids_sum_mask_without_input",
1574
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"segdefault\" != \"noseg\")", "present.segmentIdsT == (\"segdefault\" == \"seg\")", "present.positionIdsT == (\"posids\" == \"posids\")", "present.embeddingSumT == (\"sum\" == \"sum\")", "present.maskIndexT", "not present.maskT"],
1575
+ "passes": [
1576
+ {
1577
+ "id": "sum",
1578
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1579
+ "shader": "embed-sum.wgsl.jinja",
1580
+ "bindings": "embed_segdefault_posids_sum",
1581
+ "dispatch": { "workgroups": "tokens" }
1582
+ },
1583
+ {
1584
+ "id": "normalize",
1585
+ "name": "EmbedLayerNormalization.Normalize",
1586
+ "shader": "embed-normalize.wgsl.jinja",
1587
+ "bindings": "normalizeSet",
1588
+ "dispatch": { "workgroups": "tokens" }
1589
+ },
1590
+ {
1591
+ "id": "maskIndex",
1592
+ "name": "EmbedLayerNormalization.ZeroMaskIndex",
1593
+ "shader": "embed-mask-index.wgsl.jinja",
1594
+ "bindings": "zeroMaskIndexSet",
1595
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
1596
+ }
1597
+ ]
1598
+ },
1599
+ {
1600
+ "id": "seg_nopos_nosum_mask_without_input",
1601
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"seg\" != \"noseg\")", "present.segmentIdsT == (\"seg\" == \"seg\")", "present.positionIdsT == (\"nopos\" == \"posids\")", "present.embeddingSumT == (\"nosum\" == \"sum\")", "present.maskIndexT", "not present.maskT"],
1602
+ "passes": [
1603
+ {
1604
+ "id": "sum",
1605
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1606
+ "shader": "embed-sum.wgsl.jinja",
1607
+ "bindings": "embed_seg_nopos_nosum",
1608
+ "dispatch": { "workgroups": "tokens" }
1609
+ },
1610
+ {
1611
+ "id": "normalize",
1612
+ "name": "EmbedLayerNormalization.Normalize",
1613
+ "shader": "embed-normalize.wgsl.jinja",
1614
+ "bindings": "normalizeSet",
1615
+ "dispatch": { "workgroups": "tokens" }
1616
+ },
1617
+ {
1618
+ "id": "maskIndex",
1619
+ "name": "EmbedLayerNormalization.ZeroMaskIndex",
1620
+ "shader": "embed-mask-index.wgsl.jinja",
1621
+ "bindings": "zeroMaskIndexSet",
1622
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
1623
+ }
1624
+ ]
1625
+ },
1626
+ {
1627
+ "id": "seg_nopos_sum_mask_without_input",
1628
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"seg\" != \"noseg\")", "present.segmentIdsT == (\"seg\" == \"seg\")", "present.positionIdsT == (\"nopos\" == \"posids\")", "present.embeddingSumT == (\"sum\" == \"sum\")", "present.maskIndexT", "not present.maskT"],
1629
+ "passes": [
1630
+ {
1631
+ "id": "sum",
1632
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1633
+ "shader": "embed-sum.wgsl.jinja",
1634
+ "bindings": "embed_seg_nopos_sum",
1635
+ "dispatch": { "workgroups": "tokens" }
1636
+ },
1637
+ {
1638
+ "id": "normalize",
1639
+ "name": "EmbedLayerNormalization.Normalize",
1640
+ "shader": "embed-normalize.wgsl.jinja",
1641
+ "bindings": "normalizeSet",
1642
+ "dispatch": { "workgroups": "tokens" }
1643
+ },
1644
+ {
1645
+ "id": "maskIndex",
1646
+ "name": "EmbedLayerNormalization.ZeroMaskIndex",
1647
+ "shader": "embed-mask-index.wgsl.jinja",
1648
+ "bindings": "zeroMaskIndexSet",
1649
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
1650
+ }
1651
+ ]
1652
+ },
1653
+ {
1654
+ "id": "seg_posids_nosum_mask_without_input",
1655
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"seg\" != \"noseg\")", "present.segmentIdsT == (\"seg\" == \"seg\")", "present.positionIdsT == (\"posids\" == \"posids\")", "present.embeddingSumT == (\"nosum\" == \"sum\")", "present.maskIndexT", "not present.maskT"],
1656
+ "passes": [
1657
+ {
1658
+ "id": "sum",
1659
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1660
+ "shader": "embed-sum.wgsl.jinja",
1661
+ "bindings": "embed_seg_posids_nosum",
1662
+ "dispatch": { "workgroups": "tokens" }
1663
+ },
1664
+ {
1665
+ "id": "normalize",
1666
+ "name": "EmbedLayerNormalization.Normalize",
1667
+ "shader": "embed-normalize.wgsl.jinja",
1668
+ "bindings": "normalizeSet",
1669
+ "dispatch": { "workgroups": "tokens" }
1670
+ },
1671
+ {
1672
+ "id": "maskIndex",
1673
+ "name": "EmbedLayerNormalization.ZeroMaskIndex",
1674
+ "shader": "embed-mask-index.wgsl.jinja",
1675
+ "bindings": "zeroMaskIndexSet",
1676
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
1677
+ }
1678
+ ]
1679
+ },
1680
+ {
1681
+ "id": "seg_posids_sum_mask_without_input",
1682
+ "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"seg\" != \"noseg\")", "present.segmentIdsT == (\"seg\" == \"seg\")", "present.positionIdsT == (\"posids\" == \"posids\")", "present.embeddingSumT == (\"sum\" == \"sum\")", "present.maskIndexT", "not present.maskT"],
1683
+ "passes": [
1684
+ {
1685
+ "id": "sum",
1686
+ "name": "EmbedLayerNormalization.EmbeddingSum",
1687
+ "shader": "embed-sum.wgsl.jinja",
1688
+ "bindings": "embed_seg_posids_sum",
1689
+ "dispatch": { "workgroups": "tokens" }
1690
+ },
1691
+ {
1692
+ "id": "normalize",
1693
+ "name": "EmbedLayerNormalization.Normalize",
1694
+ "shader": "embed-normalize.wgsl.jinja",
1695
+ "bindings": "normalizeSet",
1696
+ "dispatch": { "workgroups": "tokens" }
1697
+ },
1698
+ {
1699
+ "id": "maskIndex",
1700
+ "name": "EmbedLayerNormalization.ZeroMaskIndex",
1701
+ "shader": "embed-mask-index.wgsl.jinja",
1702
+ "bindings": "zeroMaskIndexSet",
1703
+ "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" }
1704
+ }
1705
+ ]
1706
+ }
1707
+ ]
1708
+ }
build/webgpu/metadata.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "com.microsoft.EmbedLayerNormalization",
3
+ "id": "_com_microsoft_embedlayernormalization_webgpu_b297617",
4
+ "version": 1,
5
+ "license": "Apache-2.0",
6
+ "backend": { "type": "webgpu" },
7
+ "digest": {
8
+ "algorithm": "sha256",
9
+ "files": {
10
+ "bench.json": "LyhXY2RrY86niUBQGOouS5wCSVNuVu0RylHfXPXwZRc=",
11
+ "embed-mask-index.wgsl.jinja": "7wT7/LzdrOnanlTU5kmneEYpGb6D8v0H9/9mra8eF5Q=",
12
+ "embed-normalize.wgsl.jinja": "YObvmdAvDuyx8f4pwTmVxphDSivMh4Y2oovmT7eGm1s=",
13
+ "embed-sum.wgsl.jinja": "cCsjv9CmNWgQLtMOAvEQOveXEO6jpeX7NMD4PiaaIW0=",
14
+ "manifest.json": "C/rakYKSOpdBjI3xKiqWRE18Dg002pKoEVcA/yRtprM=",
15
+ "test.json": "UE2iD8tAA2HxgRcTihjDe6LYfamqEWUopaGGER7vNQc="
16
+ }
17
+ },
18
+ "provenance": { "kernel": { "sha": "2e7068faf55e7f43df740015f6d1ee49391a41c5", "dirty": false } },
19
+ "webgpu": { "manifestSpec": "1.0", "specialized": true, "opPath": "ops/com.microsoft.EmbedLayerNormalization" }
20
+ }
build/webgpu/test.json ADDED
@@ -0,0 +1,1325 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "op": "com.microsoft.EmbedLayerNormalization",
3
+ "cases": [
4
+ {
5
+ "name": "segment_embedding_without_segment_ids_uses_row_zero",
6
+ "provenance": {
7
+ "source": "onnxruntime/contrib_ops/cpu/bert/embed_layer_norm.cc",
8
+ "notes": "The public schema makes both segment inputs independently optional. The pinned CPU and CUDA providers use segment row 0 when the table is present without segment_ids."
9
+ },
10
+ "attrs": { "epsilon": 0.00001 },
11
+ "inputs": {
12
+ "inputIdsT": { "dtype": "int32", "shape": [1, 2], "data": { "kind": "values", "values": [0, 1] } },
13
+ "wordEmbeddingT": {
14
+ "dtype": "float32",
15
+ "shape": [2, 4],
16
+ "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, -1.0, 0.0, 1.0, 2.0] }
17
+ },
18
+ "positionEmbeddingT": {
19
+ "dtype": "float32",
20
+ "shape": [2, 4],
21
+ "data": { "kind": "values", "values": [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8] }
22
+ },
23
+ "segmentEmbeddingT": {
24
+ "dtype": "float32",
25
+ "shape": [1, 4],
26
+ "data": { "kind": "values", "values": [0.25, -0.5, 0.75, -1.0] }
27
+ },
28
+ "gammaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [1.0, 1.0, 1.0, 1.0] } },
29
+ "betaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.0, 0.0, 0.0, 0.0] } }
30
+ },
31
+ "outputs": {
32
+ "outputT": { "dtype": "float32", "shape": [1, 2, 4], "tolerance": 0.00001 },
33
+ "embeddingSumT": { "dtype": "float32", "shape": [1, 2, 4], "tolerance": 0.000001 }
34
+ }
35
+ },
36
+ {
37
+ "name": "segment_default_nopos_nosum_nomask",
38
+ "inputs": {
39
+ "inputIdsT": { "dtype": "int32", "shape": [1, 1] },
40
+ "wordEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
41
+ "positionEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
42
+ "segmentEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
43
+ "gammaT": { "dtype": "float32", "shape": [4] },
44
+ "betaT": { "dtype": "float32", "shape": [4] }
45
+ },
46
+ "outputs": { "outputT": { "dtype": "float32", "shape": [1, 1, 4] } }
47
+ },
48
+ {
49
+ "name": "segment_default_nopos_nosum_mask",
50
+ "inputs": {
51
+ "inputIdsT": { "dtype": "int32", "shape": [1, 1] },
52
+ "wordEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
53
+ "positionEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
54
+ "segmentEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
55
+ "gammaT": { "dtype": "float32", "shape": [4] },
56
+ "betaT": { "dtype": "float32", "shape": [4] },
57
+ "maskT": { "dtype": "int32", "shape": [1, 1] }
58
+ },
59
+ "outputs": {
60
+ "outputT": { "dtype": "float32", "shape": [1, 1, 4] },
61
+ "maskIndexT": { "dtype": "int32", "shape": [1] }
62
+ }
63
+ },
64
+ {
65
+ "name": "segment_default_nopos_sum_mask",
66
+ "inputs": {
67
+ "inputIdsT": { "dtype": "int32", "shape": [1, 1] },
68
+ "wordEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
69
+ "positionEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
70
+ "segmentEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
71
+ "gammaT": { "dtype": "float32", "shape": [4] },
72
+ "betaT": { "dtype": "float32", "shape": [4] },
73
+ "maskT": { "dtype": "int32", "shape": [1, 1] }
74
+ },
75
+ "outputs": {
76
+ "outputT": { "dtype": "float32", "shape": [1, 1, 4] },
77
+ "maskIndexT": { "dtype": "int32", "shape": [1] },
78
+ "embeddingSumT": { "dtype": "float32", "shape": [1, 1, 4] }
79
+ }
80
+ },
81
+ {
82
+ "name": "segment_default_posids_nosum_nomask",
83
+ "inputs": {
84
+ "inputIdsT": { "dtype": "int32", "shape": [1, 1] },
85
+ "positionIdsT": { "dtype": "int32", "shape": [1, 1] },
86
+ "wordEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
87
+ "positionEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
88
+ "segmentEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
89
+ "gammaT": { "dtype": "float32", "shape": [4] },
90
+ "betaT": { "dtype": "float32", "shape": [4] }
91
+ },
92
+ "outputs": { "outputT": { "dtype": "float32", "shape": [1, 1, 4] } }
93
+ },
94
+ {
95
+ "name": "segment_default_posids_nosum_mask",
96
+ "inputs": {
97
+ "inputIdsT": { "dtype": "int32", "shape": [1, 1] },
98
+ "positionIdsT": { "dtype": "int32", "shape": [1, 1] },
99
+ "wordEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
100
+ "positionEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
101
+ "segmentEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
102
+ "gammaT": { "dtype": "float32", "shape": [4] },
103
+ "betaT": { "dtype": "float32", "shape": [4] },
104
+ "maskT": { "dtype": "int32", "shape": [1, 1] }
105
+ },
106
+ "outputs": {
107
+ "outputT": { "dtype": "float32", "shape": [1, 1, 4] },
108
+ "maskIndexT": { "dtype": "int32", "shape": [1] }
109
+ }
110
+ },
111
+ {
112
+ "name": "segment_default_posids_sum_nomask",
113
+ "inputs": {
114
+ "inputIdsT": { "dtype": "int32", "shape": [1, 1] },
115
+ "positionIdsT": { "dtype": "int32", "shape": [1, 1] },
116
+ "wordEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
117
+ "positionEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
118
+ "segmentEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
119
+ "gammaT": { "dtype": "float32", "shape": [4] },
120
+ "betaT": { "dtype": "float32", "shape": [4] }
121
+ },
122
+ "outputs": {
123
+ "outputT": { "dtype": "float32", "shape": [1, 1, 4] },
124
+ "embeddingSumT": { "dtype": "float32", "shape": [1, 1, 4] }
125
+ }
126
+ },
127
+ {
128
+ "name": "segment_default_posids_sum_mask",
129
+ "inputs": {
130
+ "inputIdsT": { "dtype": "int32", "shape": [1, 1] },
131
+ "positionIdsT": { "dtype": "int32", "shape": [1, 1] },
132
+ "wordEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
133
+ "positionEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
134
+ "segmentEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
135
+ "gammaT": { "dtype": "float32", "shape": [4] },
136
+ "betaT": { "dtype": "float32", "shape": [4] },
137
+ "maskT": { "dtype": "int32", "shape": [1, 1] }
138
+ },
139
+ "outputs": {
140
+ "outputT": { "dtype": "float32", "shape": [1, 1, 4] },
141
+ "maskIndexT": { "dtype": "int32", "shape": [1] },
142
+ "embeddingSumT": { "dtype": "float32", "shape": [1, 1, 4] }
143
+ }
144
+ },
145
+ {
146
+ "name": "segment_default_nopos_nosum_mask_without_input",
147
+ "inputs": {
148
+ "inputIdsT": { "dtype": "int32", "shape": [1, 1] },
149
+ "wordEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
150
+ "positionEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
151
+ "segmentEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
152
+ "gammaT": { "dtype": "float32", "shape": [4] },
153
+ "betaT": { "dtype": "float32", "shape": [4] }
154
+ },
155
+ "outputs": {
156
+ "outputT": { "dtype": "float32", "shape": [1, 1, 4] },
157
+ "maskIndexT": { "dtype": "int32", "shape": [1] }
158
+ }
159
+ },
160
+ {
161
+ "name": "segment_default_nopos_sum_mask_without_input",
162
+ "inputs": {
163
+ "inputIdsT": { "dtype": "int32", "shape": [1, 1] },
164
+ "wordEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
165
+ "positionEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
166
+ "segmentEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
167
+ "gammaT": { "dtype": "float32", "shape": [4] },
168
+ "betaT": { "dtype": "float32", "shape": [4] }
169
+ },
170
+ "outputs": {
171
+ "outputT": { "dtype": "float32", "shape": [1, 1, 4] },
172
+ "maskIndexT": { "dtype": "int32", "shape": [1] },
173
+ "embeddingSumT": { "dtype": "float32", "shape": [1, 1, 4] }
174
+ }
175
+ },
176
+ {
177
+ "name": "segment_default_posids_nosum_mask_without_input",
178
+ "inputs": {
179
+ "inputIdsT": { "dtype": "int32", "shape": [1, 1] },
180
+ "positionIdsT": { "dtype": "int32", "shape": [1, 1] },
181
+ "wordEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
182
+ "positionEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
183
+ "segmentEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
184
+ "gammaT": { "dtype": "float32", "shape": [4] },
185
+ "betaT": { "dtype": "float32", "shape": [4] }
186
+ },
187
+ "outputs": {
188
+ "outputT": { "dtype": "float32", "shape": [1, 1, 4] },
189
+ "maskIndexT": { "dtype": "int32", "shape": [1] }
190
+ }
191
+ },
192
+ {
193
+ "name": "segment_default_posids_sum_mask_without_input",
194
+ "inputs": {
195
+ "inputIdsT": { "dtype": "int32", "shape": [1, 1] },
196
+ "positionIdsT": { "dtype": "int32", "shape": [1, 1] },
197
+ "wordEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
198
+ "positionEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
199
+ "segmentEmbeddingT": { "dtype": "float32", "shape": [1, 4] },
200
+ "gammaT": { "dtype": "float32", "shape": [4] },
201
+ "betaT": { "dtype": "float32", "shape": [4] }
202
+ },
203
+ "outputs": {
204
+ "outputT": { "dtype": "float32", "shape": [1, 1, 4] },
205
+ "maskIndexT": { "dtype": "int32", "shape": [1] },
206
+ "embeddingSumT": { "dtype": "float32", "shape": [1, 1, 4] }
207
+ }
208
+ },
209
+ {
210
+ "name": "noseg_nopos_nosum_mask_index_without_mask",
211
+ "provenance": {
212
+ "source": "onnxruntime/contrib_ops/cpu/bert/embed_layer_norm.cc",
213
+ "notes": "Pins ORT's independently optional mask_index output: when mask is absent, the output is initialized to zeros."
214
+ },
215
+ "inputs": {
216
+ "inputIdsT": {
217
+ "dtype": "int32",
218
+ "shape": [2, 4],
219
+ "data": { "kind": "values", "values": [3, 10, 17, 4, 11, 18, 5, 12] }
220
+ },
221
+ "wordEmbeddingT": {
222
+ "dtype": "float32",
223
+ "shape": [20, 8],
224
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
225
+ },
226
+ "positionEmbeddingT": {
227
+ "dtype": "float32",
228
+ "shape": [6, 8],
229
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
230
+ },
231
+ "gammaT": {
232
+ "dtype": "float32",
233
+ "shape": [8],
234
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
235
+ },
236
+ "betaT": {
237
+ "dtype": "float32",
238
+ "shape": [8],
239
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
240
+ }
241
+ },
242
+ "outputs": {
243
+ "outputT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 },
244
+ "maskIndexT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 0] } }
245
+ }
246
+ },
247
+ {
248
+ "name": "noseg_nopos_nosum_mask",
249
+ "inputs": {
250
+ "inputIdsT": {
251
+ "dtype": "int32",
252
+ "shape": [2, 4],
253
+ "data": { "kind": "values", "values": [3, 10, 17, 4, 11, 18, 5, 12] }
254
+ },
255
+ "wordEmbeddingT": {
256
+ "dtype": "float32",
257
+ "shape": [20, 8],
258
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
259
+ },
260
+ "positionEmbeddingT": {
261
+ "dtype": "float32",
262
+ "shape": [6, 8],
263
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
264
+ },
265
+ "gammaT": {
266
+ "dtype": "float32",
267
+ "shape": [8],
268
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
269
+ },
270
+ "betaT": {
271
+ "dtype": "float32",
272
+ "shape": [8],
273
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
274
+ },
275
+ "maskT": { "dtype": "int32", "shape": [2, 4], "data": { "kind": "values", "values": [1, 1, 1, 0, 1, 1, 0, 0] } }
276
+ },
277
+ "outputs": {
278
+ "outputT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 },
279
+ "maskIndexT": { "dtype": "int32", "shape": [2] }
280
+ }
281
+ },
282
+ {
283
+ "name": "noseg_nopos_sum_mask_index_without_mask",
284
+ "inputs": {
285
+ "inputIdsT": {
286
+ "dtype": "int32",
287
+ "shape": [2, 4],
288
+ "data": { "kind": "values", "values": [3, 10, 17, 4, 11, 18, 5, 12] }
289
+ },
290
+ "wordEmbeddingT": {
291
+ "dtype": "float32",
292
+ "shape": [20, 8],
293
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
294
+ },
295
+ "positionEmbeddingT": {
296
+ "dtype": "float32",
297
+ "shape": [6, 8],
298
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
299
+ },
300
+ "gammaT": {
301
+ "dtype": "float32",
302
+ "shape": [8],
303
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
304
+ },
305
+ "betaT": {
306
+ "dtype": "float32",
307
+ "shape": [8],
308
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
309
+ }
310
+ },
311
+ "outputs": {
312
+ "outputT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 },
313
+ "maskIndexT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 0] } },
314
+ "embeddingSumT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 }
315
+ }
316
+ },
317
+ {
318
+ "name": "noseg_nopos_sum_mask",
319
+ "inputs": {
320
+ "inputIdsT": {
321
+ "dtype": "int32",
322
+ "shape": [2, 4],
323
+ "data": { "kind": "values", "values": [3, 10, 17, 4, 11, 18, 5, 12] }
324
+ },
325
+ "wordEmbeddingT": {
326
+ "dtype": "float32",
327
+ "shape": [20, 8],
328
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
329
+ },
330
+ "positionEmbeddingT": {
331
+ "dtype": "float32",
332
+ "shape": [6, 8],
333
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
334
+ },
335
+ "gammaT": {
336
+ "dtype": "float32",
337
+ "shape": [8],
338
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
339
+ },
340
+ "betaT": {
341
+ "dtype": "float32",
342
+ "shape": [8],
343
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
344
+ },
345
+ "maskT": { "dtype": "int32", "shape": [2, 4], "data": { "kind": "values", "values": [1, 1, 1, 0, 1, 1, 0, 0] } }
346
+ },
347
+ "outputs": {
348
+ "outputT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 },
349
+ "maskIndexT": { "dtype": "int32", "shape": [2] },
350
+ "embeddingSumT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 }
351
+ }
352
+ },
353
+ {
354
+ "name": "noseg_posids_nosum_mask_index_without_mask",
355
+ "inputs": {
356
+ "inputIdsT": {
357
+ "dtype": "int32",
358
+ "shape": [2, 4],
359
+ "data": { "kind": "values", "values": [3, 10, 17, 4, 11, 18, 5, 12] }
360
+ },
361
+ "positionIdsT": {
362
+ "dtype": "int32",
363
+ "shape": [2, 4],
364
+ "data": { "kind": "values", "values": [0, 2, 4, 0, 2, 4, 0, 2] }
365
+ },
366
+ "wordEmbeddingT": {
367
+ "dtype": "float32",
368
+ "shape": [20, 8],
369
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
370
+ },
371
+ "positionEmbeddingT": {
372
+ "dtype": "float32",
373
+ "shape": [6, 8],
374
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
375
+ },
376
+ "gammaT": {
377
+ "dtype": "float32",
378
+ "shape": [8],
379
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
380
+ },
381
+ "betaT": {
382
+ "dtype": "float32",
383
+ "shape": [8],
384
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
385
+ }
386
+ },
387
+ "outputs": {
388
+ "outputT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 },
389
+ "maskIndexT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 0] } }
390
+ }
391
+ },
392
+ {
393
+ "name": "noseg_posids_nosum_mask",
394
+ "inputs": {
395
+ "inputIdsT": {
396
+ "dtype": "int32",
397
+ "shape": [2, 4],
398
+ "data": { "kind": "values", "values": [3, 10, 17, 4, 11, 18, 5, 12] }
399
+ },
400
+ "positionIdsT": {
401
+ "dtype": "int32",
402
+ "shape": [2, 4],
403
+ "data": { "kind": "values", "values": [0, 2, 4, 0, 2, 4, 0, 2] }
404
+ },
405
+ "wordEmbeddingT": {
406
+ "dtype": "float32",
407
+ "shape": [20, 8],
408
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
409
+ },
410
+ "positionEmbeddingT": {
411
+ "dtype": "float32",
412
+ "shape": [6, 8],
413
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
414
+ },
415
+ "gammaT": {
416
+ "dtype": "float32",
417
+ "shape": [8],
418
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
419
+ },
420
+ "betaT": {
421
+ "dtype": "float32",
422
+ "shape": [8],
423
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
424
+ },
425
+ "maskT": { "dtype": "int32", "shape": [2, 4], "data": { "kind": "values", "values": [1, 1, 1, 0, 1, 1, 0, 0] } }
426
+ },
427
+ "outputs": {
428
+ "outputT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 },
429
+ "maskIndexT": { "dtype": "int32", "shape": [2] }
430
+ }
431
+ },
432
+ {
433
+ "name": "noseg_posids_sum_mask_index_without_mask",
434
+ "inputs": {
435
+ "inputIdsT": {
436
+ "dtype": "int32",
437
+ "shape": [2, 4],
438
+ "data": { "kind": "values", "values": [3, 10, 17, 4, 11, 18, 5, 12] }
439
+ },
440
+ "positionIdsT": {
441
+ "dtype": "int32",
442
+ "shape": [2, 4],
443
+ "data": { "kind": "values", "values": [0, 2, 4, 0, 2, 4, 0, 2] }
444
+ },
445
+ "wordEmbeddingT": {
446
+ "dtype": "float32",
447
+ "shape": [20, 8],
448
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
449
+ },
450
+ "positionEmbeddingT": {
451
+ "dtype": "float32",
452
+ "shape": [6, 8],
453
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
454
+ },
455
+ "gammaT": {
456
+ "dtype": "float32",
457
+ "shape": [8],
458
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
459
+ },
460
+ "betaT": {
461
+ "dtype": "float32",
462
+ "shape": [8],
463
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
464
+ }
465
+ },
466
+ "outputs": {
467
+ "outputT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 },
468
+ "maskIndexT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 0] } },
469
+ "embeddingSumT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 }
470
+ }
471
+ },
472
+ {
473
+ "name": "noseg_posids_sum_mask",
474
+ "inputs": {
475
+ "inputIdsT": {
476
+ "dtype": "int32",
477
+ "shape": [2, 4],
478
+ "data": { "kind": "values", "values": [3, 10, 17, 4, 11, 18, 5, 12] }
479
+ },
480
+ "positionIdsT": {
481
+ "dtype": "int32",
482
+ "shape": [2, 4],
483
+ "data": { "kind": "values", "values": [0, 2, 4, 0, 2, 4, 0, 2] }
484
+ },
485
+ "wordEmbeddingT": {
486
+ "dtype": "float32",
487
+ "shape": [20, 8],
488
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
489
+ },
490
+ "positionEmbeddingT": {
491
+ "dtype": "float32",
492
+ "shape": [6, 8],
493
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
494
+ },
495
+ "gammaT": {
496
+ "dtype": "float32",
497
+ "shape": [8],
498
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
499
+ },
500
+ "betaT": {
501
+ "dtype": "float32",
502
+ "shape": [8],
503
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
504
+ },
505
+ "maskT": { "dtype": "int32", "shape": [2, 4], "data": { "kind": "values", "values": [1, 1, 1, 0, 1, 1, 0, 0] } }
506
+ },
507
+ "outputs": {
508
+ "outputT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 },
509
+ "maskIndexT": { "dtype": "int32", "shape": [2] },
510
+ "embeddingSumT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 }
511
+ }
512
+ },
513
+ {
514
+ "name": "seg_nopos_nosum_mask_index_without_mask",
515
+ "inputs": {
516
+ "inputIdsT": {
517
+ "dtype": "int32",
518
+ "shape": [2, 4],
519
+ "data": { "kind": "values", "values": [3, 10, 17, 4, 11, 18, 5, 12] }
520
+ },
521
+ "segmentIdsT": {
522
+ "dtype": "int32",
523
+ "shape": [2, 4],
524
+ "data": { "kind": "values", "values": [0, 0, 0, 0, 0, 0, 0, 0] }
525
+ },
526
+ "wordEmbeddingT": {
527
+ "dtype": "float32",
528
+ "shape": [20, 8],
529
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
530
+ },
531
+ "positionEmbeddingT": {
532
+ "dtype": "float32",
533
+ "shape": [6, 8],
534
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
535
+ },
536
+ "segmentEmbeddingT": {
537
+ "dtype": "float32",
538
+ "shape": [3, 8],
539
+ "data": { "kind": "fillFloat32", "sinStep": 0.53, "cosStep": 0.19, "scale": 0.4 }
540
+ },
541
+ "gammaT": {
542
+ "dtype": "float32",
543
+ "shape": [8],
544
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
545
+ },
546
+ "betaT": {
547
+ "dtype": "float32",
548
+ "shape": [8],
549
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
550
+ }
551
+ },
552
+ "outputs": {
553
+ "outputT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 },
554
+ "maskIndexT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 0] } }
555
+ }
556
+ },
557
+ {
558
+ "name": "seg_nopos_nosum_mask",
559
+ "inputs": {
560
+ "inputIdsT": {
561
+ "dtype": "int32",
562
+ "shape": [2, 4],
563
+ "data": { "kind": "values", "values": [3, 10, 17, 4, 11, 18, 5, 12] }
564
+ },
565
+ "segmentIdsT": {
566
+ "dtype": "int32",
567
+ "shape": [2, 4],
568
+ "data": { "kind": "values", "values": [0, 0, 0, 0, 0, 0, 0, 0] }
569
+ },
570
+ "wordEmbeddingT": {
571
+ "dtype": "float32",
572
+ "shape": [20, 8],
573
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
574
+ },
575
+ "positionEmbeddingT": {
576
+ "dtype": "float32",
577
+ "shape": [6, 8],
578
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
579
+ },
580
+ "segmentEmbeddingT": {
581
+ "dtype": "float32",
582
+ "shape": [3, 8],
583
+ "data": { "kind": "fillFloat32", "sinStep": 0.53, "cosStep": 0.19, "scale": 0.4 }
584
+ },
585
+ "gammaT": {
586
+ "dtype": "float32",
587
+ "shape": [8],
588
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
589
+ },
590
+ "betaT": {
591
+ "dtype": "float32",
592
+ "shape": [8],
593
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
594
+ },
595
+ "maskT": { "dtype": "int32", "shape": [2, 4], "data": { "kind": "values", "values": [1, 1, 1, 0, 1, 1, 0, 0] } }
596
+ },
597
+ "outputs": {
598
+ "outputT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 },
599
+ "maskIndexT": { "dtype": "int32", "shape": [2] }
600
+ }
601
+ },
602
+ {
603
+ "name": "seg_nopos_sum_mask_index_without_mask",
604
+ "inputs": {
605
+ "inputIdsT": {
606
+ "dtype": "int32",
607
+ "shape": [2, 4],
608
+ "data": { "kind": "values", "values": [3, 10, 17, 4, 11, 18, 5, 12] }
609
+ },
610
+ "segmentIdsT": {
611
+ "dtype": "int32",
612
+ "shape": [2, 4],
613
+ "data": { "kind": "values", "values": [0, 0, 0, 0, 0, 0, 0, 0] }
614
+ },
615
+ "wordEmbeddingT": {
616
+ "dtype": "float32",
617
+ "shape": [20, 8],
618
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
619
+ },
620
+ "positionEmbeddingT": {
621
+ "dtype": "float32",
622
+ "shape": [6, 8],
623
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
624
+ },
625
+ "segmentEmbeddingT": {
626
+ "dtype": "float32",
627
+ "shape": [3, 8],
628
+ "data": { "kind": "fillFloat32", "sinStep": 0.53, "cosStep": 0.19, "scale": 0.4 }
629
+ },
630
+ "gammaT": {
631
+ "dtype": "float32",
632
+ "shape": [8],
633
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
634
+ },
635
+ "betaT": {
636
+ "dtype": "float32",
637
+ "shape": [8],
638
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
639
+ }
640
+ },
641
+ "outputs": {
642
+ "outputT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 },
643
+ "maskIndexT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 0] } },
644
+ "embeddingSumT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 }
645
+ }
646
+ },
647
+ {
648
+ "name": "seg_nopos_sum_mask",
649
+ "inputs": {
650
+ "inputIdsT": {
651
+ "dtype": "int32",
652
+ "shape": [2, 4],
653
+ "data": { "kind": "values", "values": [3, 10, 17, 4, 11, 18, 5, 12] }
654
+ },
655
+ "segmentIdsT": {
656
+ "dtype": "int32",
657
+ "shape": [2, 4],
658
+ "data": { "kind": "values", "values": [0, 0, 0, 0, 0, 0, 0, 0] }
659
+ },
660
+ "wordEmbeddingT": {
661
+ "dtype": "float32",
662
+ "shape": [20, 8],
663
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
664
+ },
665
+ "positionEmbeddingT": {
666
+ "dtype": "float32",
667
+ "shape": [6, 8],
668
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
669
+ },
670
+ "segmentEmbeddingT": {
671
+ "dtype": "float32",
672
+ "shape": [3, 8],
673
+ "data": { "kind": "fillFloat32", "sinStep": 0.53, "cosStep": 0.19, "scale": 0.4 }
674
+ },
675
+ "gammaT": {
676
+ "dtype": "float32",
677
+ "shape": [8],
678
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
679
+ },
680
+ "betaT": {
681
+ "dtype": "float32",
682
+ "shape": [8],
683
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
684
+ },
685
+ "maskT": { "dtype": "int32", "shape": [2, 4], "data": { "kind": "values", "values": [1, 1, 1, 0, 1, 1, 0, 0] } }
686
+ },
687
+ "outputs": {
688
+ "outputT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 },
689
+ "maskIndexT": { "dtype": "int32", "shape": [2] },
690
+ "embeddingSumT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 }
691
+ }
692
+ },
693
+ {
694
+ "name": "seg_posids_nosum_mask_index_without_mask",
695
+ "inputs": {
696
+ "inputIdsT": {
697
+ "dtype": "int32",
698
+ "shape": [2, 4],
699
+ "data": { "kind": "values", "values": [3, 10, 17, 4, 11, 18, 5, 12] }
700
+ },
701
+ "segmentIdsT": {
702
+ "dtype": "int32",
703
+ "shape": [2, 4],
704
+ "data": { "kind": "values", "values": [0, 0, 0, 0, 0, 0, 0, 0] }
705
+ },
706
+ "positionIdsT": {
707
+ "dtype": "int32",
708
+ "shape": [2, 4],
709
+ "data": { "kind": "values", "values": [0, 2, 4, 0, 2, 4, 0, 2] }
710
+ },
711
+ "wordEmbeddingT": {
712
+ "dtype": "float32",
713
+ "shape": [20, 8],
714
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
715
+ },
716
+ "positionEmbeddingT": {
717
+ "dtype": "float32",
718
+ "shape": [6, 8],
719
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
720
+ },
721
+ "segmentEmbeddingT": {
722
+ "dtype": "float32",
723
+ "shape": [3, 8],
724
+ "data": { "kind": "fillFloat32", "sinStep": 0.53, "cosStep": 0.19, "scale": 0.4 }
725
+ },
726
+ "gammaT": {
727
+ "dtype": "float32",
728
+ "shape": [8],
729
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
730
+ },
731
+ "betaT": {
732
+ "dtype": "float32",
733
+ "shape": [8],
734
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
735
+ }
736
+ },
737
+ "outputs": {
738
+ "outputT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 },
739
+ "maskIndexT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 0] } }
740
+ }
741
+ },
742
+ {
743
+ "name": "seg_posids_nosum_mask",
744
+ "inputs": {
745
+ "inputIdsT": {
746
+ "dtype": "int32",
747
+ "shape": [2, 4],
748
+ "data": { "kind": "values", "values": [3, 10, 17, 4, 11, 18, 5, 12] }
749
+ },
750
+ "segmentIdsT": {
751
+ "dtype": "int32",
752
+ "shape": [2, 4],
753
+ "data": { "kind": "values", "values": [0, 0, 0, 0, 0, 0, 0, 0] }
754
+ },
755
+ "positionIdsT": {
756
+ "dtype": "int32",
757
+ "shape": [2, 4],
758
+ "data": { "kind": "values", "values": [0, 2, 4, 0, 2, 4, 0, 2] }
759
+ },
760
+ "wordEmbeddingT": {
761
+ "dtype": "float32",
762
+ "shape": [20, 8],
763
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
764
+ },
765
+ "positionEmbeddingT": {
766
+ "dtype": "float32",
767
+ "shape": [6, 8],
768
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
769
+ },
770
+ "segmentEmbeddingT": {
771
+ "dtype": "float32",
772
+ "shape": [3, 8],
773
+ "data": { "kind": "fillFloat32", "sinStep": 0.53, "cosStep": 0.19, "scale": 0.4 }
774
+ },
775
+ "gammaT": {
776
+ "dtype": "float32",
777
+ "shape": [8],
778
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
779
+ },
780
+ "betaT": {
781
+ "dtype": "float32",
782
+ "shape": [8],
783
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
784
+ },
785
+ "maskT": { "dtype": "int32", "shape": [2, 4], "data": { "kind": "values", "values": [1, 1, 1, 0, 1, 1, 0, 0] } }
786
+ },
787
+ "outputs": {
788
+ "outputT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 },
789
+ "maskIndexT": { "dtype": "int32", "shape": [2] }
790
+ }
791
+ },
792
+ {
793
+ "name": "seg_posids_sum_mask_index_without_mask",
794
+ "inputs": {
795
+ "inputIdsT": {
796
+ "dtype": "int32",
797
+ "shape": [2, 4],
798
+ "data": { "kind": "values", "values": [3, 10, 17, 4, 11, 18, 5, 12] }
799
+ },
800
+ "segmentIdsT": {
801
+ "dtype": "int32",
802
+ "shape": [2, 4],
803
+ "data": { "kind": "values", "values": [0, 0, 0, 0, 0, 0, 0, 0] }
804
+ },
805
+ "positionIdsT": {
806
+ "dtype": "int32",
807
+ "shape": [2, 4],
808
+ "data": { "kind": "values", "values": [0, 2, 4, 0, 2, 4, 0, 2] }
809
+ },
810
+ "wordEmbeddingT": {
811
+ "dtype": "float32",
812
+ "shape": [20, 8],
813
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
814
+ },
815
+ "positionEmbeddingT": {
816
+ "dtype": "float32",
817
+ "shape": [6, 8],
818
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
819
+ },
820
+ "segmentEmbeddingT": {
821
+ "dtype": "float32",
822
+ "shape": [3, 8],
823
+ "data": { "kind": "fillFloat32", "sinStep": 0.53, "cosStep": 0.19, "scale": 0.4 }
824
+ },
825
+ "gammaT": {
826
+ "dtype": "float32",
827
+ "shape": [8],
828
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
829
+ },
830
+ "betaT": {
831
+ "dtype": "float32",
832
+ "shape": [8],
833
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
834
+ }
835
+ },
836
+ "outputs": {
837
+ "outputT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 },
838
+ "maskIndexT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 0] } },
839
+ "embeddingSumT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 }
840
+ }
841
+ },
842
+ {
843
+ "name": "seg_posids_sum_mask",
844
+ "inputs": {
845
+ "inputIdsT": {
846
+ "dtype": "int32",
847
+ "shape": [2, 4],
848
+ "data": { "kind": "values", "values": [3, 10, 17, 4, 11, 18, 5, 12] }
849
+ },
850
+ "segmentIdsT": {
851
+ "dtype": "int32",
852
+ "shape": [2, 4],
853
+ "data": { "kind": "values", "values": [0, 0, 0, 0, 0, 0, 0, 0] }
854
+ },
855
+ "positionIdsT": {
856
+ "dtype": "int32",
857
+ "shape": [2, 4],
858
+ "data": { "kind": "values", "values": [0, 2, 4, 0, 2, 4, 0, 2] }
859
+ },
860
+ "wordEmbeddingT": {
861
+ "dtype": "float32",
862
+ "shape": [20, 8],
863
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
864
+ },
865
+ "positionEmbeddingT": {
866
+ "dtype": "float32",
867
+ "shape": [6, 8],
868
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
869
+ },
870
+ "segmentEmbeddingT": {
871
+ "dtype": "float32",
872
+ "shape": [3, 8],
873
+ "data": { "kind": "fillFloat32", "sinStep": 0.53, "cosStep": 0.19, "scale": 0.4 }
874
+ },
875
+ "gammaT": {
876
+ "dtype": "float32",
877
+ "shape": [8],
878
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
879
+ },
880
+ "betaT": {
881
+ "dtype": "float32",
882
+ "shape": [8],
883
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
884
+ },
885
+ "maskT": { "dtype": "int32", "shape": [2, 4], "data": { "kind": "values", "values": [1, 1, 1, 0, 1, 1, 0, 0] } }
886
+ },
887
+ "outputs": {
888
+ "outputT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 },
889
+ "maskIndexT": { "dtype": "int32", "shape": [2] },
890
+ "embeddingSumT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 }
891
+ }
892
+ },
893
+ {
894
+ "name": "noseg_nopos_sum_mask_index_omitted",
895
+ "provenance": { "notes": "Compact optional-output regression: embedding_sum does not imply mask_index." },
896
+ "inputs": {
897
+ "inputIdsT": { "dtype": "int32", "shape": [1, 2], "data": { "kind": "values", "values": [0, 1] } },
898
+ "wordEmbeddingT": {
899
+ "dtype": "float32",
900
+ "shape": [2, 2],
901
+ "data": { "kind": "values", "values": [0.2, -0.4, 0.7, 0.1] }
902
+ },
903
+ "positionEmbeddingT": {
904
+ "dtype": "float32",
905
+ "shape": [2, 2],
906
+ "data": { "kind": "values", "values": [0.3, 0.6, -0.2, 0.5] }
907
+ },
908
+ "gammaT": { "dtype": "float32", "shape": [2], "data": { "kind": "values", "values": [1.1, 0.9] } },
909
+ "betaT": { "dtype": "float32", "shape": [2], "data": { "kind": "values", "values": [0.05, -0.1] } }
910
+ },
911
+ "outputs": {
912
+ "outputT": { "dtype": "float32", "shape": [1, 2, 2], "tolerance": 0.00001, "relTolerance": 0.0001 },
913
+ "embeddingSumT": { "dtype": "float32", "shape": [1, 2, 2], "tolerance": 0.00001, "relTolerance": 0.0001 }
914
+ }
915
+ },
916
+ {
917
+ "name": "noseg_posids_sum_mask_index_omitted",
918
+ "provenance": {
919
+ "notes": "Compact optional-output regression: requesting embedding_sum does not require mask_index."
920
+ },
921
+ "inputs": {
922
+ "inputIdsT": { "dtype": "int32", "shape": [1, 2], "data": { "kind": "values", "values": [0, 1] } },
923
+ "positionIdsT": { "dtype": "int32", "shape": [1, 2], "data": { "kind": "values", "values": [1, 0] } },
924
+ "wordEmbeddingT": {
925
+ "dtype": "float32",
926
+ "shape": [2, 2],
927
+ "data": { "kind": "values", "values": [0.2, -0.4, 0.7, 0.1] }
928
+ },
929
+ "positionEmbeddingT": {
930
+ "dtype": "float32",
931
+ "shape": [2, 2],
932
+ "data": { "kind": "values", "values": [0.3, 0.6, -0.2, 0.5] }
933
+ },
934
+ "gammaT": { "dtype": "float32", "shape": [2], "data": { "kind": "values", "values": [1.1, 0.9] } },
935
+ "betaT": { "dtype": "float32", "shape": [2], "data": { "kind": "values", "values": [0.05, -0.1] } }
936
+ },
937
+ "outputs": {
938
+ "outputT": { "dtype": "float32", "shape": [1, 2, 2], "tolerance": 0.00001, "relTolerance": 0.0001 },
939
+ "embeddingSumT": { "dtype": "float32", "shape": [1, 2, 2], "tolerance": 0.00001, "relTolerance": 0.0001 }
940
+ }
941
+ },
942
+ {
943
+ "name": "seg_nopos_nosum_mask_index_omitted",
944
+ "provenance": { "notes": "Compact optional-output regression: segment embeddings do not require mask_index." },
945
+ "inputs": {
946
+ "inputIdsT": { "dtype": "int32", "shape": [1, 2], "data": { "kind": "values", "values": [0, 1] } },
947
+ "segmentIdsT": { "dtype": "int32", "shape": [1, 2], "data": { "kind": "values", "values": [0, 1] } },
948
+ "wordEmbeddingT": {
949
+ "dtype": "float32",
950
+ "shape": [2, 2],
951
+ "data": { "kind": "values", "values": [0.2, -0.4, 0.7, 0.1] }
952
+ },
953
+ "positionEmbeddingT": {
954
+ "dtype": "float32",
955
+ "shape": [2, 2],
956
+ "data": { "kind": "values", "values": [0.3, 0.6, -0.2, 0.5] }
957
+ },
958
+ "segmentEmbeddingT": {
959
+ "dtype": "float32",
960
+ "shape": [2, 2],
961
+ "data": { "kind": "values", "values": [0.1, 0.2, -0.3, 0.4] }
962
+ },
963
+ "gammaT": { "dtype": "float32", "shape": [2], "data": { "kind": "values", "values": [1.1, 0.9] } },
964
+ "betaT": { "dtype": "float32", "shape": [2], "data": { "kind": "values", "values": [0.05, -0.1] } }
965
+ },
966
+ "outputs": { "outputT": { "dtype": "float32", "shape": [1, 2, 2], "tolerance": 0.00001, "relTolerance": 0.0001 } }
967
+ },
968
+ {
969
+ "name": "seg_posids_nosum_mask_index_omitted",
970
+ "provenance": {
971
+ "notes": "Compact optional-output regression: segment and position ids do not require mask_index."
972
+ },
973
+ "inputs": {
974
+ "inputIdsT": { "dtype": "int32", "shape": [1, 2], "data": { "kind": "values", "values": [0, 1] } },
975
+ "segmentIdsT": { "dtype": "int32", "shape": [1, 2], "data": { "kind": "values", "values": [0, 1] } },
976
+ "positionIdsT": { "dtype": "int32", "shape": [1, 2], "data": { "kind": "values", "values": [1, 0] } },
977
+ "wordEmbeddingT": {
978
+ "dtype": "float32",
979
+ "shape": [2, 2],
980
+ "data": { "kind": "values", "values": [0.2, -0.4, 0.7, 0.1] }
981
+ },
982
+ "positionEmbeddingT": {
983
+ "dtype": "float32",
984
+ "shape": [2, 2],
985
+ "data": { "kind": "values", "values": [0.3, 0.6, -0.2, 0.5] }
986
+ },
987
+ "segmentEmbeddingT": {
988
+ "dtype": "float32",
989
+ "shape": [2, 2],
990
+ "data": { "kind": "values", "values": [0.1, 0.2, -0.3, 0.4] }
991
+ },
992
+ "gammaT": { "dtype": "float32", "shape": [2], "data": { "kind": "values", "values": [1.1, 0.9] } },
993
+ "betaT": { "dtype": "float32", "shape": [2], "data": { "kind": "values", "values": [0.05, -0.1] } }
994
+ },
995
+ "outputs": { "outputT": { "dtype": "float32", "shape": [1, 2, 2], "tolerance": 0.00001, "relTolerance": 0.0001 } }
996
+ },
997
+ {
998
+ "name": "seg_posids_sum_mask_index_omitted",
999
+ "provenance": {
1000
+ "notes": "Compact optional-output regression: embedding_sum remains independently requestable with the full embedding input set."
1001
+ },
1002
+ "inputs": {
1003
+ "inputIdsT": { "dtype": "int32", "shape": [1, 2], "data": { "kind": "values", "values": [0, 1] } },
1004
+ "segmentIdsT": { "dtype": "int32", "shape": [1, 2], "data": { "kind": "values", "values": [0, 1] } },
1005
+ "positionIdsT": { "dtype": "int32", "shape": [1, 2], "data": { "kind": "values", "values": [1, 0] } },
1006
+ "wordEmbeddingT": {
1007
+ "dtype": "float32",
1008
+ "shape": [2, 2],
1009
+ "data": { "kind": "values", "values": [0.2, -0.4, 0.7, 0.1] }
1010
+ },
1011
+ "positionEmbeddingT": {
1012
+ "dtype": "float32",
1013
+ "shape": [2, 2],
1014
+ "data": { "kind": "values", "values": [0.3, 0.6, -0.2, 0.5] }
1015
+ },
1016
+ "segmentEmbeddingT": {
1017
+ "dtype": "float32",
1018
+ "shape": [2, 2],
1019
+ "data": { "kind": "values", "values": [0.1, 0.2, -0.3, 0.4] }
1020
+ },
1021
+ "gammaT": { "dtype": "float32", "shape": [2], "data": { "kind": "values", "values": [1.1, 0.9] } },
1022
+ "betaT": { "dtype": "float32", "shape": [2], "data": { "kind": "values", "values": [0.05, -0.1] } }
1023
+ },
1024
+ "outputs": {
1025
+ "outputT": { "dtype": "float32", "shape": [1, 2, 2], "tolerance": 0.00001, "relTolerance": 0.0001 },
1026
+ "embeddingSumT": { "dtype": "float32", "shape": [1, 2, 2], "tolerance": 0.00001, "relTolerance": 0.0001 }
1027
+ }
1028
+ },
1029
+ {
1030
+ "name": "position_ids_broadcast_row",
1031
+ "provenance": {
1032
+ "notes": "position_ids of shape (1, sequence_length) is shared by every batch, so the row index drops back to the position within the sequence."
1033
+ },
1034
+ "inputs": {
1035
+ "inputIdsT": {
1036
+ "dtype": "int32",
1037
+ "shape": [2, 4],
1038
+ "data": { "kind": "values", "values": [3, 10, 17, 4, 11, 18, 5, 12] }
1039
+ },
1040
+ "positionIdsT": { "dtype": "int32", "shape": [1, 4], "data": { "kind": "values", "values": [0, 2, 4, 0] } },
1041
+ "wordEmbeddingT": {
1042
+ "dtype": "float32",
1043
+ "shape": [20, 8],
1044
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
1045
+ },
1046
+ "positionEmbeddingT": {
1047
+ "dtype": "float32",
1048
+ "shape": [6, 8],
1049
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
1050
+ },
1051
+ "gammaT": {
1052
+ "dtype": "float32",
1053
+ "shape": [8],
1054
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
1055
+ },
1056
+ "betaT": {
1057
+ "dtype": "float32",
1058
+ "shape": [8],
1059
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
1060
+ }
1061
+ },
1062
+ "outputs": { "outputT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 } }
1063
+ },
1064
+ {
1065
+ "name": "mask_full_row_and_partial_row",
1066
+ "provenance": {
1067
+ "notes": "Pins the public first-zero contract with one full row and one non-left-aligned row. The latter distinguishes first-zero (1) from the CPU provider's divergent count-ones result (3)."
1068
+ },
1069
+ "inputs": {
1070
+ "inputIdsT": {
1071
+ "dtype": "int32",
1072
+ "shape": [2, 4],
1073
+ "data": { "kind": "values", "values": [3, 10, 17, 4, 11, 18, 5, 12] }
1074
+ },
1075
+ "wordEmbeddingT": {
1076
+ "dtype": "float32",
1077
+ "shape": [20, 8],
1078
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
1079
+ },
1080
+ "positionEmbeddingT": {
1081
+ "dtype": "float32",
1082
+ "shape": [6, 8],
1083
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
1084
+ },
1085
+ "gammaT": {
1086
+ "dtype": "float32",
1087
+ "shape": [8],
1088
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
1089
+ },
1090
+ "betaT": {
1091
+ "dtype": "float32",
1092
+ "shape": [8],
1093
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
1094
+ },
1095
+ "maskT": { "dtype": "int32", "shape": [2, 4], "data": { "kind": "values", "values": [1, 1, 1, 1, 1, 0, 1, 1] } }
1096
+ },
1097
+ "outputs": {
1098
+ "outputT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 },
1099
+ "maskIndexT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [4, 1] } }
1100
+ }
1101
+ },
1102
+ {
1103
+ "name": "mask_input_without_mask_index",
1104
+ "provenance": {
1105
+ "notes": "Pins the independent optionality in the opposite direction: a mask input is valid when mask_index is not requested."
1106
+ },
1107
+ "attrs": { "mask_index_type": 0 },
1108
+ "inputs": {
1109
+ "inputIdsT": {
1110
+ "dtype": "int32",
1111
+ "shape": [2, 4],
1112
+ "data": { "kind": "values", "values": [3, 10, 17, 4, 11, 18, 5, 12] }
1113
+ },
1114
+ "wordEmbeddingT": {
1115
+ "dtype": "float32",
1116
+ "shape": [20, 8],
1117
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
1118
+ },
1119
+ "positionEmbeddingT": {
1120
+ "dtype": "float32",
1121
+ "shape": [6, 8],
1122
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
1123
+ },
1124
+ "gammaT": {
1125
+ "dtype": "float32",
1126
+ "shape": [8],
1127
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
1128
+ },
1129
+ "betaT": {
1130
+ "dtype": "float32",
1131
+ "shape": [8],
1132
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
1133
+ },
1134
+ "maskT": { "dtype": "int32", "shape": [2, 4], "data": { "kind": "values", "values": [1, 0, 1, 1, 0, 1, 0, 1] } }
1135
+ },
1136
+ "outputs": { "outputT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 } }
1137
+ },
1138
+ {
1139
+ "name": "explicit_epsilon",
1140
+ "attrs": { "epsilon": 0.00001 },
1141
+ "inputs": {
1142
+ "inputIdsT": {
1143
+ "dtype": "int32",
1144
+ "shape": [2, 4],
1145
+ "data": { "kind": "values", "values": [3, 10, 17, 4, 11, 18, 5, 12] }
1146
+ },
1147
+ "wordEmbeddingT": {
1148
+ "dtype": "float32",
1149
+ "shape": [20, 8],
1150
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
1151
+ },
1152
+ "positionEmbeddingT": {
1153
+ "dtype": "float32",
1154
+ "shape": [6, 8],
1155
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
1156
+ },
1157
+ "gammaT": {
1158
+ "dtype": "float32",
1159
+ "shape": [8],
1160
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
1161
+ },
1162
+ "betaT": {
1163
+ "dtype": "float32",
1164
+ "shape": [8],
1165
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
1166
+ }
1167
+ },
1168
+ "outputs": { "outputT": { "dtype": "float32", "shape": [2, 4, 8], "tolerance": 0.00001, "relTolerance": 0.0001 } }
1169
+ },
1170
+ {
1171
+ "name": "hidden_wider_than_workgroup_stride",
1172
+ "provenance": {
1173
+ "notes": "A hidden size that is not a multiple of the workgroup, so the strided loops cover a partial final step."
1174
+ },
1175
+ "inputs": {
1176
+ "inputIdsT": { "dtype": "int32", "shape": [1, 2], "data": { "kind": "values", "values": [3, 10] } },
1177
+ "segmentIdsT": { "dtype": "int32", "shape": [1, 2], "data": { "kind": "values", "values": [0, 1] } },
1178
+ "wordEmbeddingT": {
1179
+ "dtype": "float32",
1180
+ "shape": [12, 40],
1181
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
1182
+ },
1183
+ "positionEmbeddingT": {
1184
+ "dtype": "float32",
1185
+ "shape": [4, 40],
1186
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
1187
+ },
1188
+ "segmentEmbeddingT": {
1189
+ "dtype": "float32",
1190
+ "shape": [2, 40],
1191
+ "data": { "kind": "fillFloat32", "sinStep": 0.53, "cosStep": 0.19, "scale": 0.4 }
1192
+ },
1193
+ "gammaT": {
1194
+ "dtype": "float32",
1195
+ "shape": [40],
1196
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
1197
+ },
1198
+ "betaT": {
1199
+ "dtype": "float32",
1200
+ "shape": [40],
1201
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
1202
+ }
1203
+ },
1204
+ "outputs": {
1205
+ "outputT": { "dtype": "float32", "shape": [1, 2, 40], "tolerance": 0.00001, "relTolerance": 0.0001 },
1206
+ "embeddingSumT": { "dtype": "float32", "shape": [1, 2, 40], "tolerance": 0.00001, "relTolerance": 0.0001 }
1207
+ }
1208
+ },
1209
+ {
1210
+ "name": "f16_full",
1211
+ "inputs": {
1212
+ "inputIdsT": {
1213
+ "dtype": "int32",
1214
+ "shape": [2, 4],
1215
+ "data": { "kind": "values", "values": [3, 10, 17, 4, 11, 18, 5, 12] }
1216
+ },
1217
+ "segmentIdsT": {
1218
+ "dtype": "int32",
1219
+ "shape": [2, 4],
1220
+ "data": { "kind": "values", "values": [0, 0, 0, 0, 0, 0, 0, 0] }
1221
+ },
1222
+ "wordEmbeddingT": {
1223
+ "dtype": "float16",
1224
+ "shape": [20, 8],
1225
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
1226
+ },
1227
+ "positionEmbeddingT": {
1228
+ "dtype": "float16",
1229
+ "shape": [6, 8],
1230
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
1231
+ },
1232
+ "segmentEmbeddingT": {
1233
+ "dtype": "float16",
1234
+ "shape": [3, 8],
1235
+ "data": { "kind": "fillFloat32", "sinStep": 0.53, "cosStep": 0.19, "scale": 0.4 }
1236
+ },
1237
+ "gammaT": {
1238
+ "dtype": "float16",
1239
+ "shape": [8],
1240
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
1241
+ },
1242
+ "betaT": {
1243
+ "dtype": "float16",
1244
+ "shape": [8],
1245
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
1246
+ },
1247
+ "maskT": { "dtype": "int32", "shape": [2, 4], "data": { "kind": "values", "values": [1, 1, 1, 0, 1, 1, 0, 0] } }
1248
+ },
1249
+ "outputs": {
1250
+ "outputT": { "dtype": "float16", "shape": [2, 4, 8], "tolerance": 0.004, "relTolerance": 0.01 },
1251
+ "maskIndexT": { "dtype": "int32", "shape": [2] },
1252
+ "embeddingSumT": { "dtype": "float16", "shape": [2, 4, 8], "tolerance": 0.004, "relTolerance": 0.01 }
1253
+ }
1254
+ },
1255
+ {
1256
+ "name": "f16_cuda_association_embedding_sum_exact",
1257
+ "provenance": {
1258
+ "source": "onnxruntime/contrib_ops/cuda/bert/embed_layer_norm_impl.cu",
1259
+ "notes": "The first lane distinguishes staged (word + segment) + position from (word + position) + segment by one float16 ULP."
1260
+ },
1261
+ "inputs": {
1262
+ "inputIdsT": { "dtype": "int32", "shape": [1, 1], "data": { "kind": "values", "values": [0] } },
1263
+ "segmentIdsT": { "dtype": "int32", "shape": [1, 1], "data": { "kind": "values", "values": [0] } },
1264
+ "wordEmbeddingT": {
1265
+ "dtype": "float16",
1266
+ "shape": [1, 4],
1267
+ "data": { "kind": "values", "values": [-0.9599609375, 1.0, -1.0, 0.0] }
1268
+ },
1269
+ "positionEmbeddingT": {
1270
+ "dtype": "float16",
1271
+ "shape": [1, 4],
1272
+ "data": { "kind": "values", "values": [3.134765625, 2.0, 1.0, 0.5] }
1273
+ },
1274
+ "segmentEmbeddingT": {
1275
+ "dtype": "float16",
1276
+ "shape": [1, 4],
1277
+ "data": { "kind": "values", "values": [0.2060546875, 3.0, 2.0, -0.25] }
1278
+ },
1279
+ "gammaT": { "dtype": "float16", "shape": [4], "data": { "kind": "values", "values": [1.0, 1.0, 1.0, 1.0] } },
1280
+ "betaT": { "dtype": "float16", "shape": [4], "data": { "kind": "values", "values": [0.0, 0.0, 0.0, 0.0] } }
1281
+ },
1282
+ "outputs": {
1283
+ "outputT": { "dtype": "float16", "shape": [1, 1, 4], "tolerance": 0.004, "relTolerance": 0.01 },
1284
+ "embeddingSumT": {
1285
+ "dtype": "float16",
1286
+ "shape": [1, 1, 4],
1287
+ "data": { "kind": "values", "values": [2.380859375, 6.0, 2.0, 0.25] },
1288
+ "tolerance": 0,
1289
+ "relTolerance": 0
1290
+ }
1291
+ }
1292
+ },
1293
+ {
1294
+ "name": "f16_minimal",
1295
+ "inputs": {
1296
+ "inputIdsT": {
1297
+ "dtype": "int32",
1298
+ "shape": [2, 4],
1299
+ "data": { "kind": "values", "values": [3, 10, 17, 4, 11, 18, 5, 12] }
1300
+ },
1301
+ "wordEmbeddingT": {
1302
+ "dtype": "float16",
1303
+ "shape": [20, 8],
1304
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29, "scale": 0.9 }
1305
+ },
1306
+ "positionEmbeddingT": {
1307
+ "dtype": "float16",
1308
+ "shape": [6, 8],
1309
+ "data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 0.6 }
1310
+ },
1311
+ "gammaT": {
1312
+ "dtype": "float16",
1313
+ "shape": [8],
1314
+ "data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 0.3, "offset": 1.0 }
1315
+ },
1316
+ "betaT": {
1317
+ "dtype": "float16",
1318
+ "shape": [8],
1319
+ "data": { "kind": "fillFloat32", "sinStep": 0.61, "cosStep": 0.17, "scale": 0.25 }
1320
+ }
1321
+ },
1322
+ "outputs": { "outputT": { "dtype": "float16", "shape": [2, 4, 8], "tolerance": 0.004, "relTolerance": 0.01 } }
1323
+ }
1324
+ ]
1325
+ }