| { |
| "domain": "com.microsoft", |
| "name": "EmbedLayerNormalization", |
| "sinceVersion": 1, |
| "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.", |
| "inputs": [ |
| { |
| "role": "input_ids", |
| "dtype": "T1", |
| "rank": 2, |
| "description": "Word ids of shape `(batch_size, sequence_length)`." |
| }, |
| { |
| "role": "segment_ids", |
| "dtype": "T1", |
| "rank": 2, |
| "optional": true, |
| "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." |
| }, |
| { |
| "role": "word_embedding", |
| "dtype": "T", |
| "rank": 2, |
| "description": "Non-empty word embedding table `(vocab, hidden_size)`. Every `input_ids` value must be a valid non-negative row index." |
| }, |
| { |
| "role": "position_embedding", |
| "dtype": "T", |
| "rank": 2, |
| "description": "Non-empty position embedding table `(max_positions, hidden_size)`. Without `position_ids`, it must contain at least `sequence_length` rows." |
| }, |
| { |
| "role": "segment_embedding", |
| "dtype": "T", |
| "rank": 2, |
| "optional": true, |
| "description": "Non-empty segment embedding table `(segments, hidden_size)`. If `segment_ids` is absent, row 0 is used for every token." |
| }, |
| { "role": "gamma", "dtype": "T", "rank": 1, "description": "Layer-normalization scale of shape `(hidden_size)`." }, |
| { "role": "beta", "dtype": "T", "rank": 1, "description": "Layer-normalization bias of shape `(hidden_size)`." }, |
| { |
| "role": "mask", |
| "dtype": "T1", |
| "rank": 2, |
| "optional": true, |
| "description": "Attention mask of shape `(batch_size, sequence_length)`. Only used to produce `mask_index`." |
| }, |
| { |
| "role": "position_ids", |
| "dtype": "T1", |
| "rank": 2, |
| "optional": true, |
| "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." |
| } |
| ], |
| "outputs": [ |
| { |
| "role": "output", |
| "dtype": "T", |
| "rank": 3, |
| "shape": "[dim(shapes.inputIdsT, 0), dim(shapes.inputIdsT, 1), hidden]", |
| "description": "Normalized embeddings of shape `(batch_size, sequence_length, hidden_size)`." |
| }, |
| { |
| "role": "mask_index", |
| "dtype": "T1", |
| "rank": 1, |
| "optional": true, |
| "shape": "[dim(shapes.inputIdsT, 0)]", |
| "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." |
| }, |
| { |
| "role": "embedding_sum", |
| "dtype": "T", |
| "rank": 3, |
| "optional": true, |
| "shape": "[dim(shapes.inputIdsT, 0), dim(shapes.inputIdsT, 1), hidden]", |
| "description": "The summed embeddings before normalization, including the segment term when present. Float16 uses staged `(word + segment) + position`; float32 uses `(word + position) + segment`." |
| } |
| ], |
| "attributes": { "epsilon": 9.999999960041972e-13 }, |
| "attributeDescriptions": { |
| "epsilon": "Non-negative epsilon added to the layer-normalization variance before taking the square root.", |
| "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." |
| }, |
| "attributeConstraints": { "mask_index_type": { "values": [0, 1] } }, |
| "typeConstraints": { "T": ["float32", "float16"], "T1": ["int32"] }, |
| "args": { |
| "inputIdsT": { "kind": "tensor", "semantic": "input_ids", "role": "input", "dtype": "int32" }, |
| "segmentIdsT": { "kind": "tensor", "semantic": "segment_ids", "role": "input", "dtype": "int32", "required": false }, |
| "wordEmbeddingT": { "kind": "tensor", "semantic": "word_embedding", "role": "weights" }, |
| "positionEmbeddingT": { "kind": "tensor", "semantic": "position_embedding", "role": "weights" }, |
| "segmentEmbeddingT": { "kind": "tensor", "semantic": "segment_embedding", "role": "weights", "required": false }, |
| "gammaT": { "kind": "tensor", "semantic": "gamma", "role": "weights" }, |
| "betaT": { "kind": "tensor", "semantic": "beta", "role": "weights" }, |
| "maskT": { "kind": "tensor", "semantic": "mask", "role": "input", "dtype": "int32", "required": false }, |
| "positionIdsT": { |
| "kind": "tensor", |
| "semantic": "position_ids", |
| "role": "input", |
| "dtype": "int32", |
| "required": false |
| }, |
| "outputT": { "kind": "tensor", "semantic": "output", "role": "output" }, |
| "maskIndexT": { "kind": "tensor", "semantic": "mask_index", "role": "output", "dtype": "int32", "required": false }, |
| "embeddingSumT": { "kind": "tensor", "semantic": "embedding_sum", "role": "output", "required": false } |
| }, |
| "tunables": { "WORKGROUP_SIZE": 128, "MASK_WORKGROUP_SIZE": 64 }, |
| "derive": { |
| "batchSize": "dim(shapes.inputIdsT, 0)", |
| "sequenceLength": "dim(shapes.inputIdsT, 1)", |
| "tokens": "batchSize * sequenceLength", |
| "hidden": "dim(shapes.wordEmbeddingT, 1)", |
| "epsilonValue": "attrs.epsilon", |
| "epsilonOk": "epsilonValue >= 0", |
| "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", |
| "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)", |
| "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)", |
| "broadcastPositionIds": "dim(shapes.positionIdsT, 0) == 1 if present.positionIdsT else false", |
| "maskContract": "ranks.maskT == 2 and sameShape(shapes.maskT, shapes.inputIdsT) if present.maskT else true", |
| "maskIndexTypeOk": "not has(attrs, \"mask_index_type\") or attrs.mask_index_type == 0 or attrs.mask_index_type == 1", |
| "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)", |
| "embeddingSumContract": "ranks.embeddingSumT == 3 and sameShape(shapes.embeddingSumT, shapes.outputT) and tensorDtypes.embeddingSumT == tensorDtypes.wordEmbeddingT if present.embeddingSumT else true", |
| "maskIndexShapeOk": "ranks.maskIndexT == 1 and dim(shapes.maskIndexT, 0) == batchSize if present.maskIndexT else true", |
| "embedContractOk": "epsilonOk and tableShapeOk and segmentContract and positionIdsContract and maskContract and maskIndexTypeOk and ioShapeOk and embeddingSumContract and maskIndexShapeOk and batchSize > 0 and sequenceLength > 0", |
| "dispatchFits": "tunables.WORKGROUP_SIZE <= device.limits.maxComputeInvocationsPerWorkgroup and tunables.MASK_WORKGROUP_SIZE <= device.limits.maxComputeInvocationsPerWorkgroup" |
| }, |
| "constants": { |
| "aScalar": "dtypes.T", |
| "scalar": "dtypes.T", |
| "usesF16": "dtypes.T == \"f16\"", |
| "hidden": "hidden", |
| "sequenceLength": "sequenceLength", |
| "epsilon": "epsilonValue", |
| "workgroupSize": "tunables.WORKGROUP_SIZE", |
| "maskWorkgroupSize": "tunables.MASK_WORKGROUP_SIZE", |
| "wordRows": "dim(shapes.wordEmbeddingT, 0)", |
| "positionRows": "dim(shapes.positionEmbeddingT, 0)", |
| "segmentRows": "dim(shapes.segmentEmbeddingT, 0) if present.segmentEmbeddingT else 1", |
| "hasSegment": "present.segmentEmbeddingT", |
| "hasSegmentIds": "present.segmentIdsT", |
| "hasPositionIds": "present.positionIdsT", |
| "broadcastPositionIds": "broadcastPositionIds", |
| "writeEmbeddingSum": "present.embeddingSumT", |
| "hasMask": "present.maskT", |
| "HIDDEN_LEN": "hidden" |
| }, |
| "bindingSets": { |
| "embed_noseg_nopos_nosum": [ |
| { |
| "name": "input_ids", |
| "arg": "inputIdsT", |
| "semantic": "input_ids", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "word_embedding", |
| "arg": "wordEmbeddingT", |
| "semantic": "word_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "position_embedding", |
| "arg": "positionEmbeddingT", |
| "semantic": "position_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "output", |
| "arg": "outputT", |
| "semantic": "output", |
| "buffer": { "type": "storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "params", |
| "semantic": "kernel.params", |
| "buffer": { "type": "uniform" }, |
| "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] } |
| } |
| ], |
| "embed_noseg_nopos_sum": [ |
| { |
| "name": "input_ids", |
| "arg": "inputIdsT", |
| "semantic": "input_ids", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "word_embedding", |
| "arg": "wordEmbeddingT", |
| "semantic": "word_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "position_embedding", |
| "arg": "positionEmbeddingT", |
| "semantic": "position_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "output", |
| "arg": "outputT", |
| "semantic": "output", |
| "buffer": { "type": "storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "embedding_sum", |
| "arg": "embeddingSumT", |
| "semantic": "embedding_sum", |
| "buffer": { "type": "storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "params", |
| "semantic": "kernel.params", |
| "buffer": { "type": "uniform" }, |
| "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] } |
| } |
| ], |
| "embed_noseg_posids_nosum": [ |
| { |
| "name": "input_ids", |
| "arg": "inputIdsT", |
| "semantic": "input_ids", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "position_ids", |
| "arg": "positionIdsT", |
| "semantic": "position_ids", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "word_embedding", |
| "arg": "wordEmbeddingT", |
| "semantic": "word_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "position_embedding", |
| "arg": "positionEmbeddingT", |
| "semantic": "position_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "output", |
| "arg": "outputT", |
| "semantic": "output", |
| "buffer": { "type": "storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "params", |
| "semantic": "kernel.params", |
| "buffer": { "type": "uniform" }, |
| "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] } |
| } |
| ], |
| "embed_noseg_posids_sum": [ |
| { |
| "name": "input_ids", |
| "arg": "inputIdsT", |
| "semantic": "input_ids", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "position_ids", |
| "arg": "positionIdsT", |
| "semantic": "position_ids", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "word_embedding", |
| "arg": "wordEmbeddingT", |
| "semantic": "word_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "position_embedding", |
| "arg": "positionEmbeddingT", |
| "semantic": "position_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "output", |
| "arg": "outputT", |
| "semantic": "output", |
| "buffer": { "type": "storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "embedding_sum", |
| "arg": "embeddingSumT", |
| "semantic": "embedding_sum", |
| "buffer": { "type": "storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "params", |
| "semantic": "kernel.params", |
| "buffer": { "type": "uniform" }, |
| "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] } |
| } |
| ], |
| "embed_segdefault_nopos_nosum": [ |
| { |
| "name": "input_ids", |
| "arg": "inputIdsT", |
| "semantic": "input_ids", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "word_embedding", |
| "arg": "wordEmbeddingT", |
| "semantic": "word_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "position_embedding", |
| "arg": "positionEmbeddingT", |
| "semantic": "position_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "segment_embedding", |
| "arg": "segmentEmbeddingT", |
| "semantic": "segment_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "output", |
| "arg": "outputT", |
| "semantic": "output", |
| "buffer": { "type": "storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "params", |
| "semantic": "kernel.params", |
| "buffer": { "type": "uniform" }, |
| "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] } |
| } |
| ], |
| "embed_segdefault_nopos_sum": [ |
| { |
| "name": "input_ids", |
| "arg": "inputIdsT", |
| "semantic": "input_ids", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "word_embedding", |
| "arg": "wordEmbeddingT", |
| "semantic": "word_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "position_embedding", |
| "arg": "positionEmbeddingT", |
| "semantic": "position_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "segment_embedding", |
| "arg": "segmentEmbeddingT", |
| "semantic": "segment_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "output", |
| "arg": "outputT", |
| "semantic": "output", |
| "buffer": { "type": "storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "embedding_sum", |
| "arg": "embeddingSumT", |
| "semantic": "embedding_sum", |
| "buffer": { "type": "storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "params", |
| "semantic": "kernel.params", |
| "buffer": { "type": "uniform" }, |
| "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] } |
| } |
| ], |
| "embed_segdefault_posids_nosum": [ |
| { |
| "name": "input_ids", |
| "arg": "inputIdsT", |
| "semantic": "input_ids", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "position_ids", |
| "arg": "positionIdsT", |
| "semantic": "position_ids", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "word_embedding", |
| "arg": "wordEmbeddingT", |
| "semantic": "word_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "position_embedding", |
| "arg": "positionEmbeddingT", |
| "semantic": "position_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "segment_embedding", |
| "arg": "segmentEmbeddingT", |
| "semantic": "segment_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "output", |
| "arg": "outputT", |
| "semantic": "output", |
| "buffer": { "type": "storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "params", |
| "semantic": "kernel.params", |
| "buffer": { "type": "uniform" }, |
| "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] } |
| } |
| ], |
| "embed_segdefault_posids_sum": [ |
| { |
| "name": "input_ids", |
| "arg": "inputIdsT", |
| "semantic": "input_ids", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "position_ids", |
| "arg": "positionIdsT", |
| "semantic": "position_ids", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "word_embedding", |
| "arg": "wordEmbeddingT", |
| "semantic": "word_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "position_embedding", |
| "arg": "positionEmbeddingT", |
| "semantic": "position_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "segment_embedding", |
| "arg": "segmentEmbeddingT", |
| "semantic": "segment_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "output", |
| "arg": "outputT", |
| "semantic": "output", |
| "buffer": { "type": "storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "embedding_sum", |
| "arg": "embeddingSumT", |
| "semantic": "embedding_sum", |
| "buffer": { "type": "storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "params", |
| "semantic": "kernel.params", |
| "buffer": { "type": "uniform" }, |
| "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] } |
| } |
| ], |
| "embed_seg_nopos_nosum": [ |
| { |
| "name": "input_ids", |
| "arg": "inputIdsT", |
| "semantic": "input_ids", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "segment_ids", |
| "arg": "segmentIdsT", |
| "semantic": "segment_ids", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "word_embedding", |
| "arg": "wordEmbeddingT", |
| "semantic": "word_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "position_embedding", |
| "arg": "positionEmbeddingT", |
| "semantic": "position_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "segment_embedding", |
| "arg": "segmentEmbeddingT", |
| "semantic": "segment_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "output", |
| "arg": "outputT", |
| "semantic": "output", |
| "buffer": { "type": "storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "params", |
| "semantic": "kernel.params", |
| "buffer": { "type": "uniform" }, |
| "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] } |
| } |
| ], |
| "embed_seg_nopos_sum": [ |
| { |
| "name": "input_ids", |
| "arg": "inputIdsT", |
| "semantic": "input_ids", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "segment_ids", |
| "arg": "segmentIdsT", |
| "semantic": "segment_ids", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "word_embedding", |
| "arg": "wordEmbeddingT", |
| "semantic": "word_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "position_embedding", |
| "arg": "positionEmbeddingT", |
| "semantic": "position_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "segment_embedding", |
| "arg": "segmentEmbeddingT", |
| "semantic": "segment_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "output", |
| "arg": "outputT", |
| "semantic": "output", |
| "buffer": { "type": "storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "embedding_sum", |
| "arg": "embeddingSumT", |
| "semantic": "embedding_sum", |
| "buffer": { "type": "storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "params", |
| "semantic": "kernel.params", |
| "buffer": { "type": "uniform" }, |
| "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] } |
| } |
| ], |
| "embed_seg_posids_nosum": [ |
| { |
| "name": "input_ids", |
| "arg": "inputIdsT", |
| "semantic": "input_ids", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "segment_ids", |
| "arg": "segmentIdsT", |
| "semantic": "segment_ids", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "position_ids", |
| "arg": "positionIdsT", |
| "semantic": "position_ids", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "word_embedding", |
| "arg": "wordEmbeddingT", |
| "semantic": "word_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "position_embedding", |
| "arg": "positionEmbeddingT", |
| "semantic": "position_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "segment_embedding", |
| "arg": "segmentEmbeddingT", |
| "semantic": "segment_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "output", |
| "arg": "outputT", |
| "semantic": "output", |
| "buffer": { "type": "storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "params", |
| "semantic": "kernel.params", |
| "buffer": { "type": "uniform" }, |
| "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] } |
| } |
| ], |
| "embed_seg_posids_sum": [ |
| { |
| "name": "input_ids", |
| "arg": "inputIdsT", |
| "semantic": "input_ids", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "segment_ids", |
| "arg": "segmentIdsT", |
| "semantic": "segment_ids", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "position_ids", |
| "arg": "positionIdsT", |
| "semantic": "position_ids", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "word_embedding", |
| "arg": "wordEmbeddingT", |
| "semantic": "word_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "position_embedding", |
| "arg": "positionEmbeddingT", |
| "semantic": "position_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "segment_embedding", |
| "arg": "segmentEmbeddingT", |
| "semantic": "segment_embedding", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "output", |
| "arg": "outputT", |
| "semantic": "output", |
| "buffer": { "type": "storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "embedding_sum", |
| "arg": "embeddingSumT", |
| "semantic": "embedding_sum", |
| "buffer": { "type": "storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "params", |
| "semantic": "kernel.params", |
| "buffer": { "type": "uniform" }, |
| "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] } |
| } |
| ], |
| "normalizeSet": [ |
| { |
| "name": "output", |
| "arg": "outputT", |
| "semantic": "output", |
| "buffer": { "type": "storage" }, |
| "elementType": "$aScalar" |
| }, |
| { |
| "name": "gamma", |
| "arg": "gammaT", |
| "semantic": "gamma", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar", |
| "length": "$HIDDEN_LEN" |
| }, |
| { |
| "name": "beta", |
| "arg": "betaT", |
| "semantic": "beta", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "$aScalar", |
| "length": "$HIDDEN_LEN" |
| }, |
| { |
| "name": "params", |
| "semantic": "kernel.params", |
| "buffer": { "type": "uniform" }, |
| "struct": { "name": "Params", "fields": [{ "name": "tokens", "type": "u32", "value": "tokens" }] } |
| } |
| ], |
| "maskIndexSet": [ |
| { |
| "name": "mask", |
| "arg": "maskT", |
| "semantic": "mask", |
| "buffer": { "type": "read-only-storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "mask_index", |
| "arg": "maskIndexT", |
| "semantic": "mask_index", |
| "buffer": { "type": "storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "params", |
| "semantic": "kernel.params", |
| "buffer": { "type": "uniform" }, |
| "struct": { "name": "Params", "fields": [{ "name": "batch", "type": "u32", "value": "batchSize" }] } |
| } |
| ], |
| "zeroMaskIndexSet": [ |
| { |
| "name": "mask_index", |
| "arg": "maskIndexT", |
| "semantic": "mask_index", |
| "buffer": { "type": "storage" }, |
| "elementType": "i32" |
| }, |
| { |
| "name": "params", |
| "semantic": "kernel.params", |
| "buffer": { "type": "uniform" }, |
| "struct": { "name": "Params", "fields": [{ "name": "batch", "type": "u32", "value": "batchSize" }] } |
| } |
| ] |
| }, |
| "variants": [ |
| { |
| "id": "noseg_nopos_nosum_nomask", |
| "when": ["embedContractOk", "dispatchFits", "not present.segmentEmbeddingT", "not present.positionIdsT", "not present.embeddingSumT", "not present.maskIndexT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_noseg_nopos_nosum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| } |
| ] |
| }, |
| { |
| "id": "noseg_nopos_nosum_mask", |
| "when": ["embedContractOk", "dispatchFits", "not present.segmentEmbeddingT", "not present.positionIdsT", "not present.embeddingSumT", "present.maskIndexT", "present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_noseg_nopos_nosum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.MaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "maskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "noseg_nopos_sum_nomask", |
| "when": ["embedContractOk", "dispatchFits", "not present.segmentEmbeddingT", "not present.positionIdsT", "present.embeddingSumT", "not present.maskIndexT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_noseg_nopos_sum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| } |
| ] |
| }, |
| { |
| "id": "noseg_nopos_sum_mask", |
| "when": ["embedContractOk", "dispatchFits", "not present.segmentEmbeddingT", "not present.positionIdsT", "present.embeddingSumT", "present.maskIndexT", "present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_noseg_nopos_sum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.MaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "maskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "noseg_posids_nosum_nomask", |
| "when": ["embedContractOk", "dispatchFits", "not present.segmentEmbeddingT", "present.positionIdsT", "not present.embeddingSumT", "not present.maskIndexT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_noseg_posids_nosum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| } |
| ] |
| }, |
| { |
| "id": "noseg_posids_nosum_mask", |
| "when": ["embedContractOk", "dispatchFits", "not present.segmentEmbeddingT", "present.positionIdsT", "not present.embeddingSumT", "present.maskIndexT", "present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_noseg_posids_nosum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.MaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "maskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "noseg_posids_sum_nomask", |
| "when": ["embedContractOk", "dispatchFits", "not present.segmentEmbeddingT", "present.positionIdsT", "present.embeddingSumT", "not present.maskIndexT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_noseg_posids_sum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| } |
| ] |
| }, |
| { |
| "id": "noseg_posids_sum_mask", |
| "when": ["embedContractOk", "dispatchFits", "not present.segmentEmbeddingT", "present.positionIdsT", "present.embeddingSumT", "present.maskIndexT", "present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_noseg_posids_sum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.MaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "maskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "seg_nopos_nosum_nomask", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "present.segmentIdsT", "not present.positionIdsT", "not present.embeddingSumT", "not present.maskIndexT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_seg_nopos_nosum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| } |
| ] |
| }, |
| { |
| "id": "seg_nopos_nosum_mask", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "present.segmentIdsT", "not present.positionIdsT", "not present.embeddingSumT", "present.maskIndexT", "present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_seg_nopos_nosum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.MaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "maskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "seg_nopos_sum_nomask", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "present.segmentIdsT", "not present.positionIdsT", "present.embeddingSumT", "not present.maskIndexT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_seg_nopos_sum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| } |
| ] |
| }, |
| { |
| "id": "seg_nopos_sum_mask", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "present.segmentIdsT", "not present.positionIdsT", "present.embeddingSumT", "present.maskIndexT", "present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_seg_nopos_sum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.MaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "maskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "seg_posids_nosum_nomask", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "present.segmentIdsT", "present.positionIdsT", "not present.embeddingSumT", "not present.maskIndexT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_seg_posids_nosum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| } |
| ] |
| }, |
| { |
| "id": "seg_posids_nosum_mask", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "present.segmentIdsT", "present.positionIdsT", "not present.embeddingSumT", "present.maskIndexT", "present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_seg_posids_nosum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.MaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "maskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "seg_posids_sum_nomask", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "present.segmentIdsT", "present.positionIdsT", "present.embeddingSumT", "not present.maskIndexT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_seg_posids_sum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| } |
| ] |
| }, |
| { |
| "id": "seg_posids_sum_mask", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "present.segmentIdsT", "present.positionIdsT", "present.embeddingSumT", "present.maskIndexT", "present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_seg_posids_sum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.MaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "maskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "segdefault_nopos_nosum_nomask", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "not present.segmentIdsT", "present.positionIdsT == (\"nopos\" == \"posids\")", "present.embeddingSumT == (\"nosum\" == \"sum\")", "not present.maskIndexT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_segdefault_nopos_nosum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| } |
| ] |
| }, |
| { |
| "id": "segdefault_nopos_nosum_mask", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "not present.segmentIdsT", "present.positionIdsT == (\"nopos\" == \"posids\")", "present.embeddingSumT == (\"nosum\" == \"sum\")", "present.maskIndexT", "present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_segdefault_nopos_nosum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.MaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "maskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "segdefault_nopos_sum_nomask", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "not present.segmentIdsT", "present.positionIdsT == (\"nopos\" == \"posids\")", "present.embeddingSumT == (\"sum\" == \"sum\")", "not present.maskIndexT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_segdefault_nopos_sum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| } |
| ] |
| }, |
| { |
| "id": "segdefault_nopos_sum_mask", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "not present.segmentIdsT", "present.positionIdsT == (\"nopos\" == \"posids\")", "present.embeddingSumT == (\"sum\" == \"sum\")", "present.maskIndexT", "present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_segdefault_nopos_sum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.MaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "maskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "segdefault_posids_nosum_nomask", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "not present.segmentIdsT", "present.positionIdsT == (\"posids\" == \"posids\")", "present.embeddingSumT == (\"nosum\" == \"sum\")", "not present.maskIndexT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_segdefault_posids_nosum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| } |
| ] |
| }, |
| { |
| "id": "segdefault_posids_nosum_mask", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "not present.segmentIdsT", "present.positionIdsT == (\"posids\" == \"posids\")", "present.embeddingSumT == (\"nosum\" == \"sum\")", "present.maskIndexT", "present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_segdefault_posids_nosum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.MaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "maskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "segdefault_posids_sum_nomask", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "not present.segmentIdsT", "present.positionIdsT == (\"posids\" == \"posids\")", "present.embeddingSumT == (\"sum\" == \"sum\")", "not present.maskIndexT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_segdefault_posids_sum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| } |
| ] |
| }, |
| { |
| "id": "segdefault_posids_sum_mask", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT", "not present.segmentIdsT", "present.positionIdsT == (\"posids\" == \"posids\")", "present.embeddingSumT == (\"sum\" == \"sum\")", "present.maskIndexT", "present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_segdefault_posids_sum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.MaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "maskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "noseg_nopos_nosum_mask_without_input", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"noseg\" != \"noseg\")", "present.segmentIdsT == (\"noseg\" == \"seg\")", "present.positionIdsT == (\"nopos\" == \"posids\")", "present.embeddingSumT == (\"nosum\" == \"sum\")", "present.maskIndexT", "not present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_noseg_nopos_nosum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.ZeroMaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "zeroMaskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "noseg_nopos_sum_mask_without_input", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"noseg\" != \"noseg\")", "present.segmentIdsT == (\"noseg\" == \"seg\")", "present.positionIdsT == (\"nopos\" == \"posids\")", "present.embeddingSumT == (\"sum\" == \"sum\")", "present.maskIndexT", "not present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_noseg_nopos_sum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.ZeroMaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "zeroMaskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "noseg_posids_nosum_mask_without_input", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"noseg\" != \"noseg\")", "present.segmentIdsT == (\"noseg\" == \"seg\")", "present.positionIdsT == (\"posids\" == \"posids\")", "present.embeddingSumT == (\"nosum\" == \"sum\")", "present.maskIndexT", "not present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_noseg_posids_nosum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.ZeroMaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "zeroMaskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "noseg_posids_sum_mask_without_input", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"noseg\" != \"noseg\")", "present.segmentIdsT == (\"noseg\" == \"seg\")", "present.positionIdsT == (\"posids\" == \"posids\")", "present.embeddingSumT == (\"sum\" == \"sum\")", "present.maskIndexT", "not present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_noseg_posids_sum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.ZeroMaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "zeroMaskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "segdefault_nopos_nosum_mask_without_input", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"segdefault\" != \"noseg\")", "present.segmentIdsT == (\"segdefault\" == \"seg\")", "present.positionIdsT == (\"nopos\" == \"posids\")", "present.embeddingSumT == (\"nosum\" == \"sum\")", "present.maskIndexT", "not present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_segdefault_nopos_nosum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.ZeroMaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "zeroMaskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "segdefault_nopos_sum_mask_without_input", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"segdefault\" != \"noseg\")", "present.segmentIdsT == (\"segdefault\" == \"seg\")", "present.positionIdsT == (\"nopos\" == \"posids\")", "present.embeddingSumT == (\"sum\" == \"sum\")", "present.maskIndexT", "not present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_segdefault_nopos_sum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.ZeroMaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "zeroMaskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "segdefault_posids_nosum_mask_without_input", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"segdefault\" != \"noseg\")", "present.segmentIdsT == (\"segdefault\" == \"seg\")", "present.positionIdsT == (\"posids\" == \"posids\")", "present.embeddingSumT == (\"nosum\" == \"sum\")", "present.maskIndexT", "not present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_segdefault_posids_nosum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.ZeroMaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "zeroMaskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "segdefault_posids_sum_mask_without_input", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"segdefault\" != \"noseg\")", "present.segmentIdsT == (\"segdefault\" == \"seg\")", "present.positionIdsT == (\"posids\" == \"posids\")", "present.embeddingSumT == (\"sum\" == \"sum\")", "present.maskIndexT", "not present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_segdefault_posids_sum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.ZeroMaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "zeroMaskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "seg_nopos_nosum_mask_without_input", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"seg\" != \"noseg\")", "present.segmentIdsT == (\"seg\" == \"seg\")", "present.positionIdsT == (\"nopos\" == \"posids\")", "present.embeddingSumT == (\"nosum\" == \"sum\")", "present.maskIndexT", "not present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_seg_nopos_nosum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.ZeroMaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "zeroMaskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "seg_nopos_sum_mask_without_input", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"seg\" != \"noseg\")", "present.segmentIdsT == (\"seg\" == \"seg\")", "present.positionIdsT == (\"nopos\" == \"posids\")", "present.embeddingSumT == (\"sum\" == \"sum\")", "present.maskIndexT", "not present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_seg_nopos_sum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.ZeroMaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "zeroMaskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "seg_posids_nosum_mask_without_input", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"seg\" != \"noseg\")", "present.segmentIdsT == (\"seg\" == \"seg\")", "present.positionIdsT == (\"posids\" == \"posids\")", "present.embeddingSumT == (\"nosum\" == \"sum\")", "present.maskIndexT", "not present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_seg_posids_nosum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.ZeroMaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "zeroMaskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| }, |
| { |
| "id": "seg_posids_sum_mask_without_input", |
| "when": ["embedContractOk", "dispatchFits", "present.segmentEmbeddingT == (\"seg\" != \"noseg\")", "present.segmentIdsT == (\"seg\" == \"seg\")", "present.positionIdsT == (\"posids\" == \"posids\")", "present.embeddingSumT == (\"sum\" == \"sum\")", "present.maskIndexT", "not present.maskT"], |
| "passes": [ |
| { |
| "id": "sum", |
| "name": "EmbedLayerNormalization.EmbeddingSum", |
| "shader": "embed-sum.wgsl.jinja", |
| "bindings": "embed_seg_posids_sum", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "normalize", |
| "name": "EmbedLayerNormalization.Normalize", |
| "shader": "embed-normalize.wgsl.jinja", |
| "bindings": "normalizeSet", |
| "dispatch": { "workgroups": "tokens" } |
| }, |
| { |
| "id": "maskIndex", |
| "name": "EmbedLayerNormalization.ZeroMaskIndex", |
| "shader": "embed-mask-index.wgsl.jinja", |
| "bindings": "zeroMaskIndexSet", |
| "dispatch": { "threads": "batchSize", "workgroupSize": "tunables.MASK_WORKGROUP_SIZE" } |
| } |
| ] |
| } |
| ] |
| } |
|
|