File size: 11,188 Bytes
fe90e05 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | {
"op": "com.microsoft.GemmFastGelu",
"cases": [
{
"name": "rank2_bias_f32",
"provenance": {
"notes": "A plain (M, K) x (K, N) with bias, both dimensions past one 64-wide tile so the kernel's tile loop and its bounds checks both run."
},
"inputs": {
"X": {
"dtype": "float32",
"shape": [96, 80],
"data": { "kind": "fillFloat32", "scale": 0.9, "sinStep": 0.18000000000000002, "cosStep": 0.32 }
},
"W": {
"dtype": "float32",
"shape": [80, 72],
"data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.12, "cosStep": 0.24000000000000002 }
},
"bias": {
"dtype": "float32",
"shape": [72],
"data": { "kind": "fillFloat32", "scale": 0.4, "sinStep": 0.3, "cosStep": 0.14 }
}
},
"outputs": { "Y": { "dtype": "float32", "shape": [96, 72], "tolerance": 0.00002, "relTolerance": 0.0002 } }
},
{
"name": "rank2_nobias_f32",
"provenance": { "notes": "The same shape without a bias, which takes the other binding set." },
"inputs": {
"X": {
"dtype": "float32",
"shape": [96, 80],
"data": { "kind": "fillFloat32", "scale": 0.9, "sinStep": 0.19, "cosStep": 0.33 }
},
"W": {
"dtype": "float32",
"shape": [80, 72],
"data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.13, "cosStep": 0.25 }
}
},
"outputs": { "Y": { "dtype": "float32", "shape": [96, 72], "tolerance": 0.00002, "relTolerance": 0.0002 } }
},
{
"name": "rank3_batched_bias_f32",
"provenance": {
"notes": "A rank-3 X: every leading axis is another row, so a (2, 48, 64) input is a 96-row product rather than a batched matmul."
},
"inputs": {
"X": {
"dtype": "float32",
"shape": [2, 48, 64],
"data": { "kind": "fillFloat32", "scale": 0.9, "sinStep": 0.2, "cosStep": 0.33999999999999997 }
},
"W": {
"dtype": "float32",
"shape": [64, 40],
"data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.14, "cosStep": 0.26 }
},
"bias": {
"dtype": "float32",
"shape": [40],
"data": { "kind": "fillFloat32", "scale": 0.4, "sinStep": 0.31999999999999995, "cosStep": 0.16 }
}
},
"outputs": { "Y": { "dtype": "float32", "shape": [2, 48, 40], "tolerance": 0.00002, "relTolerance": 0.0002 } }
},
{
"name": "rank4_batched_nobias_f32",
"provenance": {
"notes": "Rank 4, no bias -- the leading-axis collapse must not depend on how many axes there are."
},
"inputs": {
"X": {
"dtype": "float32",
"shape": [2, 3, 16, 32],
"data": { "kind": "fillFloat32", "scale": 0.9, "sinStep": 0.21000000000000002, "cosStep": 0.35 }
},
"W": {
"dtype": "float32",
"shape": [32, 24],
"data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.15, "cosStep": 0.27 }
}
},
"outputs": { "Y": { "dtype": "float32", "shape": [2, 3, 16, 24], "tolerance": 0.00002, "relTolerance": 0.0002 } }
},
{
"name": "small_unaligned_bias_f32",
"provenance": {
"notes": "M, K and N all smaller than one tile and none a multiple of the 4x4 micro-tile, so every bounds check is exercised."
},
"inputs": {
"X": {
"dtype": "float32",
"shape": [7, 13],
"data": { "kind": "fillFloat32", "scale": 0.9, "sinStep": 0.22000000000000003, "cosStep": 0.36 }
},
"W": {
"dtype": "float32",
"shape": [13, 11],
"data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.16, "cosStep": 0.28 }
},
"bias": {
"dtype": "float32",
"shape": [11],
"data": { "kind": "fillFloat32", "scale": 0.4, "sinStep": 0.33999999999999997, "cosStep": 0.18 }
}
},
"outputs": { "Y": { "dtype": "float32", "shape": [7, 11], "tolerance": 0.00002, "relTolerance": 0.0002 } }
},
{
"name": "single_row_bias_f32",
"provenance": { "notes": "One row: the GEMV shape, where the M tile is almost entirely padding." },
"inputs": {
"X": {
"dtype": "float32",
"shape": [1, 64],
"data": { "kind": "fillFloat32", "scale": 0.9, "sinStep": 0.23, "cosStep": 0.37 }
},
"W": {
"dtype": "float32",
"shape": [64, 48],
"data": {
"kind": "fillFloat32",
"scale": 0.5,
"sinStep": 0.16999999999999998,
"cosStep": 0.29000000000000004
}
},
"bias": {
"dtype": "float32",
"shape": [48],
"data": { "kind": "fillFloat32", "scale": 0.4, "sinStep": 0.35, "cosStep": 0.19 }
}
},
"outputs": { "Y": { "dtype": "float32", "shape": [1, 48], "tolerance": 0.00002, "relTolerance": 0.0002 } }
},
{
"name": "f16_rank3_bias",
"provenance": {
"notes": "float16 operands; the product accumulates in f32 and the activation runs before the single narrowing store."
},
"inputs": {
"X": {
"dtype": "float16",
"shape": [2, 32, 48],
"data": { "kind": "fillFloat32", "scale": 0.9, "sinStep": 0.24000000000000002, "cosStep": 0.38 }
},
"W": {
"dtype": "float16",
"shape": [48, 32],
"data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.18, "cosStep": 0.30000000000000004 }
},
"bias": {
"dtype": "float16",
"shape": [32],
"data": { "kind": "fillFloat32", "scale": 0.4, "sinStep": 0.36, "cosStep": 0.2 }
}
},
"outputs": { "Y": { "dtype": "float16", "shape": [2, 32, 32], "tolerance": 0.006, "relTolerance": 0.006 } }
},
{
"name": "f16_rank2_nobias",
"provenance": { "notes": "float16 without a bias." },
"inputs": {
"X": {
"dtype": "float16",
"shape": [48, 32],
"data": { "kind": "fillFloat32", "scale": 0.9, "sinStep": 0.25, "cosStep": 0.39 }
},
"W": {
"dtype": "float16",
"shape": [32, 24],
"data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.19, "cosStep": 0.31 }
}
},
"outputs": { "Y": { "dtype": "float16", "shape": [48, 24], "tolerance": 0.006, "relTolerance": 0.006 } }
},
{
"name": "pinned_rank2_bias",
"provenance": {
"notes": "Hand-computed from the schema's FastGelu definition -- 0.5x(1 + tanh(sqrt(2/pi)(x + 0.044715 x^3))) -- applied to a float64 product, independent of the port's tiling and of its shared gelu helper. The operands are large enough that FastGelu is well outside its near-linear region, so the pin is sensitive to the activation itself."
},
"inputs": {
"X": {
"dtype": "float32",
"shape": [5, 6],
"data": {
"kind": "values",
"values": [-0.568, 1.402, -1.744, 0.805, -0.684, -0.366, -1.898, -0.274, 0.008, -1.719, 0.344, 1.185, -0.865, 1.863, -0.792, 1.783, 0.703, -0.614, -1.244, 1.186, 1.21, -0.428, -0.236, 1.268, -1.492, -1.469, 0.673, 1.956, -1.883, -0.872]
}
},
"W": {
"dtype": "float32",
"shape": [6, 4],
"data": {
"kind": "values",
"values": [-0.362, -1.699, 1.664, -0.171, 0.412, -0.373, -1.421, 1.657, 1.194, -0.13, -1.707, -0.827, -0.156, -1.618, 1.339, -0.16, -1.723, 1.951, 0.603, 1.677, 1.217, 0.273, 1.35, 0.713]
}
},
"bias": {
"dtype": "float32",
"shape": [4],
"data": { "kind": "values", "values": [-0.818, 0.02, 0.585, 0.387] }
}
},
"outputs": {
"Y": {
"dtype": "float32",
"shape": [5, 4],
"data": {
"kind": "values",
"values": [-0.099208, -0.041387, 0.626313, 2.704125, 0.716692, 7.121855, -0.009083, 1.89771, -0.004677, -0.16984, -0.072533, 4.732758, 3.581808, 2.075684, -0.000021, 2.106721, 1.733585, -0.000052, -0.167767, -0.0]
},
"tolerance": 0.00002,
"relTolerance": 0.0002
}
}
},
{
"name": "sgmat_aligned_bias_f32",
"provenance": {
"notes": "M, K and N all meet the subgroup-matrix gate (M >= 32, K % 32 == 0, N % 64 == 0), so this is the fixture that selects sgmat_bias rather than the tiled kernel. Two row tiles and two column tiles past the 32x64 tile, so the tile loop runs and the fused gelu is checked on every store site."
},
"inputs": {
"X": {
"dtype": "float32",
"shape": [64, 64],
"data": { "kind": "fillFloat32", "scale": 0.7, "sinStep": 0.13, "cosStep": 0.29 }
},
"W": {
"dtype": "float32",
"shape": [64, 128],
"data": { "kind": "fillFloat32", "scale": 0.4, "sinStep": 0.21, "cosStep": 0.17 }
},
"bias": {
"dtype": "float32",
"shape": [128],
"data": { "kind": "fillFloat32", "scale": 0.3, "sinStep": 0.11, "cosStep": 0.37 }
}
},
"outputs": { "Y": { "dtype": "float32", "shape": [64, 128], "tolerance": 0.00002, "relTolerance": 0.0002 } }
},
{
"name": "sgmat_aligned_nobias_f32",
"provenance": {
"notes": "The no-bias arm of the same gate: sgmat renders its store without the bias term, which is a separate set of write sites from the bias arm."
},
"inputs": {
"X": {
"dtype": "float32",
"shape": [96, 96],
"data": { "kind": "fillFloat32", "scale": 0.7, "sinStep": 0.13, "cosStep": 0.29 }
},
"W": {
"dtype": "float32",
"shape": [96, 192],
"data": { "kind": "fillFloat32", "scale": 0.4, "sinStep": 0.21, "cosStep": 0.17 }
}
},
"outputs": { "Y": { "dtype": "float32", "shape": [96, 192], "tolerance": 0.00002, "relTolerance": 0.0002 } }
},
{
"name": "sgmat_aligned_bias_f16",
"provenance": {
"notes": "f16 operands drive the matrix units at their f16 component type while the accumulator and the fused gelu stay f32. The f16 gate admits M >= 2, so this also covers a row count under one tile."
},
"inputs": {
"X": {
"dtype": "float16",
"shape": [32, 64],
"data": { "kind": "fillFloat32", "scale": 0.7, "sinStep": 0.13, "cosStep": 0.29 }
},
"W": {
"dtype": "float16",
"shape": [64, 128],
"data": { "kind": "fillFloat32", "scale": 0.4, "sinStep": 0.21, "cosStep": 0.17 }
},
"bias": {
"dtype": "float16",
"shape": [128],
"data": { "kind": "fillFloat32", "scale": 0.3, "sinStep": 0.11, "cosStep": 0.37 }
}
},
"outputs": { "Y": { "dtype": "float16", "shape": [32, 128], "tolerance": 0.02, "relTolerance": 0.02 } }
}
]
}
|