File size: 16,107 Bytes
078aa71 e3afd9e 078aa71 e3afd9e 078aa71 2e68766 078aa71 2e68766 078aa71 e3afd9e 078aa71 | 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 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 | {
"cases": [
{
"name": "rank3_h8_vec4_gate_beta",
"provenance": {
"notes": "Head count 8 (divisible by four) exercises four-wide beta computation in the (B,T,H) layout; a 2e-6 tolerance covers float32 Softplus rounding near where its log1p-based series approximation switches."
},
"inputs": {
"aT": {
"dtype": "float32",
"shape": [2, 3, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.17, "scale": 2.5 }
},
"dtBiasT": { "dtype": "float32", "shape": [8], "data": { "kind": "linspace", "start": -1.5, "end": 1.1 } },
"decayScaleT": { "dtype": "float32", "shape": [8], "data": { "kind": "linspace", "start": -3.2, "end": -0.15 } },
"bT": {
"dtype": "float32",
"shape": [2, 3, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.13, "scale": 3.0 }
}
},
"outputs": {
"decayT": { "dtype": "float32", "shape": [2, 3, 8], "tolerance": 0, "relTolerance": 0.000002 },
"betaT": { "dtype": "float32", "shape": [2, 3, 8], "tolerance": 0, "relTolerance": 0.000002 }
}
},
{
"name": "rank2_h6_scalar_gate_beta",
"provenance": {
"notes": "Head count 6 is not a multiple of four, so four-wide parameter mapping does not apply; a rank-2 (no batch dimension) input checks per-head computation one head at a time."
},
"inputs": {
"aT": {
"dtype": "float32",
"shape": [5, 6],
"data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.19, "scale": 2.2 }
},
"dtBiasT": { "dtype": "float32", "shape": [6], "data": { "kind": "linspace", "start": -2.0, "end": 0.9 } },
"decayScaleT": { "dtype": "float32", "shape": [6], "data": { "kind": "linspace", "start": -2.6, "end": -0.2 } },
"bT": {
"dtype": "float32",
"shape": [5, 6],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 2.8 }
}
},
"outputs": {
"decayT": { "dtype": "float32", "shape": [5, 6], "tolerance": 0, "relTolerance": 0.000002 },
"betaT": { "dtype": "float32", "shape": [5, 6], "tolerance": 0, "relTolerance": 0.000002 }
}
},
{
"name": "rank4_h4_vec4_gate_only",
"provenance": {
"notes": "Rank 4 proves the leading axes are folded rather than parsed: only the last axis is the head axis. No b input, so no beta output. Covers vec4_gate."
},
"inputs": {
"aT": {
"dtype": "float32",
"shape": [2, 2, 3, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.41, "cosStep": 0.23, "scale": 3.1 }
},
"dtBiasT": {
"dtype": "float32",
"shape": [4],
"data": { "kind": "values", "values": [-1.25, 0.4, 1.75, -0.6] }
},
"decayScaleT": {
"dtype": "float32",
"shape": [4],
"data": { "kind": "values", "values": [-1.5, -0.35, -2.8, -0.9] }
}
},
"outputs": { "decayT": { "dtype": "float32", "shape": [2, 2, 3, 4], "tolerance": 0, "relTolerance": 0.000002 } }
},
{
"name": "rank1_h5_scalar_gate_only",
"provenance": {
"notes": "Rank 1 is the single-token decode shape: the whole tensor is one head row, so every element reads a different parameter slot. Covers scalar_gate."
},
"inputs": {
"aT": {
"dtype": "float32",
"shape": [5],
"data": { "kind": "values", "values": [-9.5, -1.25, 0.0, 2.5, 14.0] }
},
"dtBiasT": {
"dtype": "float32",
"shape": [5],
"data": { "kind": "values", "values": [0.75, -0.5, 1.25, -1.75, 0.3] }
},
"decayScaleT": {
"dtype": "float32",
"shape": [5],
"data": { "kind": "values", "values": [-0.4, -1.6, -3.05, -0.85, -2.2] }
}
},
"outputs": { "decayT": { "dtype": "float32", "shape": [5], "tolerance": 0, "relTolerance": 0.000002 } }
},
{
"name": "b_without_beta_is_ignored",
"provenance": {
"notes": "The schema requires `b` when beta is requested but permits `b` when beta is omitted. This case supplies unused `b` without beta."
},
"inputs": {
"aT": {
"dtype": "float32",
"shape": [2, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.27, "cosStep": 0.19, "scale": 1.7 }
},
"dtBiasT": { "dtype": "float32", "shape": [4], "data": { "kind": "linspace", "start": -0.7, "end": 0.8 } },
"decayScaleT": {
"dtype": "float32",
"shape": [4],
"data": { "kind": "values", "values": [-0.5, -1.0, -1.5, -2.0] }
},
"bT": {
"dtype": "float32",
"shape": [2, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.43, "cosStep": 0.11, "scale": 4.0 }
}
},
"outputs": { "decayT": { "dtype": "float32", "shape": [2, 4], "tolerance": 0, "relTolerance": 0.000002 } }
},
{
"name": "rank2_h4_vec4_pinned_head_parameters",
"provenance": {
"notes": "Expected values are derived directly from the gating equation. Row 0 sets `a + dt_bias` to zero in every head, so Softplus equals ln(2) and each decay differs only by `decay_scale`. Row 1 sets the value to 25, where the guarded Softplus branch returns x exactly. Beta inputs cover both sigmoid signs at 0, +/-1, +/-2, and +/-6."
},
"inputs": {
"aT": {
"dtype": "float32",
"shape": [2, 4],
"data": { "kind": "values", "values": [0.0, -1.0, 1.0, -0.5, 25.0, 24.0, 26.0, 24.5] }
},
"dtBiasT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.0, 1.0, -1.0, 0.5] } },
"decayScaleT": {
"dtype": "float32",
"shape": [4],
"data": { "kind": "values", "values": [-1.0, -2.0, -0.5, -4.0] }
},
"bT": {
"dtype": "float32",
"shape": [2, 4],
"data": { "kind": "values", "values": [0.0, 6.0, -6.0, 1.0, -1.0, 2.0, -2.0, 0.0] }
}
},
"outputs": {
"decayT": {
"dtype": "float32",
"shape": [2, 4],
"data": {
"kind": "values",
"values": [-0.69314718, -1.3862944, -0.34657359, -2.7725887, -25.0, -50.0, -12.5, -100.0]
},
"tolerance": 0,
"relTolerance": 0.000001
},
"betaT": {
"dtype": "float32",
"shape": [2, 4],
"data": {
"kind": "values",
"values": [0.5, 0.99752738, 0.0024726232, 0.73105858, 0.26894142, 0.88079708, 0.11920292, 0.5]
},
"tolerance": 0,
"relTolerance": 0.000001
}
}
},
{
"name": "rank2_h5_scalar_pinned_saturation",
"provenance": {
"notes": "Hand-computed on the scalar path (head count 5). Both rows bias to one shared value -- 25 in row 0 (the x > 20 softplus identity) and 0 in row 1 (ln 2) -- so the five distinct decay values in each row are exactly the five decay_scale entries times one constant. That is the per-head parameter index, index % head_count, stated as arithmetic."
},
"inputs": {
"aT": {
"dtype": "float32",
"shape": [2, 5],
"data": { "kind": "values", "values": [24.5, 25.5, 25.0, 23.0, 27.0, -0.5, 0.5, 0.0, -2.0, 2.0] }
},
"dtBiasT": {
"dtype": "float32",
"shape": [5],
"data": { "kind": "values", "values": [0.5, -0.5, 0.0, 2.0, -2.0] }
},
"decayScaleT": {
"dtype": "float32",
"shape": [5],
"data": { "kind": "values", "values": [-1.0, -2.0, -0.25, -4.0, -0.5] }
},
"bT": {
"dtype": "float32",
"shape": [2, 5],
"data": { "kind": "values", "values": [-6.0, -2.0, 0.0, 2.0, 6.0, -1.0, -0.25, 0.25, 1.0, 3.0] }
}
},
"outputs": {
"decayT": {
"dtype": "float32",
"shape": [2, 5],
"data": {
"kind": "values",
"values": [-25.0, -50.0, -6.25, -100.0, -12.5, -0.69314718, -1.3862944, -0.1732868, -2.7725887, -0.34657359]
},
"tolerance": 0,
"relTolerance": 0.000001
},
"betaT": {
"dtype": "float32",
"shape": [2, 5],
"data": {
"kind": "values",
"values": [0.0024726232, 0.11920292, 0.5, 0.88079708, 0.99752738, 0.26894142, 0.4378235, 0.5621765, 0.73105858, 0.95257413]
},
"tolerance": 0,
"relTolerance": 0.000001
}
}
},
{
"name": "f16_rank3_h8_vec4_gate_beta",
"provenance": {
"notes": "float16 a/b/decay/beta with float32 dt_bias and decay_scale -- the schema's T/TF split. The gate arithmetic still runs in f32 and only the store narrows."
},
"inputs": {
"aT": {
"dtype": "float16",
"shape": [2, 3, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.17, "scale": 2.5 }
},
"dtBiasT": { "dtype": "float32", "shape": [8], "data": { "kind": "linspace", "start": -1.5, "end": 1.1 } },
"decayScaleT": { "dtype": "float32", "shape": [8], "data": { "kind": "linspace", "start": -3.2, "end": -0.15 } },
"bT": {
"dtype": "float16",
"shape": [2, 3, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.13, "scale": 3.0 }
}
},
"outputs": {
"decayT": { "dtype": "float16", "shape": [2, 3, 8], "tolerance": 0, "relTolerance": 0.002 },
"betaT": { "dtype": "float16", "shape": [2, 3, 8], "tolerance": 0, "relTolerance": 0.002 }
}
},
{
"name": "f16_rank2_h6_scalar_gate_beta",
"provenance": { "notes": "float16 gate tensors on the scalar path (head count 6)." },
"inputs": {
"aT": {
"dtype": "float16",
"shape": [5, 6],
"data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.19, "scale": 2.2 }
},
"dtBiasT": { "dtype": "float32", "shape": [6], "data": { "kind": "linspace", "start": -2.0, "end": 0.9 } },
"decayScaleT": { "dtype": "float32", "shape": [6], "data": { "kind": "linspace", "start": -2.6, "end": -0.2 } },
"bT": {
"dtype": "float16",
"shape": [5, 6],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.11, "scale": 2.8 }
}
},
"outputs": {
"decayT": { "dtype": "float16", "shape": [5, 6], "tolerance": 0, "relTolerance": 0.002 },
"betaT": { "dtype": "float16", "shape": [5, 6], "tolerance": 0, "relTolerance": 0.002 }
}
},
{
"name": "ort_gate_float_decode_h32",
"inputs": {
"aT": {
"dtype": "float32",
"shape": [1, 1, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.17, "scale": 6.0 }
},
"dtBiasT": { "dtype": "float32", "shape": [32], "data": { "kind": "linspace", "start": -2.0, "end": 2.0 } },
"decayScaleT": { "dtype": "float32", "shape": [32], "data": { "kind": "linspace", "start": -4.0, "end": -0.1 } },
"bT": {
"dtype": "float32",
"shape": [1, 1, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.13, "scale": 6.0 }
}
},
"outputs": {
"decayT": { "dtype": "float32", "shape": [1, 1, 32], "tolerance": 0, "relTolerance": 0.000002 },
"betaT": { "dtype": "float32", "shape": [1, 1, 32], "tolerance": 0, "relTolerance": 0.000002 }
}
},
{
"name": "ort_gate_float_speculative_decode_tile_h32",
"inputs": {
"aT": {
"dtype": "float32",
"shape": [1, 4, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.17, "scale": 6.0 }
},
"dtBiasT": { "dtype": "float32", "shape": [32], "data": { "kind": "linspace", "start": -2.0, "end": 2.0 } },
"decayScaleT": { "dtype": "float32", "shape": [32], "data": { "kind": "linspace", "start": -4.0, "end": -0.1 } },
"bT": {
"dtype": "float32",
"shape": [1, 4, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.13, "scale": 6.0 }
}
},
"outputs": {
"decayT": { "dtype": "float32", "shape": [1, 4, 32], "tolerance": 0, "relTolerance": 0.000002 },
"betaT": { "dtype": "float32", "shape": [1, 4, 32], "tolerance": 0, "relTolerance": 0.000002 }
}
},
{
"name": "ort_gate_float_decay_only_h16",
"inputs": {
"aT": {
"dtype": "float32",
"shape": [2, 3, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.17, "scale": 6.0 }
},
"dtBiasT": { "dtype": "float32", "shape": [16], "data": { "kind": "linspace", "start": -2.0, "end": 2.0 } },
"decayScaleT": { "dtype": "float32", "shape": [16], "data": { "kind": "linspace", "start": -4.0, "end": -0.1 } }
},
"outputs": { "decayT": { "dtype": "float32", "shape": [2, 3, 16], "tolerance": 0, "relTolerance": 0.000002 } }
},
{
"name": "ort_gate_float16_speculative_decode_tile_h32",
"inputs": {
"aT": {
"dtype": "float16",
"shape": [1, 4, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.17, "scale": 6.0 }
},
"dtBiasT": { "dtype": "float32", "shape": [32], "data": { "kind": "linspace", "start": -2.0, "end": 2.0 } },
"decayScaleT": { "dtype": "float32", "shape": [32], "data": { "kind": "linspace", "start": -4.0, "end": -0.1 } },
"bT": {
"dtype": "float16",
"shape": [1, 4, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.13, "scale": 6.0 }
}
},
"outputs": {
"decayT": { "dtype": "float16", "shape": [1, 4, 32], "tolerance": 0, "relTolerance": 0.002 },
"betaT": { "dtype": "float16", "shape": [1, 4, 32], "tolerance": 0, "relTolerance": 0.002 }
}
},
{
"name": "ort_gate_float16_prefill_h32",
"inputs": {
"aT": {
"dtype": "float16",
"shape": [2, 37, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.17, "scale": 6.0 }
},
"dtBiasT": { "dtype": "float32", "shape": [32], "data": { "kind": "linspace", "start": -2.0, "end": 2.0 } },
"decayScaleT": { "dtype": "float32", "shape": [32], "data": { "kind": "linspace", "start": -4.0, "end": -0.1 } },
"bT": {
"dtype": "float16",
"shape": [2, 37, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.13, "scale": 6.0 }
}
},
"outputs": {
"decayT": { "dtype": "float16", "shape": [2, 37, 32], "tolerance": 0, "relTolerance": 0.002 },
"betaT": { "dtype": "float16", "shape": [2, 37, 32], "tolerance": 0, "relTolerance": 0.002 }
}
},
{
"name": "ort_gate_float16_ragged_tail_h7",
"inputs": {
"aT": {
"dtype": "float16",
"shape": [1, 5, 7],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.17, "scale": 6.0 }
},
"dtBiasT": { "dtype": "float32", "shape": [7], "data": { "kind": "linspace", "start": -2.0, "end": 2.0 } },
"decayScaleT": { "dtype": "float32", "shape": [7], "data": { "kind": "linspace", "start": -4.0, "end": -0.1 } },
"bT": {
"dtype": "float16",
"shape": [1, 5, 7],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.13, "scale": 6.0 }
}
},
"outputs": {
"decayT": { "dtype": "float16", "shape": [1, 5, 7], "tolerance": 0, "relTolerance": 0.002 },
"betaT": { "dtype": "float16", "shape": [1, 5, 7], "tolerance": 0, "relTolerance": 0.002 }
}
}
]
}
|