Xenova's picture
Xenova HF Staff
sync 2e7068faf55e
38770a7 verified
Raw
History Blame
15.7 kB
{
"op": "com.microsoft.MatMulBnb4",
"fixtureArrays": {
"bnb4_weight_cycle_b_t": [1, 35, 69, 103, 137, 171, 205, 239, 254, 220, 186, 152, 118, 84, 50, 16, 90]
},
"cases": [
{
"name": "nf4_scalar_small",
"attrs": { "K": 16, "N": 4, "block_size": 16, "quant_type": 1 },
"inputs": {
"aT": {
"dtype": "float32",
"shape": [3, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 }
},
"bT": {
"dtype": "uint8",
"shape": [32],
"data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/bnb4_weight_cycle_b_t" } }
},
"absmaxT": {
"dtype": "float32",
"shape": [4],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.02, "offset": 0.06 }
}
},
"outputs": { "yT": { "dtype": "float32", "shape": [3, 4], "tolerance": 0.00001 } }
},
{
"name": "fp4_scalar_small",
"attrs": { "K": 16, "N": 4, "block_size": 16, "quant_type": 0 },
"inputs": {
"aT": {
"dtype": "float32",
"shape": [3, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 }
},
"bT": {
"dtype": "uint8",
"shape": [32],
"data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/bnb4_weight_cycle_b_t" } }
},
"absmaxT": {
"dtype": "float32",
"shape": [4],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.02, "offset": 0.06 }
}
},
"outputs": { "yT": { "dtype": "float32", "shape": [3, 4], "tolerance": 0.00001 } }
},
{
"name": "nf4_scalar_block_straddle",
"attrs": { "K": 24, "N": 3, "block_size": 16, "quant_type": 1 },
"inputs": {
"aT": {
"dtype": "float32",
"shape": [2, 24],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 }
},
"bT": {
"dtype": "uint8",
"shape": [36],
"data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/bnb4_weight_cycle_b_t" } }
},
"absmaxT": {
"dtype": "float32",
"shape": [5],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.02, "offset": 0.06 }
}
},
"outputs": { "yT": { "dtype": "float32", "shape": [2, 3], "tolerance": 0.00001 } }
},
{
"name": "nf4_scalar_odd_k",
"attrs": { "K": 33, "N": 5, "block_size": 16, "quant_type": 1 },
"inputs": {
"aT": {
"dtype": "float32",
"shape": [3, 33],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 }
},
"bT": {
"dtype": "uint8",
"shape": [83],
"data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/bnb4_weight_cycle_b_t" } }
},
"absmaxT": {
"dtype": "float32",
"shape": [11],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.02, "offset": 0.06 }
}
},
"outputs": { "yT": { "dtype": "float32", "shape": [3, 5], "tolerance": 0.00001 } }
},
{
"name": "nf4_gemv_decode",
"attrs": { "K": 128, "N": 64, "block_size": 64, "quant_type": 1 },
"inputs": {
"aT": {
"dtype": "float32",
"shape": [1, 128],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 }
},
"bT": {
"dtype": "uint8",
"shape": [4096],
"data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/bnb4_weight_cycle_b_t" } }
},
"absmaxT": {
"dtype": "float32",
"shape": [128],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.02, "offset": 0.06 }
}
},
"outputs": { "yT": { "dtype": "float32", "shape": [1, 64], "tolerance": 0.00002 } }
},
{
"name": "fp4_gemv_decode",
"attrs": { "K": 64, "N": 32, "block_size": 32, "quant_type": 0 },
"inputs": {
"aT": {
"dtype": "float32",
"shape": [1, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 }
},
"bT": {
"dtype": "uint8",
"shape": [1024],
"data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/bnb4_weight_cycle_b_t" } }
},
"absmaxT": {
"dtype": "float32",
"shape": [64],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.02, "offset": 0.06 }
}
},
"outputs": { "yT": { "dtype": "float32", "shape": [1, 32], "tolerance": 0.00001 } }
},
{
"name": "nf4_gemv_ragged_k",
"attrs": { "K": 100, "N": 12, "block_size": 16, "quant_type": 1 },
"inputs": {
"aT": {
"dtype": "float32",
"shape": [1, 100],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 }
},
"bT": {
"dtype": "uint8",
"shape": [600],
"data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/bnb4_weight_cycle_b_t" } }
},
"absmaxT": {
"dtype": "float32",
"shape": [75],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.02, "offset": 0.06 }
}
},
"outputs": { "yT": { "dtype": "float32", "shape": [1, 12], "tolerance": 0.00001 } }
},
{
"name": "nf4_tiled_prefill",
"attrs": { "K": 64, "N": 48, "block_size": 32, "quant_type": 1 },
"inputs": {
"aT": {
"dtype": "float32",
"shape": [32, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 }
},
"bT": {
"dtype": "uint8",
"shape": [1536],
"data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/bnb4_weight_cycle_b_t" } }
},
"absmaxT": {
"dtype": "float32",
"shape": [96],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.02, "offset": 0.06 }
}
},
"outputs": { "yT": { "dtype": "float32", "shape": [32, 48], "tolerance": 0.00002 } }
},
{
"name": "fp4_tiled_prefill",
"attrs": { "K": 64, "N": 48, "block_size": 32, "quant_type": 0 },
"inputs": {
"aT": {
"dtype": "float32",
"shape": [32, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 }
},
"bT": {
"dtype": "uint8",
"shape": [1536],
"data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/bnb4_weight_cycle_b_t" } }
},
"absmaxT": {
"dtype": "float32",
"shape": [96],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.02, "offset": 0.06 }
}
},
"outputs": { "yT": { "dtype": "float32", "shape": [32, 48], "tolerance": 0.00002 } }
},
{
"name": "nf4_sgmat_tall_aligned",
"attrs": { "K": 64, "N": 64, "block_size": 32, "quant_type": 1 },
"inputs": {
"aT": {
"dtype": "float32",
"shape": [128, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 }
},
"bT": {
"dtype": "uint8",
"shape": [2048],
"data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/bnb4_weight_cycle_b_t" } }
},
"absmaxT": {
"dtype": "float32",
"shape": [128],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.02, "offset": 0.06 }
}
},
"outputs": { "yT": { "dtype": "float32", "shape": [128, 64], "tolerance": 0.00002 } }
},
{
"name": "fp4_sgmat_aligned",
"attrs": { "K": 64, "N": 64, "block_size": 32, "quant_type": 0 },
"inputs": {
"aT": {
"dtype": "float32",
"shape": [64, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 }
},
"bT": {
"dtype": "uint8",
"shape": [2048],
"data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/bnb4_weight_cycle_b_t" } }
},
"absmaxT": {
"dtype": "float32",
"shape": [128],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.02, "offset": 0.06 }
}
},
"outputs": { "yT": { "dtype": "float32", "shape": [64, 64], "tolerance": 0.00002 } }
},
{
"name": "nf4_tiled_tail",
"attrs": { "K": 33, "N": 19, "block_size": 16, "quant_type": 1 },
"inputs": {
"aT": {
"dtype": "float32",
"shape": [20, 33],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 }
},
"bT": {
"dtype": "uint8",
"shape": [314],
"data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/bnb4_weight_cycle_b_t" } }
},
"absmaxT": {
"dtype": "float32",
"shape": [40],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.02, "offset": 0.06 }
}
},
"outputs": { "yT": { "dtype": "float32", "shape": [20, 19], "tolerance": 0.00001 } }
},
{
"name": "nf4_tiled_tail_bk32",
"attrs": { "K": 33, "N": 19, "block_size": 16, "quant_type": 1 },
"tunables": { "PORTABLE_TILE_K": 32 },
"inputs": {
"aT": {
"dtype": "float32",
"shape": [20, 33],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 }
},
"bT": {
"dtype": "uint8",
"shape": [314],
"data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/bnb4_weight_cycle_b_t" } }
},
"absmaxT": {
"dtype": "float32",
"shape": [40],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.02, "offset": 0.06 }
}
},
"outputs": { "yT": { "dtype": "float32", "shape": [20, 19], "tolerance": 0.00001 } }
},
{
"name": "fp4_tiled_tail_bk64",
"attrs": { "K": 33, "N": 19, "block_size": 16, "quant_type": 0 },
"tunables": { "PORTABLE_TILE_K": 64 },
"inputs": {
"aT": {
"dtype": "float32",
"shape": [20, 33],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 }
},
"bT": {
"dtype": "uint8",
"shape": [314],
"data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/bnb4_weight_cycle_b_t" } }
},
"absmaxT": {
"dtype": "float32",
"shape": [40],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.02, "offset": 0.06 }
}
},
"outputs": { "yT": { "dtype": "float32", "shape": [20, 19], "tolerance": 0.00001 } }
},
{
"name": "nf4_f16_scalar",
"attrs": { "K": 32, "N": 8, "block_size": 16, "quant_type": 1 },
"inputs": {
"aT": {
"dtype": "float16",
"shape": [3, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 }
},
"bT": {
"dtype": "uint8",
"shape": [128],
"data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/bnb4_weight_cycle_b_t" } }
},
"absmaxT": {
"dtype": "float16",
"shape": [16],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.02, "offset": 0.06 }
}
},
"outputs": { "yT": { "dtype": "float16", "shape": [3, 8], "tolerance": 0.02 } }
},
{
"name": "nf4_f16_gemv",
"attrs": { "K": 64, "N": 16, "block_size": 32, "quant_type": 1 },
"inputs": {
"aT": {
"dtype": "float16",
"shape": [1, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 }
},
"bT": {
"dtype": "uint8",
"shape": [512],
"data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/bnb4_weight_cycle_b_t" } }
},
"absmaxT": {
"dtype": "float16",
"shape": [32],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.02, "offset": 0.06 }
}
},
"outputs": { "yT": { "dtype": "float16", "shape": [1, 16], "tolerance": 0.02 } }
},
{
"name": "nf4_f16_tiled",
"attrs": { "K": 32, "N": 16, "block_size": 32, "quant_type": 1 },
"inputs": {
"aT": {
"dtype": "float16",
"shape": [16, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 }
},
"bT": {
"dtype": "uint8",
"shape": [256],
"data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/bnb4_weight_cycle_b_t" } }
},
"absmaxT": {
"dtype": "float16",
"shape": [16],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.02, "offset": 0.06 }
}
},
"outputs": { "yT": { "dtype": "float16", "shape": [16, 16], "tolerance": 0.02 } }
},
{
"name": "nf4_f16_tiled_longk_m32_k512_n32",
"attrs": { "K": 512, "N": 32, "block_size": 64, "quant_type": 1 },
"inputs": {
"aT": {
"dtype": "float16",
"shape": [32, 512],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 }
},
"bT": {
"dtype": "uint8",
"shape": [8192],
"data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/bnb4_weight_cycle_b_t" } }
},
"absmaxT": {
"dtype": "float16",
"shape": [256],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.02, "offset": 0.06 }
}
},
"outputs": { "yT": { "dtype": "float16", "shape": [32, 32], "tolerance": 0.001, "relTolerance": 0.001 } },
"provenance": {
"notes": "The other f16 fixtures all run K <= 64, where an f16 accumulator is indistinguishable from an f32 one. This one accumulates over K=512 so the tiled path's f32 accumulation is actually pinned."
}
},
{
"name": "nf4_sgmat_widened_f16",
"provenance": {
"notes": "A float16 request on the aligned subgroup-matrix shape. The matrix units take float32 operands and accumulate in float32, so this path widens the activations either side of the multiply rather than using the device's float16 configuration, whose result component is also float16. It is the only case that reaches the widening passes."
},
"attrs": { "K": 64, "N": 64, "block_size": 32, "quant_type": 1 },
"inputs": {
"aT": {
"dtype": "float16",
"shape": [128, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 }
},
"bT": {
"dtype": "uint8",
"shape": [2048],
"data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/bnb4_weight_cycle_b_t" } }
},
"absmaxT": {
"dtype": "float16",
"shape": [128],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.07, "scale": 0.02, "offset": 0.06 }
}
},
"outputs": { "yT": { "dtype": "float16", "shape": [128, 64], "tolerance": 0.002, "relTolerance": 0.002 } }
}
]
}