{ "domain": "com.microsoft", "name": "FusedConv", "sinceVersion": 1, "description": "Applies an N-dimensional convolution with optional bias `B` and residual `Z`, followed by an optional fused activation. Omitting `activation` leaves the convolution result unchanged. Supported activations are `Relu`, `LeakyRelu`, `Sigmoid`, `Tanh`, `HardSigmoid`, `HardSwish`, and `Clip`; other schema-permitted activation strings are not implemented. The implementation supports one to three spatial dimensions and float16 or float32; higher spatial ranks and float64 are not implemented.", "inputs": [ { "role": "X", "dtype": "T", "description": "Input data tensor of shape `(N, C, D1, ..., Dn)` for one to three spatial dimensions." }, { "role": "W", "dtype": "T", "description": "Convolution filter tensor of shape `(M, C/group, k1, ..., kn)`, with the same spatial rank as `X`." }, { "role": "B", "dtype": "T", "rank": 1, "optional": true, "description": "Optional 1-D bias tensor of length `out_channels`, broadcast-added to each output channel." }, { "role": "Z", "dtype": "T", "rank": "ranks.X", "optional": true, "description": "Optional residual tensor with the same shape as the output `Y`, added before the activation." } ], "outputs": [ { "role": "Y", "dtype": "T", "rank": "ranks.X", "shape": "[dim(shapes.X, 0), dim(shapes.W, 0), expectedOutputWidth] if ranks.X == 3 else ([dim(shapes.X, 0), dim(shapes.W, 0), expectedOutputHeight, expectedOutputWidth] if ranks.X == 4 else [dim(shapes.X, 0), dim(shapes.W, 0), expectedOutputDepth, expectedOutputHeight, expectedOutputWidth])", "description": "Output feature map tensor after convolution, optional bias/residual addition, and the fused activation." } ], "attributes": { "auto_pad": "NOTSET", "group": 1 }, "attributeDescriptions": { "activation": "Optional fused activation name: `Relu`, `LeakyRelu`, `Sigmoid`, `Tanh`, `HardSigmoid`, `HardSwish`, or `Clip`. Omission applies no activation.", "activation_params": "Positional parameters for the fused activation: exactly `[alpha]` is required for `LeakyRelu`, and exactly `[alpha, beta]` or `[min, max]` is required for `HardSigmoid` or `Clip`, respectively. Parameter-free activations ignore this attribute.", "auto_pad": "Automatic padding mode. `NOTSET` uses `pads`; `SAME_UPPER` and `SAME_LOWER` choose padding so each output spatial size is `ceil(input / stride)`; `VALID` uses no padding.", "dilations": "Optional dilation factors, one positive integer per spatial axis. Omission means all ones.", "group": "Number of groups that input and output channels are split into; defaults to 1.", "kernel_shape": "Optional kernel shape, one positive integer per spatial axis. When present, it must match the spatial dimensions of the weight tensor; omission infers the shape from the weights.", "pads": "Optional explicit padding in ONNX order `[begin_axis_0, ..., begin_axis_n, end_axis_0, ..., end_axis_n]`. Omission means all zeros; it cannot be combined with an automatic padding mode.", "strides": "Optional stride factors, one positive integer per spatial axis. Omission means all ones." }, "attributeConstraints": { "activation": { "values": ["Relu", "LeakyRelu", "Sigmoid", "Tanh", "HardSigmoid", "HardSwish", "Clip"] }, "auto_pad": { "values": ["NOTSET", "SAME_UPPER", "SAME_LOWER", "VALID"] } }, "typeConstraints": { "T": ["float32", "float16"] }, "args": { "x": { "kind": "tensor", "semantic": "X", "role": "input" }, "w": { "kind": "tensor", "semantic": "W", "role": "input" }, "bias": { "kind": "tensor", "semantic": "B", "role": "input", "required": false }, "y": { "kind": "tensor", "semantic": "Y", "role": "output" }, "zResidual": { "kind": "tensor", "semantic": "Z", "role": "input", "required": false } }, "tunables": { "WORKGROUP_SIZE": 256, "CONV1D_WG_X": 16, "CONV1D_WG_Y": 16, "CONV1D_K_TILE": 16, "CONV1D_TILE_M": 4, "CONV1D_TILE_N": 4, "CONV1D_REG_MIN_TILE_COUNT": 32, "CONV1D_REG_MIN_KERNEL_ROWS": 32, "GROUPED_MIN_KERNEL_SIZE": 3, "GROUPED_MAX_KERNEL_SIZE": 11, "GROUPED_SCALAR_OC_MAX_KERNEL_SIZE": 9, "GROUPED_WIDE_WORKGROUP_SIZE": 64, "GROUPED_MAX_REGISTER_SPAN": 64 }, "derive": { "inputHeight": "dim(shapes.X, 3) if ranks.X == 5 else (dim(shapes.X, 2) if ranks.X == 4 else 1)", "inputWidth": "dim(shapes.X, ranks.X - 1) if ranks.X >= 3 else 1", "kernelHeight": "dim(shapes.W, 3) if ranks.W == 5 else (dim(shapes.W, 2) if ranks.W == 4 else 1)", "kernelWidth": "dim(shapes.W, ranks.W - 1) if ranks.W >= 3 else 1", "inputDepth": "dim(shapes.X, 2) if ranks.X == 5 else 1", "outputDepth": "dim(shapes.Y, 2) if ranks.Y == 5 else 1", "kernelDepth": "dim(shapes.W, 2) if ranks.W == 5 else 1", "outputHeight": "dim(shapes.Y, 3) if ranks.Y == 5 else (dim(shapes.Y, 2) if ranks.Y == 4 else 1)", "outputWidth": "dim(shapes.Y, ranks.Y - 1) if ranks.Y >= 3 else 1", "spatialRank": "ranks.W - 2", "kernelShapeLengthOk": "not has(attrs, \"kernel_shape\") or (attrs.kernel_shape | length) == spatialRank", "stridesLengthOk": "not has(attrs, \"strides\") or (attrs.strides | length) == spatialRank", "dilationsLengthOk": "not has(attrs, \"dilations\") or (attrs.dilations | length) == spatialRank", "padsLengthOk": "not has(attrs, \"pads\") or (attrs.pads | length) == 2 * spatialRank", "kernelD": "attrs.kernel_shape[0] if kernelShapeLengthOk and has(attrs, \"kernel_shape\") and spatialRank == 3 else 1", "kernelH": "attrs.kernel_shape[spatialRank - 2] if kernelShapeLengthOk and has(attrs, \"kernel_shape\") and spatialRank >= 2 else 1", "kernelW": "attrs.kernel_shape[spatialRank - 1] if kernelShapeLengthOk and has(attrs, \"kernel_shape\") and spatialRank >= 1 else 1", "strideD": "attrs.strides[0] if stridesLengthOk and has(attrs, \"strides\") and spatialRank == 3 else 1", "strideH": "attrs.strides[spatialRank - 2] if stridesLengthOk and has(attrs, \"strides\") and spatialRank >= 2 else 1", "strideW": "attrs.strides[spatialRank - 1] if stridesLengthOk and has(attrs, \"strides\") and spatialRank >= 1 else 1", "dilationD": "attrs.dilations[0] if dilationsLengthOk and has(attrs, \"dilations\") and spatialRank == 3 else 1", "dilationH": "attrs.dilations[spatialRank - 2] if dilationsLengthOk and has(attrs, \"dilations\") and spatialRank >= 2 else 1", "dilationW": "attrs.dilations[spatialRank - 1] if dilationsLengthOk and has(attrs, \"dilations\") and spatialRank >= 1 else 1", "padFront": "attrs.pads[0] if padsLengthOk and has(attrs, \"pads\") and spatialRank == 3 else 0", "padTop": "attrs.pads[spatialRank - 2] if padsLengthOk and has(attrs, \"pads\") and spatialRank >= 2 else 0", "padLeft": "attrs.pads[spatialRank - 1] if padsLengthOk and has(attrs, \"pads\") and spatialRank >= 1 else 0", "padBack": "attrs.pads[spatialRank] if padsLengthOk and has(attrs, \"pads\") and spatialRank == 3 else 0", "padBottom": "attrs.pads[2 * spatialRank - 2] if padsLengthOk and has(attrs, \"pads\") and spatialRank >= 2 else 0", "padRight": "attrs.pads[2 * spatialRank - 1] if padsLengthOk and has(attrs, \"pads\") and spatialRank >= 1 else 0", "deviceWorkgroupCap": "min(device.limits.maxComputeInvocationsPerWorkgroup, device.limits.maxComputeWorkgroupSizeX)", "wave32Adapter": "has(device.adapterInfo, \"subgroupMinSize\") and has(device.adapterInfo, \"subgroupMaxSize\") and device.adapterInfo.subgroupMinSize == 32 and device.adapterInfo.subgroupMaxSize == 32", "canPinSubgroupSize32": "device.features.has(\"subgroups\") and device.features.has(\"subgroup-size-control\") and has(device.adapterInfo, \"subgroupMinSize\") and has(device.adapterInfo, \"subgroupMaxSize\") and device.adapterInfo.subgroupMinSize <= 32 and device.adapterInfo.subgroupMaxSize >= 32", "pinSubgroupSize32": "canPinSubgroupSize32 and not wave32Adapter", "wave32Effective": "wave32Adapter or pinSubgroupSize32", "autoPadSame": "attrs.auto_pad == \"SAME_UPPER\" or attrs.auto_pad == \"SAME_LOWER\"", "autoPadValid": "attrs.auto_pad == \"VALID\"", "samePadDepth": "max(0, (outputDepth - 1) * strideD + (kernelDepth - 1) * dilationD + 1 - inputDepth)", "samePadHeight": "max(0, (outputHeight - 1) * strideH + (kernelHeight - 1) * dilationH + 1 - inputHeight)", "samePadWidth": "max(0, (outputWidth - 1) * strideW + (kernelWidth - 1) * dilationW + 1 - inputWidth)", "samePadFront": "floor(samePadDepth / 2) if attrs.auto_pad == \"SAME_UPPER\" else samePadDepth - floor(samePadDepth / 2)", "samePadTop": "floor(samePadHeight / 2) if attrs.auto_pad == \"SAME_UPPER\" else samePadHeight - floor(samePadHeight / 2)", "samePadLeft": "floor(samePadWidth / 2) if attrs.auto_pad == \"SAME_UPPER\" else samePadWidth - floor(samePadWidth / 2)", "effectivePadFront": "samePadFront if autoPadSame else (0 if autoPadValid else padFront)", "effectivePadTop": "samePadTop if autoPadSame else (0 if autoPadValid else padTop)", "effectivePadLeft": "samePadLeft if autoPadSame else (0 if autoPadValid else padLeft)", "expectedOutputDepth": "ceil(inputDepth / strideD) if autoPadSame else floor((inputDepth + (0 if autoPadValid else padFront + padBack) - ((kernelDepth - 1) * dilationD + 1)) / strideD) + 1", "expectedOutputHeight": "ceil(inputHeight / strideH) if autoPadSame else floor((inputHeight + (0 if autoPadValid else padTop + padBottom) - ((kernelHeight - 1) * dilationH + 1)) / strideH) + 1", "expectedOutputWidth": "ceil(inputWidth / strideW) if autoPadSame else floor((inputWidth + (0 if autoPadValid else padLeft + padRight) - ((kernelWidth - 1) * dilationW + 1)) / strideW) + 1", "spatialAttributeLengthsOk": "kernelShapeLengthOk and stridesLengthOk and dilationsLengthOk and padsLengthOk", "kernelShapeMatchesWeights": "not has(attrs, \"kernel_shape\") or (kernelW == kernelWidth and (spatialRank < 2 or kernelH == kernelHeight) and (spatialRank < 3 or kernelD == kernelDepth))", "kernelExtentsOk": "kernelWidth >= 1 and (spatialRank < 2 or kernelHeight >= 1) and (spatialRank < 3 or kernelDepth >= 1)", "stridesValuesOk": "not has(attrs, \"strides\") or (strideD >= 1 and floor(strideD) == strideD and strideH >= 1 and floor(strideH) == strideH and strideW >= 1 and floor(strideW) == strideW)", "dilationsValuesOk": "not has(attrs, \"dilations\") or (dilationD >= 1 and floor(dilationD) == dilationD and dilationH >= 1 and floor(dilationH) == dilationH and dilationW >= 1 and floor(dilationW) == dilationW)", "padsValuesOk": "padFront >= 0 and floor(padFront) == padFront and padTop >= 0 and floor(padTop) == padTop and padLeft >= 0 and floor(padLeft) == padLeft and padBack >= 0 and floor(padBack) == padBack and padBottom >= 0 and floor(padBottom) == padBottom and padRight >= 0 and floor(padRight) == padRight", "explicitPadsOk": "attrs.auto_pad == \"NOTSET\" or not has(attrs, \"pads\")", "spatialAttributesOk": "spatialRank >= 1 and spatialRank <= 3 and spatialAttributeLengthsOk and kernelShapeMatchesWeights and kernelExtentsOk and stridesValuesOk and dilationsValuesOk and padsValuesOk and explicitPadsOk", "batchSize": "dim(shapes.X, 0) if ranks.X >= 1 else 0", "inChannels": "dim(shapes.X, 1) if ranks.X >= 2 else 0", "inputPixels": "inputHeight * inputWidth", "outChannels": "dim(shapes.W, 0) if ranks.W >= 1 else 0", "kernelChannels": "dim(shapes.W, 1) if ranks.W >= 2 else 0", "kernelRows": "kernelChannels * kernelHeight * kernelWidth", "outputPixels": "outputHeight * outputWidth", "paddedKernelRows": "ceilDiv(kernelRows, 32) * 32", "paddedOutputPixels": "ceilDiv(outputPixels, 64) * 64", "nchwRanksOk": "spatialAttributesOk and ranks.Y == 4 and ranks.X == 4 and ranks.W == 4", "conv1dRanksOk": "spatialAttributesOk and ranks.Y == 3 and ranks.X == 3 and ranks.W == 3", "conv3dRanksOk": "spatialAttributesOk and ranks.Y == 5 and ranks.X == 5 and ranks.W == 5", "outChannelsOk": "ranks.Y >= 2 and ranks.X >= 1 and ranks.W >= 1 and dim(shapes.Y, 0) == batchSize and dim(shapes.Y, 1) == outChannels", "groupOk": "attrs.group >= 1 and outChannels % attrs.group == 0 and kernelChannels * attrs.group == inChannels", "inChannelsPerGroup": "inChannels / attrs.group if attrs.group > 0 else 0", "outChannelsPerGroup": "outChannels / attrs.group if attrs.group > 0 else 0", "biasOk": "present.bias and ranks.B == 1 and dim(shapes.B, 0) == outChannels", "outHeightOk": "outputHeight == expectedOutputHeight", "outWidthOk": "outputWidth == expectedOutputWidth", "activationParamsOk": "(has(attrs, \"activation_params\") and (attrs.activation_params | length) == 1) if has(attrs, \"activation\") and attrs.activation == \"LeakyRelu\" else ((has(attrs, \"activation_params\") and (attrs.activation_params | length) == 2) if has(attrs, \"activation\") and (attrs.activation == \"HardSigmoid\" or attrs.activation == \"Clip\") else true)", "activationOk": "(not has(attrs, \"activation\") or attrs.activation == \"Relu\" or attrs.activation == \"LeakyRelu\" or attrs.activation == \"Sigmoid\" or attrs.activation == \"Tanh\" or attrs.activation == \"HardSigmoid\" or attrs.activation == \"HardSwish\" or attrs.activation == \"Clip\") and activationParamsOk", "zOk": "present.zResidual and sameShape(shapes.Z, shapes.Y)", "configuredWorkgroupOk": "tunables.WORKGROUP_SIZE <= deviceWorkgroupCap", "convWorkgroupSize": "min(tunables.WORKGROUP_SIZE, deviceWorkgroupCap)", "baseContract": "f16Ok(dtypes.T) and nchwRanksOk and outChannelsOk and activationOk and configuredWorkgroupOk", "conv1dOutputOk": "outWidthOk", "conv1dBaseContract": "f16Ok(dtypes.T) and conv1dRanksOk and outChannelsOk and activationOk and conv1dOutputOk", "conv3dOutputOk": "outputDepth == expectedOutputDepth and outputHeight == expectedOutputHeight and outputWidth == expectedOutputWidth", "conv3dBaseContract": "f16Ok(dtypes.T) and conv3dRanksOk and outChannelsOk and activationOk and conv3dOutputOk and configuredWorkgroupOk", "sgmatConvContract": "baseContract or (conv1dBaseContract and configuredWorkgroupOk)", "conv1dUseWideM": "dtypes.T == \"f32\" and tunables.CONV1D_TILE_M == 4 and outChannels >= 128 and kernelRows >= 32 and kernelRows <= 256 and outputWidth >= 1024 and tunables.CONV1D_WG_X * tunables.CONV1D_WG_Y <= device.limits.maxComputeInvocationsPerWorkgroup and tunables.CONV1D_WG_X <= device.limits.maxComputeWorkgroupSizeX and tunables.CONV1D_WG_Y <= device.limits.maxComputeWorkgroupSizeY and (tunables.CONV1D_WG_Y * 8 + tunables.CONV1D_WG_X * tunables.CONV1D_TILE_N) * tunables.CONV1D_K_TILE * 4 <= device.limits.maxComputeWorkgroupStorageSize", "conv1dTileM": "8 if conv1dUseWideM else tunables.CONV1D_TILE_M", "conv1dBlockM": "tunables.CONV1D_WG_Y * conv1dTileM", "conv1dBlockN": "tunables.CONV1D_WG_X * tunables.CONV1D_TILE_N", "conv1dTiledGeometryOk": "tunables.CONV1D_WG_X >= 1 and tunables.CONV1D_WG_Y >= 1 and tunables.CONV1D_K_TILE >= 1 and conv1dTileM >= 1 and tunables.CONV1D_TILE_N >= 1 and tunables.CONV1D_WG_X * tunables.CONV1D_WG_Y <= device.limits.maxComputeInvocationsPerWorkgroup and tunables.CONV1D_WG_X <= device.limits.maxComputeWorkgroupSizeX and tunables.CONV1D_WG_Y <= device.limits.maxComputeWorkgroupSizeY and (conv1dBlockM + conv1dBlockN) * tunables.CONV1D_K_TILE * 4 <= device.limits.maxComputeWorkgroupStorageSize", "conv1dTiledDispatchOk": "batchSize >= 1 and batchSize <= device.limits.maxComputeWorkgroupsPerDimension and ceilDiv(outputWidth, conv1dBlockN) <= device.limits.maxComputeWorkgroupsPerDimension and ceilDiv(outChannels, conv1dBlockM) <= device.limits.maxComputeWorkgroupsPerDimension", "conv1dTiledFit": "ceilDiv(outChannels, tunables.CONV1D_WG_Y * tunables.CONV1D_TILE_M) * ceilDiv(outputWidth, conv1dBlockN) >= tunables.CONV1D_REG_MIN_TILE_COUNT and kernelRows >= tunables.CONV1D_REG_MIN_KERNEL_ROWS", "denseGroupContract": "attrs.group == 1 and kernelChannels == inChannels", "spatialOutputContract": "outHeightOk and outWidthOk", "oneByOneContract": "denseGroupContract and kernelHeight == 1 and kernelWidth == 1 and strideH == 1 and strideW == 1 and dilationH == 1 and dilationW == 1 and padTop == 0 and padLeft == 0 and padBottom == 0 and padRight == 0 and outputHeight == inputHeight and outputWidth == inputWidth", "noBiasContract": "not present.bias", "biasContract": "present.bias and biasOk", "noResidualContract": "not present.zResidual", "residualContract": "present.zResidual and zOk", "batchDispatchFits": "batchSize <= device.limits.maxComputeWorkgroupsPerDimension", "outputChannelDispatchFits": "ceilDiv(outChannels, 32) <= device.limits.maxComputeWorkgroupsPerDimension", "im2colRegTile": 64, "im2colRegWorkgroups": "batchSize * ceilDiv(outChannels, im2colRegTile) * ceilDiv(outputPixels, im2colRegTile)", "im2colRegMinWorkgroups": 64, "im2colRegKTile": "32 if kernelRows % 32 == 0 else 16", "im2colRegSharedBytes": "2 * im2colRegTile * im2colRegKTile * (2 if dtypes.T == \"f16\" else 4)", "im2colRegDeviceCovered": "128 <= device.limits.maxComputeInvocationsPerWorkgroup and 16 <= device.limits.maxComputeWorkgroupSizeX and 8 <= device.limits.maxComputeWorkgroupSizeY and im2colRegSharedBytes <= device.limits.maxComputeWorkgroupStorageSize", "exactIm2colBufferFits": "ceilDiv(outputPixels, tunables.WORKGROUP_SIZE) <= device.limits.maxComputeWorkgroupsPerDimension and batchSize * kernelRows * outputPixels * 4 <= device.limits.maxStorageBufferBindingSize and batchSize * kernelRows * outputPixels * 4 <= device.limits.maxBufferSize", "paddedIm2colResourcesFit": "ceilDiv(paddedOutputPixels, tunables.WORKGROUP_SIZE) <= device.limits.maxComputeWorkgroupsPerDimension and batchSize * paddedKernelRows * paddedOutputPixels * 4 <= device.limits.maxStorageBufferBindingSize and batchSize * paddedKernelRows * paddedOutputPixels * 4 <= device.limits.maxBufferSize", "wideSgmatTile": "dtypes.T == \"f32\" and outChannels >= 64 and wave32Effective and 256 <= deviceWorkgroupCap and 24576 <= device.limits.maxComputeWorkgroupStorageSize", "sgmatTileRows": "64 if wideSgmatTile else 32", "sgmatWorkgroupThreads": "256 if wideSgmatTile else 128", "sgmatSubgroupRows": "4 if wideSgmatTile else 2", "sgmatDirectStore": "dtypes.T == \"f32\" and outChannels % sgmatTileRows == 0", "usesF16": "dtypes.T == \"f16\"", "fScalar": "\"f16\" if usesF16 else \"f32\"", "hasActivation": "has(attrs, \"activation\")", "activationName": "attrs.activation if hasActivation else \"\"", "activationAlpha": "attrs.activation_params[0] if (has(attrs, \"activation_params\") and (attrs.activation_params | length) >= 1) else (0.2 if activationName == \"HardSigmoid\" else (0.01 if activationName == \"LeakyRelu\" else 0.0))", "activationBeta": "attrs.activation_params[1] if (has(attrs, \"activation_params\") and (attrs.activation_params | length) >= 2) else (0.5 if activationName == \"HardSigmoid\" else 0.0)" }, "bindingSets": { "im2col": [ { "name": "x", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "cols", "semantic": "cols", "buffer": { "type": "storage" }, "elementType": "f32" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "outCount", "type": "u32", "value": "outputPixels" }, { "name": "outW", "type": "u32", "value": "outputWidth" }, { "name": "inH", "type": "u32", "value": "inputHeight" }, { "name": "inW", "type": "u32", "value": "inputWidth" }, { "name": "inChannels", "type": "u32", "value": "inChannels" }, { "name": "kRows", "type": "u32", "value": "kernelRows" } ] } } ], "tiled1d": [ { "name": "x", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "outChannels", "type": "u32", "value": "outChannels" }, { "name": "outW", "type": "u32", "value": "outputWidth" }, { "name": "inChannels", "type": "u32", "value": "inChannels" }, { "name": "kernelW", "type": "u32", "value": "kernelWidth" }, { "name": "inW", "type": "u32", "value": "inputWidth" }, { "name": "strideW", "type": "u32", "value": "strideW" }, { "name": "dilationW", "type": "u32", "value": "dilationW" }, { "name": "padW", "type": "i32", "value": "effectivePadLeft" } ] } } ], "tiled1dBias": [ { "name": "x", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "bias", "arg": "bias", "semantic": "B", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "outChannels", "type": "u32", "value": "outChannels" }, { "name": "outW", "type": "u32", "value": "outputWidth" }, { "name": "inChannels", "type": "u32", "value": "inChannels" }, { "name": "kernelW", "type": "u32", "value": "kernelWidth" }, { "name": "inW", "type": "u32", "value": "inputWidth" }, { "name": "strideW", "type": "u32", "value": "strideW" }, { "name": "dilationW", "type": "u32", "value": "dilationW" }, { "name": "padW", "type": "i32", "value": "effectivePadLeft" } ] } } ], "sgmmGemm": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "semantic": "cols", "buffer": { "type": "read-only-storage" }, "elementType": "f32" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "_pad0", "type": "u32", "default": 0 }, { "name": "_pad1", "type": "u32", "default": 0 }, { "name": "_pad2", "type": "u32", "default": 0 }, { "name": "_pad3", "type": "u32", "default": 0 } ] } } ], "sgmmGemm_z": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "semantic": "cols", "buffer": { "type": "read-only-storage" }, "elementType": "f32" }, { "name": "zResidual", "arg": "zResidual", "semantic": "Z", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "_pad0", "type": "u32", "default": 0 }, { "name": "_pad1", "type": "u32", "default": 0 }, { "name": "_pad2", "type": "u32", "default": 0 }, { "name": "_pad3", "type": "u32", "default": 0 } ] } } ], "sgmmGemmBias": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "semantic": "cols", "buffer": { "type": "read-only-storage" }, "elementType": "f32" }, { "name": "bias", "arg": "bias", "semantic": "B", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "_pad0", "type": "u32", "default": 0 }, { "name": "_pad1", "type": "u32", "default": 0 }, { "name": "_pad2", "type": "u32", "default": 0 }, { "name": "_pad3", "type": "u32", "default": 0 } ] } } ], "sgmmGemmBias_z": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "semantic": "cols", "buffer": { "type": "read-only-storage" }, "elementType": "f32" }, { "name": "bias", "arg": "bias", "semantic": "B", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "zResidual", "arg": "zResidual", "semantic": "Z", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "_pad0", "type": "u32", "default": 0 }, { "name": "_pad1", "type": "u32", "default": 0 }, { "name": "_pad2", "type": "u32", "default": 0 }, { "name": "_pad3", "type": "u32", "default": 0 } ] } } ], "sgmmGemmNoParams": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "semantic": "cols", "buffer": { "type": "read-only-storage" }, "elementType": "f32" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" } ], "sgmmGemm_zNoParams": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "semantic": "cols", "buffer": { "type": "read-only-storage" }, "elementType": "f32" }, { "name": "zResidual", "arg": "zResidual", "semantic": "Z", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" } ], "sgmmGemmBiasNoParams": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "semantic": "cols", "buffer": { "type": "read-only-storage" }, "elementType": "f32" }, { "name": "bias", "arg": "bias", "semantic": "B", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" } ], "sgmmGemmBias_zNoParams": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "semantic": "cols", "buffer": { "type": "read-only-storage" }, "elementType": "f32" }, { "name": "bias", "arg": "bias", "semantic": "B", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "zResidual", "arg": "zResidual", "semantic": "Z", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" } ], "tiledGemm": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "semantic": "cols", "buffer": { "type": "read-only-storage" }, "elementType": "f32" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "M", "type": "u32", "value": "outChannels" }, { "name": "K", "type": "u32", "value": "kernelRows" }, { "name": "N", "type": "u32", "value": "outputPixels" } ] } } ], "tiledGemmBias": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "semantic": "cols", "buffer": { "type": "read-only-storage" }, "elementType": "f32" }, { "name": "bias", "arg": "bias", "semantic": "B", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "M", "type": "u32", "value": "outChannels" }, { "name": "K", "type": "u32", "value": "kernelRows" }, { "name": "N", "type": "u32", "value": "outputPixels" } ] } } ], "gemm1x1": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "M", "type": "u32", "value": "outChannels" }, { "name": "K", "type": "u32", "value": "inChannels" }, { "name": "N", "type": "u32", "value": "inputPixels" } ] } } ], "gemm1x1Bias": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "bias", "arg": "bias", "semantic": "B", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "M", "type": "u32", "value": "outChannels" }, { "name": "K", "type": "u32", "value": "inChannels" }, { "name": "N", "type": "u32", "value": "inputPixels" } ] } } ], "tiledGemm_z": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "semantic": "cols", "buffer": { "type": "read-only-storage" }, "elementType": "f32" }, { "name": "zResidual", "arg": "zResidual", "semantic": "Z", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "M", "type": "u32", "value": "outChannels" }, { "name": "K", "type": "u32", "value": "kernelRows" }, { "name": "N", "type": "u32", "value": "outputPixels" } ] } } ], "tiledGemmBias_z": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "semantic": "cols", "buffer": { "type": "read-only-storage" }, "elementType": "f32" }, { "name": "bias", "arg": "bias", "semantic": "B", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "zResidual", "arg": "zResidual", "semantic": "Z", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "M", "type": "u32", "value": "outChannels" }, { "name": "K", "type": "u32", "value": "kernelRows" }, { "name": "N", "type": "u32", "value": "outputPixels" } ] } } ], "sgmat1x1": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "_pad0", "type": "u32", "default": 0 }, { "name": "_pad1", "type": "u32", "default": 0 }, { "name": "_pad2", "type": "u32", "default": 0 }, { "name": "_pad3", "type": "u32", "default": 0 } ] } } ], "sgmat1x1_z": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "zResidual", "arg": "zResidual", "semantic": "Z", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "_pad0", "type": "u32", "default": 0 }, { "name": "_pad1", "type": "u32", "default": 0 }, { "name": "_pad2", "type": "u32", "default": 0 }, { "name": "_pad3", "type": "u32", "default": 0 } ] } } ], "sgmat1x1Bias": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "bias", "arg": "bias", "semantic": "B", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "_pad0", "type": "u32", "default": 0 }, { "name": "_pad1", "type": "u32", "default": 0 }, { "name": "_pad2", "type": "u32", "default": 0 }, { "name": "_pad3", "type": "u32", "default": 0 } ] } } ], "sgmat1x1Bias_z": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "bias", "arg": "bias", "semantic": "B", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "zResidual", "arg": "zResidual", "semantic": "Z", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "_pad0", "type": "u32", "default": 0 }, { "name": "_pad1", "type": "u32", "default": 0 }, { "name": "_pad2", "type": "u32", "default": 0 }, { "name": "_pad3", "type": "u32", "default": 0 } ] } } ], "sgmat1x1NoParams": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" } ], "sgmat1x1_zNoParams": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "zResidual", "arg": "zResidual", "semantic": "Z", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" } ], "sgmat1x1BiasNoParams": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "bias", "arg": "bias", "semantic": "B", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" } ], "sgmat1x1Bias_zNoParams": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "bias", "arg": "bias", "semantic": "B", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "zResidual", "arg": "zResidual", "semantic": "Z", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" } ], "gemm1x1_z": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "zResidual", "arg": "zResidual", "semantic": "Z", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "M", "type": "u32", "value": "outChannels" }, { "name": "K", "type": "u32", "value": "inChannels" }, { "name": "N", "type": "u32", "value": "inputPixels" } ] } } ], "gemm1x1Bias_z": [ { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "xm", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "bias", "arg": "bias", "semantic": "B", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "zResidual", "arg": "zResidual", "semantic": "Z", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "M", "type": "u32", "value": "outChannels" }, { "name": "K", "type": "u32", "value": "inChannels" }, { "name": "N", "type": "u32", "value": "inputPixels" } ] } } ], "direct2dUnrolled": [ { "name": "x", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "count", "type": "u32", "value": "numel(shapes.Y)" }, { "name": "outW", "type": "u32", "value": "outputWidth" }, { "name": "outH", "type": "u32", "value": "outputHeight" }, { "name": "outChannels", "type": "u32", "value": "outChannels" }, { "name": "outChannelsPerGroup", "type": "u32", "value": "outChannels / attrs.group" }, { "name": "inChannels", "type": "u32", "value": "inChannels" }, { "name": "inChannelsPerGroup", "type": "u32", "value": "inChannels / attrs.group" }, { "name": "weightInChannels", "type": "u32", "value": "kernelChannels" }, { "name": "inH", "type": "u32", "value": "inputHeight" }, { "name": "inW", "type": "u32", "value": "inputWidth" } ] } } ], "direct2dUnrolled_z": [ { "name": "x", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "zResidual", "arg": "zResidual", "semantic": "Z", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "count", "type": "u32", "value": "numel(shapes.Y)" }, { "name": "outW", "type": "u32", "value": "outputWidth" }, { "name": "outH", "type": "u32", "value": "outputHeight" }, { "name": "outChannels", "type": "u32", "value": "outChannels" }, { "name": "outChannelsPerGroup", "type": "u32", "value": "outChannels / attrs.group" }, { "name": "inChannels", "type": "u32", "value": "inChannels" }, { "name": "inChannelsPerGroup", "type": "u32", "value": "inChannels / attrs.group" }, { "name": "weightInChannels", "type": "u32", "value": "kernelChannels" }, { "name": "inH", "type": "u32", "value": "inputHeight" }, { "name": "inW", "type": "u32", "value": "inputWidth" } ] } } ], "direct2dUnrolledBias": [ { "name": "x", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "bias", "arg": "bias", "semantic": "B", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "count", "type": "u32", "value": "numel(shapes.Y)" }, { "name": "outW", "type": "u32", "value": "outputWidth" }, { "name": "outH", "type": "u32", "value": "outputHeight" }, { "name": "outChannels", "type": "u32", "value": "outChannels" }, { "name": "outChannelsPerGroup", "type": "u32", "value": "outChannels / attrs.group" }, { "name": "inChannels", "type": "u32", "value": "inChannels" }, { "name": "inChannelsPerGroup", "type": "u32", "value": "inChannels / attrs.group" }, { "name": "weightInChannels", "type": "u32", "value": "kernelChannels" }, { "name": "inH", "type": "u32", "value": "inputHeight" }, { "name": "inW", "type": "u32", "value": "inputWidth" } ] } } ], "direct2dUnrolledBias_z": [ { "name": "x", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "bias", "arg": "bias", "semantic": "B", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "zResidual", "arg": "zResidual", "semantic": "Z", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "count", "type": "u32", "value": "numel(shapes.Y)" }, { "name": "outW", "type": "u32", "value": "outputWidth" }, { "name": "outH", "type": "u32", "value": "outputHeight" }, { "name": "outChannels", "type": "u32", "value": "outChannels" }, { "name": "outChannelsPerGroup", "type": "u32", "value": "outChannels / attrs.group" }, { "name": "inChannels", "type": "u32", "value": "inChannels" }, { "name": "inChannelsPerGroup", "type": "u32", "value": "inChannels / attrs.group" }, { "name": "weightInChannels", "type": "u32", "value": "kernelChannels" }, { "name": "inH", "type": "u32", "value": "inputHeight" }, { "name": "inW", "type": "u32", "value": "inputWidth" } ] } } ], "direct3d": [ { "name": "x", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "inChannels", "type": "u32", "value": "inChannels" }, { "name": "inD", "type": "u32", "value": "inputDepth" }, { "name": "inH", "type": "u32", "value": "inputHeight" }, { "name": "inW", "type": "u32", "value": "inputWidth" }, { "name": "outChannels", "type": "u32", "value": "outChannels" }, { "name": "weightInChannels", "type": "u32", "value": "kernelChannels" }, { "name": "inChannelsPerGroup", "type": "u32", "value": "inChannelsPerGroup" }, { "name": "outChannelsPerGroup", "type": "u32", "value": "outChannelsPerGroup" }, { "name": "kernelD", "type": "u32", "value": "kernelDepth" }, { "name": "kernelH", "type": "u32", "value": "kernelHeight" }, { "name": "kernelW", "type": "u32", "value": "kernelWidth" }, { "name": "outD", "type": "u32", "value": "outputDepth" }, { "name": "outH", "type": "u32", "value": "outputHeight" }, { "name": "outW", "type": "u32", "value": "outputWidth" }, { "name": "strideD", "type": "u32", "value": "strideD" }, { "name": "strideH", "type": "u32", "value": "strideH" }, { "name": "strideW", "type": "u32", "value": "strideW" }, { "name": "dilationD", "type": "u32", "value": "dilationD" }, { "name": "dilationH", "type": "u32", "value": "dilationH" }, { "name": "dilationW", "type": "u32", "value": "dilationW" }, { "name": "padD", "type": "i32", "value": "effectivePadFront" }, { "name": "padH", "type": "i32", "value": "effectivePadTop" }, { "name": "padW", "type": "i32", "value": "effectivePadLeft" }, { "name": "count", "type": "u32", "value": "numel(shapes.Y)" } ] } } ], "direct3d_z": [ { "name": "x", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "zResidual", "arg": "zResidual", "semantic": "Z", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "inChannels", "type": "u32", "value": "inChannels" }, { "name": "inD", "type": "u32", "value": "inputDepth" }, { "name": "inH", "type": "u32", "value": "inputHeight" }, { "name": "inW", "type": "u32", "value": "inputWidth" }, { "name": "outChannels", "type": "u32", "value": "outChannels" }, { "name": "weightInChannels", "type": "u32", "value": "kernelChannels" }, { "name": "inChannelsPerGroup", "type": "u32", "value": "inChannelsPerGroup" }, { "name": "outChannelsPerGroup", "type": "u32", "value": "outChannelsPerGroup" }, { "name": "kernelD", "type": "u32", "value": "kernelDepth" }, { "name": "kernelH", "type": "u32", "value": "kernelHeight" }, { "name": "kernelW", "type": "u32", "value": "kernelWidth" }, { "name": "outD", "type": "u32", "value": "outputDepth" }, { "name": "outH", "type": "u32", "value": "outputHeight" }, { "name": "outW", "type": "u32", "value": "outputWidth" }, { "name": "strideD", "type": "u32", "value": "strideD" }, { "name": "strideH", "type": "u32", "value": "strideH" }, { "name": "strideW", "type": "u32", "value": "strideW" }, { "name": "dilationD", "type": "u32", "value": "dilationD" }, { "name": "dilationH", "type": "u32", "value": "dilationH" }, { "name": "dilationW", "type": "u32", "value": "dilationW" }, { "name": "padD", "type": "i32", "value": "effectivePadFront" }, { "name": "padH", "type": "i32", "value": "effectivePadTop" }, { "name": "padW", "type": "i32", "value": "effectivePadLeft" }, { "name": "count", "type": "u32", "value": "numel(shapes.Y)" } ] } } ], "direct3dBias": [ { "name": "x", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "bias", "arg": "bias", "semantic": "B", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "inChannels", "type": "u32", "value": "inChannels" }, { "name": "inD", "type": "u32", "value": "inputDepth" }, { "name": "inH", "type": "u32", "value": "inputHeight" }, { "name": "inW", "type": "u32", "value": "inputWidth" }, { "name": "outChannels", "type": "u32", "value": "outChannels" }, { "name": "weightInChannels", "type": "u32", "value": "kernelChannels" }, { "name": "inChannelsPerGroup", "type": "u32", "value": "inChannelsPerGroup" }, { "name": "outChannelsPerGroup", "type": "u32", "value": "outChannelsPerGroup" }, { "name": "kernelD", "type": "u32", "value": "kernelDepth" }, { "name": "kernelH", "type": "u32", "value": "kernelHeight" }, { "name": "kernelW", "type": "u32", "value": "kernelWidth" }, { "name": "outD", "type": "u32", "value": "outputDepth" }, { "name": "outH", "type": "u32", "value": "outputHeight" }, { "name": "outW", "type": "u32", "value": "outputWidth" }, { "name": "strideD", "type": "u32", "value": "strideD" }, { "name": "strideH", "type": "u32", "value": "strideH" }, { "name": "strideW", "type": "u32", "value": "strideW" }, { "name": "dilationD", "type": "u32", "value": "dilationD" }, { "name": "dilationH", "type": "u32", "value": "dilationH" }, { "name": "dilationW", "type": "u32", "value": "dilationW" }, { "name": "padD", "type": "i32", "value": "effectivePadFront" }, { "name": "padH", "type": "i32", "value": "effectivePadTop" }, { "name": "padW", "type": "i32", "value": "effectivePadLeft" }, { "name": "count", "type": "u32", "value": "numel(shapes.Y)" } ] } } ], "direct3dBias_z": [ { "name": "x", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "bias", "arg": "bias", "semantic": "B", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "zResidual", "arg": "zResidual", "semantic": "Z", "buffer": { "type": "read-only-storage" }, "elementType": "$T" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$T" }, { "name": "params", "semantic": "kernel.params", "buffer": { "type": "uniform" }, "struct": { "name": "Params", "fields": [ { "name": "inChannels", "type": "u32", "value": "inChannels" }, { "name": "inD", "type": "u32", "value": "inputDepth" }, { "name": "inH", "type": "u32", "value": "inputHeight" }, { "name": "inW", "type": "u32", "value": "inputWidth" }, { "name": "outChannels", "type": "u32", "value": "outChannels" }, { "name": "weightInChannels", "type": "u32", "value": "kernelChannels" }, { "name": "inChannelsPerGroup", "type": "u32", "value": "inChannelsPerGroup" }, { "name": "outChannelsPerGroup", "type": "u32", "value": "outChannelsPerGroup" }, { "name": "kernelD", "type": "u32", "value": "kernelDepth" }, { "name": "kernelH", "type": "u32", "value": "kernelHeight" }, { "name": "kernelW", "type": "u32", "value": "kernelWidth" }, { "name": "outD", "type": "u32", "value": "outputDepth" }, { "name": "outH", "type": "u32", "value": "outputHeight" }, { "name": "outW", "type": "u32", "value": "outputWidth" }, { "name": "strideD", "type": "u32", "value": "strideD" }, { "name": "strideH", "type": "u32", "value": "strideH" }, { "name": "strideW", "type": "u32", "value": "strideW" }, { "name": "dilationD", "type": "u32", "value": "dilationD" }, { "name": "dilationH", "type": "u32", "value": "dilationH" }, { "name": "dilationW", "type": "u32", "value": "dilationW" }, { "name": "padD", "type": "i32", "value": "effectivePadFront" }, { "name": "padH", "type": "i32", "value": "effectivePadTop" }, { "name": "padW", "type": "i32", "value": "effectivePadLeft" }, { "name": "count", "type": "u32", "value": "numel(shapes.Y)" } ] } } ], "grouped": [ { "name": "x", "arg": "x", "semantic": "X", "buffer": { "type": "read-only-storage" }, "elementType": "$scalar" }, { "name": "w", "arg": "w", "semantic": "W", "buffer": { "type": "read-only-storage" }, "elementType": "$scalar" }, { "name": "y", "arg": "y", "semantic": "Y", "buffer": { "type": "storage" }, "elementType": "$outputElement" } ] }, "variants": [ { "id": "gemm_1x1_subgroup_matrix", "priority": 151, "requires": { "features": ["subgroups", "chromium-experimental-subgroup-matrix"], "subgroupMatrixConfigs": [ { "componentType": "f16", "M": 8, "N": 8, "K": 8 }, { "componentType": "f32", "resultComponentType": "f32", "M": 8, "N": 8, "K": 8 } ] }, "when": ["sgmatConvContract", "noBiasContract", "noResidualContract", "oneByOneContract", "batchDispatchFits", "outputChannelDispatchFits", "wave32Effective", "inChannels >= 32", "inChannels % 32 == 0", "inputPixels >= 64", "(inputPixels) % 64 == 0", "outChannels >= 32", "batchSize >= 1", "ceil((inputPixels) / 64) <= device.limits.maxComputeWorkgroupsPerDimension"], "constants": { "hasBias": false, "directMatrixStore": "sgmatDirectStore", "tileRows": "sgmatTileRows", "workgroupThreads": "sgmatWorkgroupThreads", "subgroupRows": "sgmatSubgroupRows", "subgroupCols": 2, "M": "outChannels", "K": "inChannels", "N": "inputPixels", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "\"\" == \"_z\"" }, "passes": [ { "id": "main", "name": "Conv.Gemm1x1SubgroupMatrix", "shader": "conv-1x1-subgroup-matrix.wgsl.jinja", "dispatch": { "x": "ceil(inputPixels / 64)", "y": "ceil(outChannels / (sgmatTileRows))", "z": "batchSize" } } ], "bindings": "sgmat1x1NoParams" }, { "id": "gemm_1x1_subgroup_matrix_z", "priority": 151, "requires": { "features": ["subgroups", "chromium-experimental-subgroup-matrix"], "subgroupMatrixConfigs": [ { "componentType": "f16", "M": 8, "N": 8, "K": 8 }, { "componentType": "f32", "resultComponentType": "f32", "M": 8, "N": 8, "K": 8 } ] }, "when": ["sgmatConvContract", "noBiasContract", "residualContract", "oneByOneContract", "batchDispatchFits", "outputChannelDispatchFits", "wave32Effective", "inChannels >= 32", "inChannels % 32 == 0", "inputPixels >= 64", "(inputPixels) % 64 == 0", "outChannels >= 32", "batchSize >= 1", "ceil((inputPixels) / 64) <= device.limits.maxComputeWorkgroupsPerDimension"], "constants": { "hasBias": false, "directMatrixStore": "sgmatDirectStore", "tileRows": "sgmatTileRows", "workgroupThreads": "sgmatWorkgroupThreads", "subgroupRows": "sgmatSubgroupRows", "subgroupCols": 2, "M": "outChannels", "K": "inChannels", "N": "inputPixels", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "\"_z\" == \"_z\"" }, "passes": [ { "id": "main", "name": "Conv.Gemm1x1SubgroupMatrix", "shader": "conv-1x1-subgroup-matrix.wgsl.jinja", "dispatch": { "x": "ceil(inputPixels / 64)", "y": "ceil(outChannels / (sgmatTileRows))", "z": "batchSize" } } ], "bindings": "sgmat1x1_zNoParams" }, { "id": "gemm_1x1_subgroup_matrix_bias", "priority": 151, "requires": { "features": ["subgroups", "chromium-experimental-subgroup-matrix"], "subgroupMatrixConfigs": [ { "componentType": "f16", "M": 8, "N": 8, "K": 8 }, { "componentType": "f32", "resultComponentType": "f32", "M": 8, "N": 8, "K": 8 } ] }, "when": ["sgmatConvContract", "biasContract", "noResidualContract", "oneByOneContract", "batchDispatchFits", "outputChannelDispatchFits", "wave32Effective", "inChannels >= 32", "inChannels % 32 == 0", "inputPixels >= 64", "(inputPixels) % 64 == 0", "outChannels >= 32", "batchSize >= 1", "ceil((inputPixels) / 64) <= device.limits.maxComputeWorkgroupsPerDimension"], "constants": { "hasBias": true, "directMatrixStore": "sgmatDirectStore", "tileRows": "sgmatTileRows", "workgroupThreads": "sgmatWorkgroupThreads", "subgroupRows": "sgmatSubgroupRows", "subgroupCols": 2, "M": "outChannels", "K": "inChannels", "N": "inputPixels", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "\"\" == \"_z\"" }, "passes": [ { "id": "main", "name": "Conv.Gemm1x1SubgroupMatrixBias", "shader": "conv-1x1-subgroup-matrix.wgsl.jinja", "dispatch": { "x": "ceil(inputPixels / 64)", "y": "ceil(outChannels / (sgmatTileRows))", "z": "batchSize" } } ], "bindings": "sgmat1x1BiasNoParams" }, { "id": "gemm_1x1_subgroup_matrix_bias_z", "priority": 151, "requires": { "features": ["subgroups", "chromium-experimental-subgroup-matrix"], "subgroupMatrixConfigs": [ { "componentType": "f16", "M": 8, "N": 8, "K": 8 }, { "componentType": "f32", "resultComponentType": "f32", "M": 8, "N": 8, "K": 8 } ] }, "when": ["sgmatConvContract", "biasContract", "residualContract", "oneByOneContract", "batchDispatchFits", "outputChannelDispatchFits", "wave32Effective", "inChannels >= 32", "inChannels % 32 == 0", "inputPixels >= 64", "(inputPixels) % 64 == 0", "outChannels >= 32", "batchSize >= 1", "ceil((inputPixels) / 64) <= device.limits.maxComputeWorkgroupsPerDimension"], "constants": { "hasBias": true, "directMatrixStore": "sgmatDirectStore", "tileRows": "sgmatTileRows", "workgroupThreads": "sgmatWorkgroupThreads", "subgroupRows": "sgmatSubgroupRows", "subgroupCols": 2, "M": "outChannels", "K": "inChannels", "N": "inputPixels", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "\"_z\" == \"_z\"" }, "passes": [ { "id": "main", "name": "Conv.Gemm1x1SubgroupMatrixBias", "shader": "conv-1x1-subgroup-matrix.wgsl.jinja", "dispatch": { "x": "ceil(inputPixels / 64)", "y": "ceil(outChannels / (sgmatTileRows))", "z": "batchSize" } } ], "bindings": "sgmat1x1Bias_zNoParams" }, { "id": "im2col_gemm_subgroup_matrix", "priority": 150, "requires": { "features": ["subgroups", "chromium-experimental-subgroup-matrix"], "subgroupMatrixConfigs": [ { "componentType": "f16", "M": 8, "N": 8, "K": 8 }, { "componentType": "f32", "resultComponentType": "f32", "M": 8, "N": 8, "K": 8 } ] }, "when": ["sgmatConvContract", "noBiasContract", "noResidualContract", "denseGroupContract", "spatialOutputContract", "batchDispatchFits", "outputChannelDispatchFits", "exactIm2colBufferFits", "wave32Effective", "(kernelRows) >= 32", "(kernelRows) % 32 == 0", "paddedKernelRows <= device.limits.maxComputeWorkgroupsPerDimension", "(outputPixels) >= 64", "(outputPixels) % 64 == 0", "outChannels >= 32", "batchSize >= 1", "ceil((outputPixels) / 64) <= device.limits.maxComputeWorkgroupsPerDimension"], "constants": { "hasBias": false, "directMatrixStore": "sgmatDirectStore", "tileRows": "sgmatTileRows", "workgroupThreads": "sgmatWorkgroupThreads", "subgroupRows": "sgmatSubgroupRows", "subgroupCols": 2, "M": "outChannels", "K": "kernelRows", "N": "outputPixels", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": false }, "intermediates": [{ "id": "cols", "dtype": "float32", "shape": "[batchSize * (kernelRows) * (outputPixels)]" }], "passes": [ { "id": "im2col", "name": "Conv.Im2col", "source": { "shader": "conv-im2col-nchw.wgsl.jinja", "inputs": { "kernelH": "kernelHeight", "kernelW": "kernelWidth", "strideH": "strideH", "strideW": "strideW", "dilationH": "dilationH", "dilationW": "dilationW", "padTop": "effectivePadTop", "padLeft": "effectivePadLeft" } }, "bindings": "im2col", "dispatch": { "x": "ceil(outputPixels / tunables.WORKGROUP_SIZE)", "y": "kernelRows", "z": "batchSize" } }, { "id": "gemm", "name": "Conv.Im2colGemmSubgroupMatrix", "shader": "conv-1x1-subgroup-matrix.wgsl.jinja", "bindings": "sgmmGemmNoParams", "dispatch": { "x": "ceil(outputPixels / 64)", "y": "ceil(outChannels / (sgmatTileRows))", "z": "batchSize" } } ] }, { "id": "im2col_gemm_subgroup_matrix_z", "priority": 150, "requires": { "features": ["subgroups", "chromium-experimental-subgroup-matrix"], "subgroupMatrixConfigs": [ { "componentType": "f16", "M": 8, "N": 8, "K": 8 }, { "componentType": "f32", "resultComponentType": "f32", "M": 8, "N": 8, "K": 8 } ] }, "when": ["sgmatConvContract", "noBiasContract", "residualContract", "denseGroupContract", "spatialOutputContract", "batchDispatchFits", "outputChannelDispatchFits", "exactIm2colBufferFits", "wave32Effective", "(kernelRows) >= 32", "(kernelRows) % 32 == 0", "paddedKernelRows <= device.limits.maxComputeWorkgroupsPerDimension", "(outputPixels) >= 64", "(outputPixels) % 64 == 0", "outChannels >= 32", "batchSize >= 1", "ceil((outputPixels) / 64) <= device.limits.maxComputeWorkgroupsPerDimension"], "constants": { "hasBias": false, "directMatrixStore": "sgmatDirectStore", "tileRows": "sgmatTileRows", "workgroupThreads": "sgmatWorkgroupThreads", "subgroupRows": "sgmatSubgroupRows", "subgroupCols": 2, "M": "outChannels", "K": "kernelRows", "N": "outputPixels", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": true }, "intermediates": [{ "id": "cols", "dtype": "float32", "shape": "[batchSize * (kernelRows) * (outputPixels)]" }], "passes": [ { "id": "im2col", "name": "Conv.Im2col", "source": { "shader": "conv-im2col-nchw.wgsl.jinja", "inputs": { "kernelH": "kernelHeight", "kernelW": "kernelWidth", "strideH": "strideH", "strideW": "strideW", "dilationH": "dilationH", "dilationW": "dilationW", "padTop": "effectivePadTop", "padLeft": "effectivePadLeft" } }, "bindings": "im2col", "dispatch": { "x": "ceil(outputPixels / tunables.WORKGROUP_SIZE)", "y": "kernelRows", "z": "batchSize" } }, { "id": "gemm", "name": "Conv.Im2colGemmSubgroupMatrix", "shader": "conv-1x1-subgroup-matrix.wgsl.jinja", "bindings": "sgmmGemm_zNoParams", "dispatch": { "x": "ceil(outputPixels / 64)", "y": "ceil(outChannels / (sgmatTileRows))", "z": "batchSize" } } ] }, { "id": "im2col_gemm_subgroup_matrix_bias", "priority": 151, "requires": { "features": ["subgroups", "chromium-experimental-subgroup-matrix"], "subgroupMatrixConfigs": [ { "componentType": "f16", "M": 8, "N": 8, "K": 8 }, { "componentType": "f32", "resultComponentType": "f32", "M": 8, "N": 8, "K": 8 } ] }, "when": ["sgmatConvContract", "biasContract", "noResidualContract", "denseGroupContract", "spatialOutputContract", "batchDispatchFits", "outputChannelDispatchFits", "exactIm2colBufferFits", "wave32Effective", "(kernelRows) >= 32", "(kernelRows) % 32 == 0", "paddedKernelRows <= device.limits.maxComputeWorkgroupsPerDimension", "(outputPixels) >= 64", "(outputPixels) % 64 == 0", "outChannels >= 32", "batchSize >= 1", "ceil((outputPixels) / 64) <= device.limits.maxComputeWorkgroupsPerDimension"], "constants": { "hasBias": true, "directMatrixStore": "sgmatDirectStore", "tileRows": "sgmatTileRows", "workgroupThreads": "sgmatWorkgroupThreads", "subgroupRows": "sgmatSubgroupRows", "subgroupCols": 2, "M": "outChannels", "K": "kernelRows", "N": "outputPixels", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "\"\" == \"_z\"" }, "intermediates": [{ "id": "cols", "dtype": "float32", "shape": "[batchSize * (kernelRows) * (outputPixels)]" }], "passes": [ { "id": "im2col", "name": "Conv.Im2col", "source": { "shader": "conv-im2col-nchw.wgsl.jinja", "inputs": { "kernelH": "kernelHeight", "kernelW": "kernelWidth", "strideH": "strideH", "strideW": "strideW", "dilationH": "dilationH", "dilationW": "dilationW", "padTop": "effectivePadTop", "padLeft": "effectivePadLeft" } }, "bindings": "im2col", "dispatch": { "x": "ceil(outputPixels / tunables.WORKGROUP_SIZE)", "y": "kernelRows", "z": "batchSize" } }, { "id": "gemm", "name": "Conv.Im2colGemmSubgroupMatrixBias", "shader": "conv-1x1-subgroup-matrix.wgsl.jinja", "bindings": "sgmmGemmBiasNoParams", "dispatch": { "x": "ceil(outputPixels / 64)", "y": "ceil(outChannels / (sgmatTileRows))", "z": "batchSize" } } ] }, { "id": "im2col_gemm_subgroup_matrix_bias_z", "priority": 151, "requires": { "features": ["subgroups", "chromium-experimental-subgroup-matrix"], "subgroupMatrixConfigs": [ { "componentType": "f16", "M": 8, "N": 8, "K": 8 }, { "componentType": "f32", "resultComponentType": "f32", "M": 8, "N": 8, "K": 8 } ] }, "when": ["sgmatConvContract", "biasContract", "residualContract", "denseGroupContract", "spatialOutputContract", "batchDispatchFits", "outputChannelDispatchFits", "exactIm2colBufferFits", "wave32Effective", "(kernelRows) >= 32", "(kernelRows) % 32 == 0", "paddedKernelRows <= device.limits.maxComputeWorkgroupsPerDimension", "(outputPixels) >= 64", "(outputPixels) % 64 == 0", "outChannels >= 32", "batchSize >= 1", "ceil((outputPixels) / 64) <= device.limits.maxComputeWorkgroupsPerDimension"], "constants": { "hasBias": true, "directMatrixStore": "sgmatDirectStore", "tileRows": "sgmatTileRows", "workgroupThreads": "sgmatWorkgroupThreads", "subgroupRows": "sgmatSubgroupRows", "subgroupCols": 2, "M": "outChannels", "K": "kernelRows", "N": "outputPixels", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "\"_z\" == \"_z\"" }, "intermediates": [{ "id": "cols", "dtype": "float32", "shape": "[batchSize * (kernelRows) * (outputPixels)]" }], "passes": [ { "id": "im2col", "name": "Conv.Im2col", "source": { "shader": "conv-im2col-nchw.wgsl.jinja", "inputs": { "kernelH": "kernelHeight", "kernelW": "kernelWidth", "strideH": "strideH", "strideW": "strideW", "dilationH": "dilationH", "dilationW": "dilationW", "padTop": "effectivePadTop", "padLeft": "effectivePadLeft" } }, "bindings": "im2col", "dispatch": { "x": "ceil(outputPixels / tunables.WORKGROUP_SIZE)", "y": "kernelRows", "z": "batchSize" } }, { "id": "gemm", "name": "Conv.Im2colGemmSubgroupMatrixBias", "shader": "conv-1x1-subgroup-matrix.wgsl.jinja", "bindings": "sgmmGemmBias_zNoParams", "dispatch": { "x": "ceil(outputPixels / 64)", "y": "ceil(outChannels / (sgmatTileRows))", "z": "batchSize" } } ] }, { "id": "im2col_gemm_subgroup_matrix_padded", "priority": 145, "requires": { "features": ["subgroups", "chromium-experimental-subgroup-matrix"], "subgroupMatrixConfigs": [ { "componentType": "f16", "M": 8, "N": 8, "K": 8 }, { "componentType": "f32", "resultComponentType": "f32", "M": 8, "N": 8, "K": 8 } ] }, "when": ["sgmatConvContract", "noBiasContract", "noResidualContract", "denseGroupContract", "spatialOutputContract", "batchDispatchFits", "outputChannelDispatchFits", "wave32Effective", "(kernelRows) >= 16", "paddedKernelRows <= device.limits.maxComputeWorkgroupsPerDimension", "(outputPixels) >= 32", "outChannels >= 32", "batchSize >= 1", "ceilDiv((outputPixels), 64) <= device.limits.maxComputeWorkgroupsPerDimension", "paddedIm2colResourcesFit"], "constants": { "hasBias": false, "directMatrixStore": "sgmatDirectStore", "tileRows": "sgmatTileRows", "workgroupThreads": "sgmatWorkgroupThreads", "subgroupRows": "sgmatSubgroupRows", "subgroupCols": 2, "M": "outChannels", "K": "kernelRows", "N": "outputPixels", "padded": true, "kPadded": "paddedKernelRows", "nPadded": "paddedOutputPixels", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "\"\" == \"_z\"" }, "intermediates": [ { "id": "cols", "dtype": "float32", "shape": "[batchSize * paddedKernelRows * paddedOutputPixels]" } ], "passes": [ { "id": "im2col", "name": "Conv.Im2colPadded", "source": { "shader": "conv-im2col-nchw.wgsl.jinja", "inputs": { "kernelH": "kernelHeight", "kernelW": "kernelWidth", "strideH": "strideH", "strideW": "strideW", "dilationH": "dilationH", "dilationW": "dilationW", "padTop": "effectivePadTop", "padLeft": "effectivePadLeft" } }, "bindings": "im2col", "dispatch": { "x": "ceil(paddedOutputPixels / tunables.WORKGROUP_SIZE)", "y": "paddedKernelRows", "z": "batchSize" } }, { "id": "gemm", "name": "Conv.Im2colGemmSubgroupMatrixPadded", "shader": "conv-1x1-subgroup-matrix.wgsl.jinja", "bindings": "sgmmGemmNoParams", "dispatch": { "x": "ceil(paddedOutputPixels / 64)", "y": "ceil(outChannels / (sgmatTileRows))", "z": "batchSize" } } ] }, { "id": "im2col_gemm_subgroup_matrix_padded_z", "priority": 145, "requires": { "features": ["subgroups", "chromium-experimental-subgroup-matrix"], "subgroupMatrixConfigs": [ { "componentType": "f16", "M": 8, "N": 8, "K": 8 }, { "componentType": "f32", "resultComponentType": "f32", "M": 8, "N": 8, "K": 8 } ] }, "when": ["sgmatConvContract", "noBiasContract", "residualContract", "denseGroupContract", "spatialOutputContract", "batchDispatchFits", "outputChannelDispatchFits", "wave32Effective", "(kernelRows) >= 16", "paddedKernelRows <= device.limits.maxComputeWorkgroupsPerDimension", "(outputPixels) >= 32", "outChannels >= 32", "batchSize >= 1", "ceilDiv((outputPixels), 64) <= device.limits.maxComputeWorkgroupsPerDimension", "paddedIm2colResourcesFit"], "constants": { "hasBias": false, "directMatrixStore": "sgmatDirectStore", "tileRows": "sgmatTileRows", "workgroupThreads": "sgmatWorkgroupThreads", "subgroupRows": "sgmatSubgroupRows", "subgroupCols": 2, "M": "outChannels", "K": "kernelRows", "N": "outputPixels", "padded": true, "kPadded": "paddedKernelRows", "nPadded": "paddedOutputPixels", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "\"_z\" == \"_z\"" }, "intermediates": [ { "id": "cols", "dtype": "float32", "shape": "[batchSize * paddedKernelRows * paddedOutputPixels]" } ], "passes": [ { "id": "im2col", "name": "Conv.Im2colPadded", "source": { "shader": "conv-im2col-nchw.wgsl.jinja", "inputs": { "kernelH": "kernelHeight", "kernelW": "kernelWidth", "strideH": "strideH", "strideW": "strideW", "dilationH": "dilationH", "dilationW": "dilationW", "padTop": "effectivePadTop", "padLeft": "effectivePadLeft" } }, "bindings": "im2col", "dispatch": { "x": "ceil(paddedOutputPixels / tunables.WORKGROUP_SIZE)", "y": "paddedKernelRows", "z": "batchSize" } }, { "id": "gemm", "name": "Conv.Im2colGemmSubgroupMatrixPadded", "shader": "conv-1x1-subgroup-matrix.wgsl.jinja", "bindings": "sgmmGemm_zNoParams", "dispatch": { "x": "ceil(paddedOutputPixels / 64)", "y": "ceil(outChannels / (sgmatTileRows))", "z": "batchSize" } } ] }, { "id": "im2col_gemm_subgroup_matrix_padded_bias", "priority": 146, "requires": { "features": ["subgroups", "chromium-experimental-subgroup-matrix"], "subgroupMatrixConfigs": [ { "componentType": "f16", "M": 8, "N": 8, "K": 8 }, { "componentType": "f32", "resultComponentType": "f32", "M": 8, "N": 8, "K": 8 } ] }, "when": ["sgmatConvContract", "biasContract", "noResidualContract", "denseGroupContract", "spatialOutputContract", "batchDispatchFits", "outputChannelDispatchFits", "wave32Effective", "(kernelRows) >= 16", "paddedKernelRows <= device.limits.maxComputeWorkgroupsPerDimension", "(outputPixels) >= 32", "outChannels >= 32", "batchSize >= 1", "ceilDiv((outputPixels), 64) <= device.limits.maxComputeWorkgroupsPerDimension", "paddedIm2colResourcesFit"], "constants": { "hasBias": true, "directMatrixStore": "sgmatDirectStore", "tileRows": "sgmatTileRows", "workgroupThreads": "sgmatWorkgroupThreads", "subgroupRows": "sgmatSubgroupRows", "subgroupCols": 2, "M": "outChannels", "K": "kernelRows", "N": "outputPixels", "padded": true, "kPadded": "paddedKernelRows", "nPadded": "paddedOutputPixels", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "\"\" == \"_z\"" }, "intermediates": [ { "id": "cols", "dtype": "float32", "shape": "[batchSize * paddedKernelRows * paddedOutputPixels]" } ], "passes": [ { "id": "im2col", "name": "Conv.Im2colPadded", "source": { "shader": "conv-im2col-nchw.wgsl.jinja", "inputs": { "kernelH": "kernelHeight", "kernelW": "kernelWidth", "strideH": "strideH", "strideW": "strideW", "dilationH": "dilationH", "dilationW": "dilationW", "padTop": "effectivePadTop", "padLeft": "effectivePadLeft" } }, "bindings": "im2col", "dispatch": { "x": "ceil(paddedOutputPixels / tunables.WORKGROUP_SIZE)", "y": "paddedKernelRows", "z": "batchSize" } }, { "id": "gemm", "name": "Conv.Im2colGemmSubgroupMatrixBiasPadded", "shader": "conv-1x1-subgroup-matrix.wgsl.jinja", "bindings": "sgmmGemmBiasNoParams", "dispatch": { "x": "ceil(paddedOutputPixels / 64)", "y": "ceil(outChannels / (sgmatTileRows))", "z": "batchSize" } } ] }, { "id": "im2col_gemm_subgroup_matrix_padded_bias_z", "priority": 146, "requires": { "features": ["subgroups", "chromium-experimental-subgroup-matrix"], "subgroupMatrixConfigs": [ { "componentType": "f16", "M": 8, "N": 8, "K": 8 }, { "componentType": "f32", "resultComponentType": "f32", "M": 8, "N": 8, "K": 8 } ] }, "when": ["sgmatConvContract", "biasContract", "residualContract", "denseGroupContract", "spatialOutputContract", "batchDispatchFits", "outputChannelDispatchFits", "wave32Effective", "(kernelRows) >= 16", "paddedKernelRows <= device.limits.maxComputeWorkgroupsPerDimension", "(outputPixels) >= 32", "outChannels >= 32", "batchSize >= 1", "ceilDiv((outputPixels), 64) <= device.limits.maxComputeWorkgroupsPerDimension", "paddedIm2colResourcesFit"], "constants": { "hasBias": true, "directMatrixStore": "sgmatDirectStore", "tileRows": "sgmatTileRows", "workgroupThreads": "sgmatWorkgroupThreads", "subgroupRows": "sgmatSubgroupRows", "subgroupCols": 2, "M": "outChannels", "K": "kernelRows", "N": "outputPixels", "padded": true, "kPadded": "paddedKernelRows", "nPadded": "paddedOutputPixels", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "\"_z\" == \"_z\"" }, "intermediates": [ { "id": "cols", "dtype": "float32", "shape": "[batchSize * paddedKernelRows * paddedOutputPixels]" } ], "passes": [ { "id": "im2col", "name": "Conv.Im2colPadded", "source": { "shader": "conv-im2col-nchw.wgsl.jinja", "inputs": { "kernelH": "kernelHeight", "kernelW": "kernelWidth", "strideH": "strideH", "strideW": "strideW", "dilationH": "dilationH", "dilationW": "dilationW", "padTop": "effectivePadTop", "padLeft": "effectivePadLeft" } }, "bindings": "im2col", "dispatch": { "x": "ceil(paddedOutputPixels / tunables.WORKGROUP_SIZE)", "y": "paddedKernelRows", "z": "batchSize" } }, { "id": "gemm", "name": "Conv.Im2colGemmSubgroupMatrixBiasPadded", "shader": "conv-1x1-subgroup-matrix.wgsl.jinja", "bindings": "sgmmGemmBias_zNoParams", "dispatch": { "x": "ceil(paddedOutputPixels / 64)", "y": "ceil(outChannels / (sgmatTileRows))", "z": "batchSize" } } ] }, { "id": "im2col_gemm_tiled", "priority": 130, "when": ["baseContract", "noBiasContract", "noResidualContract", "denseGroupContract", "spatialOutputContract", "batchDispatchFits", "outputChannelDispatchFits", "exactIm2colBufferFits", "(kernelRows) <= device.limits.maxComputeWorkgroupsPerDimension", "batchSize >= 1", "ceil((outputPixels) / 32) <= device.limits.maxComputeWorkgroupsPerDimension"], "constants": { "hasBias": false, "M": "outChannels", "K": "kernelRows", "N": "outputPixels", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "\"\" == \"_z\"" }, "intermediates": [{ "id": "cols", "dtype": "float32", "shape": "[batchSize * (kernelRows) * (outputPixels)]" }], "passes": [ { "id": "im2col", "name": "Conv.Im2col", "source": { "shader": "conv-im2col-nchw.wgsl.jinja", "inputs": { "kernelH": "kernelHeight", "kernelW": "kernelWidth", "strideH": "strideH", "strideW": "strideW", "dilationH": "dilationH", "dilationW": "dilationW", "padTop": "effectivePadTop", "padLeft": "effectivePadLeft" } }, "bindings": "im2col", "dispatch": { "x": "ceil(outputPixels / tunables.WORKGROUP_SIZE)", "y": "kernelRows", "z": "batchSize" } }, { "id": "gemm", "name": "Conv.Im2colGemmTiled", "shader": "conv-1x1-gemm-tiled.wgsl.jinja", "bindings": "tiledGemm", "dispatch": { "x": "ceil(outputPixels / 32)", "y": "ceil(outChannels / 32)", "z": "batchSize" } } ] }, { "id": "im2col_gemm_tiled_z", "priority": 130, "when": ["baseContract", "noBiasContract", "residualContract", "denseGroupContract", "spatialOutputContract", "batchDispatchFits", "outputChannelDispatchFits", "exactIm2colBufferFits", "(kernelRows) <= device.limits.maxComputeWorkgroupsPerDimension", "batchSize >= 1", "ceil((outputPixels) / 32) <= device.limits.maxComputeWorkgroupsPerDimension"], "constants": { "hasBias": false, "M": "outChannels", "K": "kernelRows", "N": "outputPixels", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "\"_z\" == \"_z\"" }, "intermediates": [{ "id": "cols", "dtype": "float32", "shape": "[batchSize * (kernelRows) * (outputPixels)]" }], "passes": [ { "id": "im2col", "name": "Conv.Im2col", "source": { "shader": "conv-im2col-nchw.wgsl.jinja", "inputs": { "kernelH": "kernelHeight", "kernelW": "kernelWidth", "strideH": "strideH", "strideW": "strideW", "dilationH": "dilationH", "dilationW": "dilationW", "padTop": "effectivePadTop", "padLeft": "effectivePadLeft" } }, "bindings": "im2col", "dispatch": { "x": "ceil(outputPixels / tunables.WORKGROUP_SIZE)", "y": "kernelRows", "z": "batchSize" } }, { "id": "gemm", "name": "Conv.Im2colGemmTiled", "shader": "conv-1x1-gemm-tiled.wgsl.jinja", "bindings": "tiledGemm_z", "dispatch": { "x": "ceil(outputPixels / 32)", "y": "ceil(outChannels / 32)", "z": "batchSize" } } ] }, { "id": "im2col_gemm_tiled_bias", "priority": 131, "when": ["baseContract", "biasContract", "noResidualContract", "denseGroupContract", "spatialOutputContract", "batchDispatchFits", "outputChannelDispatchFits", "exactIm2colBufferFits", "(kernelRows) <= device.limits.maxComputeWorkgroupsPerDimension", "batchSize >= 1", "ceil((outputPixels) / 32) <= device.limits.maxComputeWorkgroupsPerDimension"], "constants": { "hasBias": true, "M": "outChannels", "K": "kernelRows", "N": "outputPixels", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "\"\" == \"_z\"" }, "intermediates": [{ "id": "cols", "dtype": "float32", "shape": "[batchSize * (kernelRows) * (outputPixels)]" }], "passes": [ { "id": "im2col", "name": "Conv.Im2col", "source": { "shader": "conv-im2col-nchw.wgsl.jinja", "inputs": { "kernelH": "kernelHeight", "kernelW": "kernelWidth", "strideH": "strideH", "strideW": "strideW", "dilationH": "dilationH", "dilationW": "dilationW", "padTop": "effectivePadTop", "padLeft": "effectivePadLeft" } }, "bindings": "im2col", "dispatch": { "x": "ceil(outputPixels / tunables.WORKGROUP_SIZE)", "y": "kernelRows", "z": "batchSize" } }, { "id": "gemm", "name": "Conv.Im2colGemmTiledBias", "shader": "conv-1x1-gemm-tiled.wgsl.jinja", "bindings": "tiledGemmBias", "dispatch": { "x": "ceil(outputPixels / 32)", "y": "ceil(outChannels / 32)", "z": "batchSize" } } ] }, { "id": "im2col_gemm_tiled_bias_z", "priority": 131, "when": ["baseContract", "biasContract", "residualContract", "denseGroupContract", "spatialOutputContract", "batchDispatchFits", "outputChannelDispatchFits", "exactIm2colBufferFits", "(kernelRows) <= device.limits.maxComputeWorkgroupsPerDimension", "batchSize >= 1", "ceil((outputPixels) / 32) <= device.limits.maxComputeWorkgroupsPerDimension"], "constants": { "hasBias": true, "M": "outChannels", "K": "kernelRows", "N": "outputPixels", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "\"_z\" == \"_z\"" }, "intermediates": [{ "id": "cols", "dtype": "float32", "shape": "[batchSize * (kernelRows) * (outputPixels)]" }], "passes": [ { "id": "im2col", "name": "Conv.Im2col", "source": { "shader": "conv-im2col-nchw.wgsl.jinja", "inputs": { "kernelH": "kernelHeight", "kernelW": "kernelWidth", "strideH": "strideH", "strideW": "strideW", "dilationH": "dilationH", "dilationW": "dilationW", "padTop": "effectivePadTop", "padLeft": "effectivePadLeft" } }, "bindings": "im2col", "dispatch": { "x": "ceil(outputPixels / tunables.WORKGROUP_SIZE)", "y": "kernelRows", "z": "batchSize" } }, { "id": "gemm", "name": "Conv.Im2colGemmTiledBias", "shader": "conv-1x1-gemm-tiled.wgsl.jinja", "bindings": "tiledGemmBias_z", "dispatch": { "x": "ceil(outputPixels / 32)", "y": "ceil(outChannels / 32)", "z": "batchSize" } } ] }, { "id": "im2col_gemm_tiled_reg", "priority": 132, "when": ["baseContract", "noBiasContract", "noResidualContract", "denseGroupContract", "spatialOutputContract", "batchDispatchFits", "outputChannelDispatchFits", "exactIm2colBufferFits", "kernelRows <= device.limits.maxComputeWorkgroupsPerDimension", "batchSize >= 1", "ceilDiv(outputPixels, im2colRegTile) <= device.limits.maxComputeWorkgroupsPerDimension", "im2colRegDeviceCovered", "im2colRegWorkgroups >= im2colRegMinWorkgroups"], "constants": { "hasBias": false, "gemmKTile": "im2colRegKTile", "gemmMTile": "im2colRegTile", "gemmNTile": "im2colRegTile", "M": "outChannels", "K": "kernelRows", "N": "outputPixels", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": false }, "intermediates": [{ "id": "cols", "dtype": "float32", "shape": "[batchSize * (kernelRows) * (outputPixels)]" }], "passes": [ { "id": "im2col", "name": "Conv.Im2col", "source": { "shader": "conv-im2col-nchw.wgsl.jinja", "inputs": { "kernelH": "kernelHeight", "kernelW": "kernelWidth", "strideH": "strideH", "strideW": "strideW", "dilationH": "dilationH", "dilationW": "dilationW", "padTop": "effectivePadTop", "padLeft": "effectivePadLeft" } }, "bindings": "im2col", "dispatch": { "x": "ceil(outputPixels / tunables.WORKGROUP_SIZE)", "y": "kernelRows", "z": "batchSize" } }, { "id": "gemm", "name": "Conv.Im2colGemmTiledReg", "shader": "conv-1x1-gemm-tiled-reg.wgsl.jinja", "bindings": "tiledGemm", "dispatch": { "x": "ceilDiv(outputPixels, im2colRegTile)", "y": "ceilDiv(outChannels, im2colRegTile)", "z": "batchSize" } } ] }, { "id": "im2col_gemm_tiled_bias_reg", "priority": 133, "when": ["baseContract", "biasContract", "noResidualContract", "denseGroupContract", "spatialOutputContract", "batchDispatchFits", "outputChannelDispatchFits", "exactIm2colBufferFits", "kernelRows <= device.limits.maxComputeWorkgroupsPerDimension", "batchSize >= 1", "ceilDiv(outputPixels, im2colRegTile) <= device.limits.maxComputeWorkgroupsPerDimension", "im2colRegDeviceCovered", "im2colRegWorkgroups >= im2colRegMinWorkgroups"], "constants": { "hasBias": true, "gemmKTile": "im2colRegKTile", "gemmMTile": "im2colRegTile", "gemmNTile": "im2colRegTile", "M": "outChannels", "K": "kernelRows", "N": "outputPixels", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": false }, "intermediates": [{ "id": "cols", "dtype": "float32", "shape": "[batchSize * (kernelRows) * (outputPixels)]" }], "passes": [ { "id": "im2col", "name": "Conv.Im2col", "source": { "shader": "conv-im2col-nchw.wgsl.jinja", "inputs": { "kernelH": "kernelHeight", "kernelW": "kernelWidth", "strideH": "strideH", "strideW": "strideW", "dilationH": "dilationH", "dilationW": "dilationW", "padTop": "effectivePadTop", "padLeft": "effectivePadLeft" } }, "bindings": "im2col", "dispatch": { "x": "ceil(outputPixels / tunables.WORKGROUP_SIZE)", "y": "kernelRows", "z": "batchSize" } }, { "id": "gemm", "name": "Conv.Im2colGemmTiledRegBias", "shader": "conv-1x1-gemm-tiled-reg.wgsl.jinja", "bindings": "tiledGemmBias", "dispatch": { "x": "ceilDiv(outputPixels, im2colRegTile)", "y": "ceilDiv(outChannels, im2colRegTile)", "z": "batchSize" } } ] }, { "id": "gemm_1x1_tiled", "priority": 140, "when": ["baseContract", "noBiasContract", "noResidualContract", "oneByOneContract", "batchDispatchFits", "outputChannelDispatchFits", "ceil(inputPixels / 32) <= device.limits.maxComputeWorkgroupsPerDimension"], "constants": { "hasBias": false, "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "\"\" == \"_z\"" }, "bindings": "gemm1x1", "passes": [ { "id": "main", "name": "Conv.Gemm1x1Tiled", "shader": "conv-1x1-gemm-tiled.wgsl.jinja", "dispatch": { "x": "ceil(inputPixels / 32)", "y": "ceil(outChannels / 32)", "z": "batchSize" } } ] }, { "id": "gemm_1x1_tiled_z", "priority": 140, "when": ["baseContract", "noBiasContract", "residualContract", "oneByOneContract", "batchDispatchFits", "outputChannelDispatchFits", "ceil(inputPixels / 32) <= device.limits.maxComputeWorkgroupsPerDimension"], "constants": { "hasBias": false, "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "\"_z\" == \"_z\"" }, "bindings": "gemm1x1_z", "passes": [ { "id": "main", "name": "Conv.Gemm1x1Tiled", "shader": "conv-1x1-gemm-tiled.wgsl.jinja", "dispatch": { "x": "ceil(inputPixels / 32)", "y": "ceil(outChannels / 32)", "z": "batchSize" } } ] }, { "id": "gemm_1x1_tiled_bias", "priority": 141, "when": ["baseContract", "biasContract", "noResidualContract", "oneByOneContract", "batchDispatchFits", "outputChannelDispatchFits", "ceil(inputPixels / 32) <= device.limits.maxComputeWorkgroupsPerDimension"], "constants": { "hasBias": true, "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "\"\" == \"_z\"" }, "bindings": "gemm1x1Bias", "passes": [ { "id": "main", "name": "Conv.Gemm1x1TiledBias", "shader": "conv-1x1-gemm-tiled.wgsl.jinja", "dispatch": { "x": "ceil(inputPixels / 32)", "y": "ceil(outChannels / 32)", "z": "batchSize" } } ] }, { "id": "gemm_1x1_tiled_bias_z", "priority": 141, "when": ["baseContract", "biasContract", "residualContract", "oneByOneContract", "batchDispatchFits", "outputChannelDispatchFits", "ceil(inputPixels / 32) <= device.limits.maxComputeWorkgroupsPerDimension"], "constants": { "hasBias": true, "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "\"_z\" == \"_z\"" }, "bindings": "gemm1x1Bias_z", "passes": [ { "id": "main", "name": "Conv.Gemm1x1TiledBias", "shader": "conv-1x1-gemm-tiled.wgsl.jinja", "dispatch": { "x": "ceil(inputPixels / 32)", "y": "ceil(outChannels / 32)", "z": "batchSize" } } ] }, { "id": "gemm_1x1_tiled_reg", "priority": 142, "when": ["baseContract", "noBiasContract", "noResidualContract", "oneByOneContract", "batchDispatchFits", "outputChannelDispatchFits", "ceilDiv(inputPixels, im2colRegTile) <= device.limits.maxComputeWorkgroupsPerDimension", "im2colRegDeviceCovered", "im2colRegWorkgroups >= im2colRegMinWorkgroups"], "constants": { "hasBias": false, "gemmKTile": "im2colRegKTile", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": false }, "bindings": "gemm1x1", "passes": [ { "id": "main", "name": "Conv.Gemm1x1TiledReg", "shader": "conv-1x1-gemm-tiled-reg.wgsl.jinja", "dispatch": { "x": "ceilDiv(inputPixels, im2colRegTile)", "y": "ceilDiv(outChannels, im2colRegTile)", "z": "batchSize" } } ] }, { "id": "gemm_1x1_tiled_bias_reg", "priority": 143, "when": ["baseContract", "biasContract", "noResidualContract", "oneByOneContract", "batchDispatchFits", "outputChannelDispatchFits", "ceilDiv(inputPixels, im2colRegTile) <= device.limits.maxComputeWorkgroupsPerDimension", "im2colRegDeviceCovered", "im2colRegWorkgroups >= im2colRegMinWorkgroups"], "constants": { "hasBias": true, "gemmKTile": "im2colRegKTile", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": false }, "bindings": "gemm1x1Bias", "passes": [ { "id": "main", "name": "Conv.Gemm1x1TiledRegBias", "shader": "conv-1x1-gemm-tiled-reg.wgsl.jinja", "dispatch": { "x": "ceilDiv(inputPixels, im2colRegTile)", "y": "ceilDiv(outChannels, im2colRegTile)", "z": "batchSize" } } ] }, { "id": "conv1d_direct", "priority": 60, "when": ["conv1dBaseContract", "noBiasContract", "noResidualContract", "groupOk", "kernelWidth >= 1", "kernelWidth <= 7", "configuredWorkgroupOk"], "constants": { "hasBias": false, "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": false }, "passes": [ { "id": "main", "name": "Conv.DirectUnrolled", "source": { "shader": "conv-direct-unrolled.wgsl.jinja", "inputs": { "kernelH": "kernelHeight", "kernelW": "kernelWidth", "strideH": "strideH", "strideW": "strideW", "dilationH": "dilationH", "dilationW": "dilationW", "padTop": "effectivePadTop", "padLeft": "effectivePadLeft" } }, "dispatch": { "threads": "numel(shapes.Y)", "workgroupSize": "tunables.WORKGROUP_SIZE" } } ], "bindings": "direct2dUnrolled" }, { "id": "direct_unrolled", "priority": 60, "when": ["baseContract", "noBiasContract", "noResidualContract", "spatialOutputContract", "groupOk", "kernelHeight >= 1", "kernelHeight <= 7", "kernelWidth >= 1", "kernelWidth <= 7"], "supersededBy": ["im2col_gemm_tiled_reg", "im2col_gemm_tiled"], "constants": { "hasBias": false, "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "\"\" == \"_z\"" }, "passes": [ { "id": "main", "name": "Conv.DirectUnrolled", "source": { "shader": "conv-direct-unrolled.wgsl.jinja", "inputs": { "kernelH": "kernelHeight", "kernelW": "kernelWidth", "strideH": "strideH", "strideW": "strideW", "dilationH": "dilationH", "dilationW": "dilationW", "padTop": "effectivePadTop", "padLeft": "effectivePadLeft" } }, "dispatch": { "threads": "numel(shapes.Y)", "workgroupSize": "tunables.WORKGROUP_SIZE" } } ], "bindings": "direct2dUnrolled" }, { "id": "direct_unrolled_z", "priority": 60, "when": ["baseContract", "noBiasContract", "residualContract", "spatialOutputContract", "groupOk", "kernelHeight >= 1", "kernelHeight <= 7", "kernelWidth >= 1", "kernelWidth <= 7"], "supersededBy": ["im2col_gemm_tiled_z"], "constants": { "hasBias": false, "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "\"_z\" == \"_z\"" }, "passes": [ { "id": "main", "name": "Conv.DirectUnrolled", "source": { "shader": "conv-direct-unrolled.wgsl.jinja", "inputs": { "kernelH": "kernelHeight", "kernelW": "kernelWidth", "strideH": "strideH", "strideW": "strideW", "dilationH": "dilationH", "dilationW": "dilationW", "padTop": "effectivePadTop", "padLeft": "effectivePadLeft" } }, "dispatch": { "threads": "numel(shapes.Y)", "workgroupSize": "tunables.WORKGROUP_SIZE" } } ], "bindings": "direct2dUnrolled_z" }, { "id": "conv1d_direct_bias", "priority": 61, "when": ["conv1dBaseContract", "biasContract", "noResidualContract", "groupOk", "kernelWidth >= 1", "kernelWidth <= 7", "configuredWorkgroupOk"], "constants": { "hasBias": true, "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": false }, "passes": [ { "id": "main", "name": "Conv.DirectUnrolledBias", "source": { "shader": "conv-direct-unrolled.wgsl.jinja", "inputs": { "kernelH": "kernelHeight", "kernelW": "kernelWidth", "strideH": "strideH", "strideW": "strideW", "dilationH": "dilationH", "dilationW": "dilationW", "padTop": "effectivePadTop", "padLeft": "effectivePadLeft" } }, "dispatch": { "threads": "numel(shapes.Y)", "workgroupSize": "tunables.WORKGROUP_SIZE" } } ], "bindings": "direct2dUnrolledBias" }, { "id": "direct_unrolled_bias", "priority": 61, "when": ["baseContract", "biasContract", "noResidualContract", "spatialOutputContract", "groupOk", "kernelHeight >= 1", "kernelHeight <= 7", "kernelWidth >= 1", "kernelWidth <= 7"], "supersededBy": ["im2col_gemm_tiled_bias_reg", "im2col_gemm_tiled_bias"], "constants": { "hasBias": true, "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "\"\" == \"_z\"" }, "passes": [ { "id": "main", "name": "Conv.DirectUnrolledBias", "source": { "shader": "conv-direct-unrolled.wgsl.jinja", "inputs": { "kernelH": "kernelHeight", "kernelW": "kernelWidth", "strideH": "strideH", "strideW": "strideW", "dilationH": "dilationH", "dilationW": "dilationW", "padTop": "effectivePadTop", "padLeft": "effectivePadLeft" } }, "dispatch": { "threads": "numel(shapes.Y)", "workgroupSize": "tunables.WORKGROUP_SIZE" } } ], "bindings": "direct2dUnrolledBias" }, { "id": "direct_unrolled_bias_z", "priority": 61, "when": ["baseContract", "biasContract", "residualContract", "spatialOutputContract", "groupOk", "kernelHeight >= 1", "kernelHeight <= 7", "kernelWidth >= 1", "kernelWidth <= 7"], "supersededBy": ["im2col_gemm_tiled_bias_z"], "constants": { "hasBias": true, "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "\"_z\" == \"_z\"" }, "passes": [ { "id": "main", "name": "Conv.DirectUnrolledBias", "source": { "shader": "conv-direct-unrolled.wgsl.jinja", "inputs": { "kernelH": "kernelHeight", "kernelW": "kernelWidth", "strideH": "strideH", "strideW": "strideW", "dilationH": "dilationH", "dilationW": "dilationW", "padTop": "effectivePadTop", "padLeft": "effectivePadLeft" } }, "dispatch": { "threads": "numel(shapes.Y)", "workgroupSize": "tunables.WORKGROUP_SIZE" } } ], "bindings": "direct2dUnrolledBias_z" }, { "id": "conv1d_tiled_reg", "priority": 120, "when": ["conv1dBaseContract", "noBiasContract", "noResidualContract", "attrs.group == 1", "kernelChannels == inChannels", "conv1dTiledFit", "conv1dTiledGeometryOk", "conv1dTiledDispatchOk"], "constants": { "hasBias": false, "convWgX": "tunables.CONV1D_WG_X", "convWgY": "tunables.CONV1D_WG_Y", "convKTile": "tunables.CONV1D_K_TILE", "convTileM": "conv1dTileM", "convTileN": "tunables.CONV1D_TILE_N", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta" }, "bindings": "tiled1d", "passes": [ { "id": "main", "name": "Conv.Conv1dTiledReg", "shader": "conv1d-tiled-reg.wgsl.jinja", "dispatch": { "x": "ceilDiv(outputWidth, conv1dBlockN)", "y": "ceilDiv(outChannels, conv1dBlockM)", "z": "batchSize" } } ] }, { "id": "conv1d_tiled_bias_reg", "priority": 121, "when": ["conv1dBaseContract", "biasContract", "noResidualContract", "attrs.group == 1", "kernelChannels == inChannels", "conv1dTiledFit", "conv1dTiledGeometryOk", "conv1dTiledDispatchOk"], "constants": { "hasBias": true, "convWgX": "tunables.CONV1D_WG_X", "convWgY": "tunables.CONV1D_WG_Y", "convKTile": "tunables.CONV1D_K_TILE", "convTileM": "conv1dTileM", "convTileN": "tunables.CONV1D_TILE_N", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta" }, "bindings": "tiled1dBias", "passes": [ { "id": "main", "name": "Conv.Conv1dTiledRegBias", "shader": "conv1d-tiled-reg.wgsl.jinja", "dispatch": { "x": "ceilDiv(outputWidth, conv1dBlockN)", "y": "ceilDiv(outChannels, conv1dBlockM)", "z": "batchSize" } } ] }, { "id": "ncdhw3d", "priority": 60, "when": ["conv3dBaseContract", "noBiasContract", "noResidualContract", "groupOk"], "constants": { "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "present.zResidual" }, "passes": [ { "id": "main", "name": "Conv3d", "source": { "shader": "conv-direct-nd.wgsl.jinja", "inputs": { "spatialRank": 3, "usesF16": "dtypes.T == \"f16\"", "hasBias": "present.bias" } }, "dispatch": { "threads": "numel(shapes.Y)", "workgroupSize": "convWorkgroupSize" } } ], "bindings": "direct3d" }, { "id": "ncdhw3d_z", "priority": 60, "when": ["conv3dBaseContract", "noBiasContract", "residualContract", "groupOk"], "constants": { "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "present.zResidual" }, "passes": [ { "id": "main", "name": "Conv3d", "source": { "shader": "conv-direct-nd.wgsl.jinja", "inputs": { "spatialRank": 3, "usesF16": "dtypes.T == \"f16\"", "hasBias": "present.bias" } }, "dispatch": { "threads": "numel(shapes.Y)", "workgroupSize": "convWorkgroupSize" } } ], "bindings": "direct3d_z" }, { "id": "ncdhw3d_bias", "priority": 61, "when": ["conv3dBaseContract", "biasContract", "noResidualContract", "groupOk"], "constants": { "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "present.zResidual" }, "passes": [ { "id": "main", "name": "Conv3dBias", "source": { "shader": "conv-direct-nd.wgsl.jinja", "inputs": { "spatialRank": 3, "usesF16": "dtypes.T == \"f16\"", "hasBias": "present.bias" } }, "dispatch": { "threads": "numel(shapes.Y)", "workgroupSize": "convWorkgroupSize" } } ], "bindings": "direct3dBias" }, { "id": "ncdhw3d_bias_z", "priority": 61, "when": ["conv3dBaseContract", "biasContract", "residualContract", "groupOk"], "constants": { "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta", "hasZ": "present.zResidual" }, "passes": [ { "id": "main", "name": "Conv3dBias", "source": { "shader": "conv-direct-nd.wgsl.jinja", "inputs": { "spatialRank": 3, "usesF16": "dtypes.T == \"f16\"", "hasBias": "present.bias" } }, "dispatch": { "threads": "numel(shapes.Y)", "workgroupSize": "convWorkgroupSize" } } ], "bindings": "direct3dBias_z" }, { "id": "grouped_large_kernel_w4", "priority": 70, "when": ["baseContract", "noBiasContract", "noResidualContract", "groupOk", "spatialOutputContract", "attrs.group > 1", "outputPixels >= 4 * tunables.GROUPED_WIDE_WORKGROUP_SIZE", "kernelHeight >= tunables.GROUPED_MIN_KERNEL_SIZE", "kernelHeight <= tunables.GROUPED_MAX_KERNEL_SIZE", "kernelWidth >= tunables.GROUPED_MIN_KERNEL_SIZE", "kernelWidth <= tunables.GROUPED_MAX_KERNEL_SIZE", "wave32Adapter or (kernelHeight <= tunables.GROUPED_SCALAR_OC_MAX_KERNEL_SIZE and kernelWidth <= tunables.GROUPED_SCALAR_OC_MAX_KERNEL_SIZE)", "outputWidth > 0", "outputWidth % 4 == 0"], "derive": { "ocTile": "4 if (outChannels / attrs.group) % 4 == 0 else (2 if (outChannels / attrs.group) % 2 == 0 else 1)", "tileWorkgroupSize": "min(tunables.GROUPED_WIDE_WORKGROUP_SIZE if outChannelsPerGroup % 2 == 0 else convWorkgroupSize, convWorkgroupSize)" }, "constants": { "usesF16": "dtypes.T == \"f16\"", "scalar": "dtypes.T", "outputElement": "\"vec4<\" ~ dtypes.T ~ \">\"", "vectorScalar": "\"vec4<\" ~ dtypes.T ~ \">\"", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta" }, "passes": [ { "id": "main", "name": "Conv.GroupedLargeKernelW4", "source": { "shader": "conv2d-grouped-large-w4.wgsl.jinja", "inputs": { "countTiles": "numel(shapes.Y) / (4 * ocTile)", "span": "(kernelWidth - 1) * dilationW + 1 + 3 * strideW", "spanCap": "tunables.GROUPED_MAX_REGISTER_SPAN", "ocTile": "ocTile", "workgroupSize": "tileWorkgroupSize", "outW": "outputWidth", "outW4": "outputWidth / 4", "tailOutput": false, "outH": "outputHeight", "outC": "outChannels", "outCPerGroup": "outChannels / attrs.group", "inC": "inChannels", "inCPerGroup": "inChannels / attrs.group", "inH": "inputHeight", "inW": "inputWidth", "kernelH": "kernelHeight", "kernelW": "kernelWidth", "strideH": "strideH", "strideW": "strideW", "dilationH": "dilationH", "dilationW": "dilationW", "padTop": "effectivePadTop", "padLeft": "effectivePadLeft" } }, "bindings": "grouped", "dispatch": { "threads": "numel(shapes.Y) / (4 * ocTile)", "workgroupSize": "tileWorkgroupSize" } } ] }, { "id": "grouped_large_kernel_w4_tail", "priority": 70, "when": ["baseContract", "noBiasContract", "noResidualContract", "groupOk", "spatialOutputContract", "attrs.group > 1", "outputPixels >= 4 * tunables.GROUPED_WIDE_WORKGROUP_SIZE", "kernelHeight >= tunables.GROUPED_MIN_KERNEL_SIZE", "kernelHeight <= tunables.GROUPED_MAX_KERNEL_SIZE", "kernelWidth >= tunables.GROUPED_MIN_KERNEL_SIZE", "kernelWidth <= tunables.GROUPED_MAX_KERNEL_SIZE", "wave32Adapter or (kernelHeight <= tunables.GROUPED_SCALAR_OC_MAX_KERNEL_SIZE and kernelWidth <= tunables.GROUPED_SCALAR_OC_MAX_KERNEL_SIZE)", "outputWidth > 0", "outputWidth % 4 != 0"], "derive": { "ocTile": "4 if (outChannels / attrs.group) % 4 == 0 else (2 if (outChannels / attrs.group) % 2 == 0 else 1)", "tileWorkgroupSize": "min(tunables.GROUPED_WIDE_WORKGROUP_SIZE if outChannelsPerGroup % 2 == 0 else convWorkgroupSize, convWorkgroupSize)" }, "constants": { "usesF16": "dtypes.T == \"f16\"", "scalar": "dtypes.T", "outputElement": "dtypes.T", "vectorScalar": "\"vec4<\" ~ dtypes.T ~ \">\"", "activation": "activationName", "actAlpha": "activationAlpha", "actBeta": "activationBeta" }, "passes": [ { "id": "main", "name": "Conv.GroupedLargeKernelW4Tail", "source": { "shader": "conv2d-grouped-large-w4.wgsl.jinja", "inputs": { "countTiles": "dim(shapes.Y, 0) * outputHeight * ceilDiv(outputWidth, 4) * (outChannels / ocTile)", "span": "(kernelWidth - 1) * dilationW + 1 + 3 * strideW", "spanCap": "tunables.GROUPED_MAX_REGISTER_SPAN", "ocTile": "ocTile", "workgroupSize": "tileWorkgroupSize", "outW": "outputWidth", "outW4": "ceilDiv(outputWidth, 4)", "tailOutput": true, "outH": "outputHeight", "outC": "outChannels", "outCPerGroup": "outChannels / attrs.group", "inC": "inChannels", "inCPerGroup": "inChannels / attrs.group", "inH": "inputHeight", "inW": "inputWidth", "kernelH": "kernelHeight", "kernelW": "kernelWidth", "strideH": "strideH", "strideW": "strideW", "dilationH": "dilationH", "dilationW": "dilationW", "padTop": "effectivePadTop", "padLeft": "effectivePadLeft" } }, "bindings": "grouped", "dispatch": { "threads": "dim(shapes.Y, 0) * outputHeight * ceilDiv(outputWidth, 4) * (outChannels / ocTile)", "workgroupSize": "tileWorkgroupSize" } } ] } ] }