sync c928d21e6cc1
Browse filesFiles changed (4)
94 unmodified lines959697989910010114 unmodified lines11611711811912012112294 unmodified lines}},"outputs": { "yT": { "shape": [512, 4096], "dtype": "float32" } },"bench": { "metrics": [{ "type": "gflops", "value": "2 * dim(shapes.aT, 0) * args.K * args.N" }] }},{"name": "bnb4-nf4-prefill-m512-k4096-n4096-b64-f16",14 unmodified lines}},"outputs": { "yT": { "shape": [512, 4096], "dtype": "float16" } },"bench": { "metrics": [{ "type": "gflops", "value": "2 * dim(shapes.aT, 0) * args.K * args.N" }] }}]}94 unmodified lines959697989910010110214 unmodified lines11711811912012112212312494 unmodified lines}},"outputs": { "yT": { "shape": [512, 4096], "dtype": "float32" } },"bench": { "metrics": [{ "type": "gflops", "value": "2 * dim(shapes.aT, 0) * args.K * args.N" }] },"tunableSpace": { "PORTABLE_TILE_K": [16, 32, 64] }},{"name": "bnb4-nf4-prefill-m512-k4096-n4096-b64-f16",14 unmodified lines}},"outputs": { "yT": { "shape": [512, 4096], "dtype": "float16" } },"bench": { "metrics": [{ "type": "gflops", "value": "2 * dim(shapes.aT, 0) * args.K * args.N" }] },"tunableSpace": { "PORTABLE_TILE_K": [16, 32, 64] }}]}
190 unmodified lines19119219319419519651 unmodified lines24824925025125225325425525625729 unmodified lines287288289290291292293294295296190 unmodified lines},"derive": {"deviceWorkgroupCap": "min(device.limits.maxComputeInvocationsPerWorkgroup, device.limits.maxComputeWorkgroupSizeX)","packedBytesExpected": "ceilDiv(attrs.N * attrs.K, 2)","absmaxCountExpected": "ceilDiv(attrs.N * attrs.K, attrs.block_size)","aFloatOk": "(tensorDtypes.A == \"float32\" or tensorDtypes.A == \"float16\") and f16Ok(tensorDtypes.A)",51 unmodified lines"requires": {"features": ["subgroups", "chromium-experimental-subgroup-matrix"],"limits": { "maxComputeWorkgroupStorageSize": 8192 },"subgroupMinSize": 32,"subgroupMatrixConfigs": [{ "componentType": "f32", "resultComponentType": "f32", "M": 8, "N": 8, "K": 8 }]},"when": ["commonShapeValid", "tensorDtypes.A == \"float32\"", "dim(shapes.A, 0) >= sgmatTileRows", "dim(shapes.A, 0) % sgmatTileRows == 0", "attrs.N % tunables.SGMAT_TILE_COLS == 0", "attrs.K % tunables.SGMAT_TILE_K == 0", "attrs.K % attrs.block_size == 0", "attrs.block_size % sgmatLoadWidth == 0", "has(device.adapterInfo, \"subgroupMinSize\")", "has(device.adapterInfo, \"subgroupMaxSize\")", "device.adapterInfo.subgroupMinSize == 32", "device.adapterInfo.subgroupMaxSize == 32", "sgmatWorkgroupFits"],"constants": {"K": "attrs.K","N": "attrs.N",29 unmodified lines"requires": {"features": ["subgroups", "chromium-experimental-subgroup-matrix"],"limits": { "maxComputeWorkgroupStorageSize": 8192 },"subgroupMinSize": 32,"subgroupMatrixConfigs": [{ "componentType": "f32", "resultComponentType": "f32", "M": 8, "N": 8, "K": 8 }]},"when": ["commonShapeValid", "tensorDtypes.A == \"float16\"", "dim(shapes.A, 0) >= sgmatTileRows", "dim(shapes.A, 0) % sgmatTileRows == 0", "attrs.N % tunables.SGMAT_TILE_COLS == 0", "attrs.K % tunables.SGMAT_TILE_K == 0", "attrs.K % attrs.block_size == 0", "attrs.block_size % sgmatLoadWidth == 0", "has(device.adapterInfo, \"subgroupMinSize\")", "has(device.adapterInfo, \"subgroupMaxSize\")", "device.adapterInfo.subgroupMinSize == 32", "device.adapterInfo.subgroupMaxSize == 32", "sgmatWorkgroupFits", "sgmatWidenFits"],"constants": {"K": "attrs.K","N": "attrs.N",190 unmodified lines19119219319419519619719819920051 unmodified lines25225325425525625725825926029 unmodified lines290291292293294295296297298190 unmodified lines},"derive": {"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","packedBytesExpected": "ceilDiv(attrs.N * attrs.K, 2)","absmaxCountExpected": "ceilDiv(attrs.N * attrs.K, attrs.block_size)","aFloatOk": "(tensorDtypes.A == \"float32\" or tensorDtypes.A == \"float16\") and f16Ok(tensorDtypes.A)",51 unmodified lines"requires": {"features": ["subgroups", "chromium-experimental-subgroup-matrix"],"limits": { "maxComputeWorkgroupStorageSize": 8192 },"subgroupMatrixConfigs": [{ "componentType": "f32", "resultComponentType": "f32", "M": 8, "N": 8, "K": 8 }]},"when": ["commonShapeValid", "tensorDtypes.A == \"float32\"", "dim(shapes.A, 0) >= sgmatTileRows", "dim(shapes.A, 0) % sgmatTileRows == 0", "attrs.N % tunables.SGMAT_TILE_COLS == 0", "attrs.K % tunables.SGMAT_TILE_K == 0", "attrs.K % attrs.block_size == 0", "attrs.block_size % sgmatLoadWidth == 0", "wave32Effective", "sgmatWorkgroupFits"],"constants": {"K": "attrs.K","N": "attrs.N",29 unmodified lines"requires": {"features": ["subgroups", "chromium-experimental-subgroup-matrix"],"limits": { "maxComputeWorkgroupStorageSize": 8192 },"subgroupMatrixConfigs": [{ "componentType": "f32", "resultComponentType": "f32", "M": 8, "N": 8, "K": 8 }]},"when": ["commonShapeValid", "tensorDtypes.A == \"float16\"", "dim(shapes.A, 0) >= sgmatTileRows", "dim(shapes.A, 0) % sgmatTileRows == 0", "attrs.N % tunables.SGMAT_TILE_COLS == 0", "attrs.K % tunables.SGMAT_TILE_K == 0", "attrs.K % attrs.block_size == 0", "attrs.block_size % sgmatLoadWidth == 0", "wave32Effective", "sgmatWorkgroupFits", "sgmatWidenFits"],"constants": {"K": "attrs.K","N": "attrs.N",
2 unmodified lines34567863 unmodified lines7273747576777819 unmodified lines98991001011021031041051061071081091101115 unmodified lines1171181191201211221231241251261272 unmodified lines// This specialization operates on full A, B, and output tiles, so both// subgroupMatrixLoad and the direct output stores are in bounds.enable subgroups;enable chromium_experimental_subgroup_matrix;{% if usesF16 %}// The widened path keeps the activations and the output in f32 for the matrix63 unmodified lines}}@compute @workgroup_size({{ workgroupSize }}, 1, 1)fn main(@builtin(workgroup_id) workgroup_id: vec3<u32>,@builtin(local_invocation_index) local_idx: u32,19 unmodified linesfor (var step = 0u; step < TILE_K; step += {{ matrixSize }}u) {let matrix_a_offset = (a_base + base_A) * K + k_base + step;{% for row in range(rowMatrices) %}let matA{{ row }} = subgroupMatrixLoad<subgroup_matrix_left<f32, {{ matrixSize }}, {{ matrixSize }}>>(&a, matrix_a_offset + {{ row * matrixSize }}u * K, false, K);{% endfor %}let matrix_b_offset = subtile_idx * SUB_COLS * TILE_K + step;{% for col in range(colMatrices) %}let matB{{ col }} = subgroupMatrixLoad<subgroup_matrix_right<f32, {{ matrixSize }}, {{ matrixSize }}>>(&tile_B, matrix_b_offset + {{ col * matrixSize }}u * TILE_K, true, TILE_K);{% endfor %}{% for row in range(rowMatrices) %}{% for col in range(colMatrices) %}5 unmodified lineslet output_offset = (a_base + base_A) * N + b_base + base_B;{% for row in range(rowMatrices) %}{% for col in range(colMatrices) %}subgroupMatrixStore(&y,output_offset + {{ row * matrixSize }}u * N + {{ col * matrixSize }}u,matC{{ row }}{{ col }},false,N);{% endfor %}{% endfor %}2 unmodified lines3456789101163 unmodified lines7576777879808119 unmodified lines1011021031041051061071081091101111121131145 unmodified lines1201211221231241251261271281292 unmodified lines// This specialization operates on full A, B, and output tiles, so both// subgroupMatrixLoad and the direct output stores are in bounds.enable subgroups;{% if pinSubgroupSize32 %}enable subgroup_size_control;{% endif %}enable chromium_experimental_subgroup_matrix;{% if usesF16 %}// The widened path keeps the activations and the output in f32 for the matrix63 unmodified lines}}@compute @workgroup_size({{ workgroupSize }}, 1, 1){{ " @subgroup_size(32)" if pinSubgroupSize32 else "" }}fn main(@builtin(workgroup_id) workgroup_id: vec3<u32>,@builtin(local_invocation_index) local_idx: u32,19 unmodified linesfor (var step = 0u; step < TILE_K; step += {{ matrixSize }}u) {let matrix_a_offset = (a_base + base_A) * K + k_base + step;{% for row in range(rowMatrices) %}let matA{{ row }} = subgroupMatrixLoad<subgroup_matrix_left<f32, {{ matrixSize }}, {{ matrixSize }}>, row_major>(&a, matrix_a_offset + {{ row * matrixSize }}u * K, K);{% endfor %}let matrix_b_offset = subtile_idx * SUB_COLS * TILE_K + step;{% for col in range(colMatrices) %}let matB{{ col }} = subgroupMatrixLoad<subgroup_matrix_right<f32, {{ matrixSize }}, {{ matrixSize }}>, col_major>(&tile_B, matrix_b_offset + {{ col * matrixSize }}u * TILE_K, TILE_K);{% endfor %}{% for row in range(rowMatrices) %}{% for col in range(colMatrices) %}5 unmodified lineslet output_offset = (a_base + base_A) * N + b_base + base_B;{% for row in range(rowMatrices) %}{% for col in range(colMatrices) %}subgroupMatrixStore<row_major>(&y,output_offset + {{ row * matrixSize }}u * N + {{ col * matrixSize }}u,matC{{ row }}{{ col }},N);{% endfor %}{% endfor %}
12345678910111213141516171819202122{"name": "com.microsoft.MatMulBnb4","id": "_com_microsoft_matmulbnb4_webgpu_0097122","version": 1,"license": "Apache-2.0","backend": { "type": "webgpu" },"digest": {"algorithm": "sha256","files": {"bench.json": "doteNv/ofPVMbmfcGye+YHqSiBcZ65LVeDl4oDWa1Ec=","cast-scalar-x4.wgsl.jinja": "uplwFdE8dJSffJop4txQHZgeGDDJ5K9+F3V4n1CotVo=","manifest.json": "c2kZSTr7EnI+nB6vtDMF30I5Io1qYvCJwr69mQJxeD8=","matmul-bnb4-gemv.wgsl.jinja": "7e4ZY+raLAMG/wmXm72XpSzPsR6adHvvrcKxv2ZKj/4=","matmul-bnb4-sgmat.wgsl.jinja": "tm3SCGjsEM1jwLUR0W4WdjU75y8NcOSsa/1vt81YryE=","matmul-bnb4-tiled.wgsl.jinja": "+pb1pUgFU+RLITtJ+zrnTDl3LUmU7sZDGqIdyKtAmn4=","matmul-bnb4.wgsl.jinja": "xzeJm4jFqbXih7plcQup4jUQsRw4h8HpLzcAxWR2aic=","test.json": "1oYDh6veLTUP+o7nE+G7nU1FMK88nLKArXE/FcbOfTo="}},"provenance": { "kernel": { "sha": "2e7068faf55e7f43df740015f6d1ee49391a41c5", "dirty": false } },"webgpu": { "manifestSpec": "1.0", "specialized": true, "opPath": "ops/com.microsoft.MatMulBnb4" }}12345678910111213141516171819202122{"name": "com.microsoft.MatMulBnb4","id": "_com_microsoft_matmulbnb4_webgpu_aab3ed9","version": 1,"license": "Apache-2.0","backend": { "type": "webgpu" },"digest": {"algorithm": "sha256","files": {"bench.json": "65V0CAoAl7vsenxQG3P5y9j0T4tJEprrb5BwhczZ/So=","cast-scalar-x4.wgsl.jinja": "uplwFdE8dJSffJop4txQHZgeGDDJ5K9+F3V4n1CotVo=","manifest.json": "TFYtgeuCmTA2Ei4kkTZQ2PUcZP7JT9DEynhMUofG+BU=","matmul-bnb4-gemv.wgsl.jinja": "7e4ZY+raLAMG/wmXm72XpSzPsR6adHvvrcKxv2ZKj/4=","matmul-bnb4-sgmat.wgsl.jinja": "x3RRM9yb0++oJ2o6qqmhx+qwCqb2MAZui1Pdlof6nsU=","matmul-bnb4-tiled.wgsl.jinja": "+pb1pUgFU+RLITtJ+zrnTDl3LUmU7sZDGqIdyKtAmn4=","matmul-bnb4.wgsl.jinja": "xzeJm4jFqbXih7plcQup4jUQsRw4h8HpLzcAxWR2aic=","test.json": "1oYDh6veLTUP+o7nE+G7nU1FMK88nLKArXE/FcbOfTo="}},"provenance": { "kernel": { "sha": "c928d21e6cc1310861cba3bafb75f5f679ecf5f3", "dirty": false } },"webgpu": { "manifestSpec": "1.0", "specialized": true, "opPath": "ops/com.microsoft.MatMulBnb4" }}
build/webgpu/bench.json+4-2
build/webgpu/manifest.json+6-4
build/webgpu/matmul-bnb4-sgmat.wgsl.jinja+9-7
build/webgpu/metadata.json+5-5