File size: 34,775 Bytes
2da2397 | 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 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 | {
"op": "com.microsoft.PagedAttention",
"cases": [
{
"name": "two_sequences_gqa",
"provenance": {
"notes": "Two packed sequences with different histories. The first sequence's two new tokens land at absolute slots 3 and 4, so the scatter crosses a block boundary and the attention reads two physical blocks."
},
"attrs": { "num_heads": 4, "kv_num_heads": 2 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [5, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.9 }
},
"keyT": {
"dtype": "float16",
"shape": [5, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.13, "scale": 0.8 }
},
"valueT": {
"dtype": "float16",
"shape": [5, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.41, "cosStep": 0.07, "scale": 0.7 }
},
"keyCacheT": {
"dtype": "float16",
"shape": [6, 4, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.37, "scale": 0.6 }
},
"valueCacheT": {
"dtype": "float16",
"shape": [6, 4, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.19, "scale": 0.5 }
},
"cumulativeSequenceLengthT": {
"dtype": "int32",
"shape": [3],
"data": { "kind": "values", "values": [0, 2, 5] }
},
"pastSeqlensT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [3, 0] } },
"blockTableT": { "dtype": "int32", "shape": [2, 3], "data": { "kind": "values", "values": [0, 1, 2, 3, 4, 5] } }
},
"outputs": { "outputT": { "dtype": "float16", "shape": [5, 32], "tolerance": 0.00001, "relTolerance": 0.0001 } }
},
{
"name": "two_sequences_packed_qkv",
"provenance": { "notes": "Same schedule with Q, K and V packed on one query row." },
"attrs": { "num_heads": 4, "kv_num_heads": 2 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [5, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.9 }
},
"keyCacheT": {
"dtype": "float16",
"shape": [6, 4, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.37, "scale": 0.6 }
},
"valueCacheT": {
"dtype": "float16",
"shape": [6, 4, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.19, "scale": 0.5 }
},
"cumulativeSequenceLengthT": {
"dtype": "int32",
"shape": [3],
"data": { "kind": "values", "values": [0, 2, 5] }
},
"pastSeqlensT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [3, 0] } },
"blockTableT": { "dtype": "int32", "shape": [2, 3], "data": { "kind": "values", "values": [0, 1, 2, 3, 4, 5] } }
},
"outputs": { "outputT": { "dtype": "float16", "shape": [5, 32], "tolerance": 0.00001, "relTolerance": 0.0001 } }
},
{
"name": "two_sequences_key_cache_output",
"provenance": {
"notes": "Requests only the updated key-cache alias; the paired schema value-cache output remains internal."
},
"attrs": { "num_heads": 4, "kv_num_heads": 2 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [5, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.9 }
},
"keyT": {
"dtype": "float16",
"shape": [5, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.13, "scale": 0.8 }
},
"valueT": {
"dtype": "float16",
"shape": [5, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.41, "cosStep": 0.07, "scale": 0.7 }
},
"keyCacheT": {
"dtype": "float16",
"shape": [6, 4, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.37, "scale": 0.6 }
},
"valueCacheT": {
"dtype": "float16",
"shape": [6, 4, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.19, "scale": 0.5 }
},
"cumulativeSequenceLengthT": {
"dtype": "int32",
"shape": [3],
"data": { "kind": "values", "values": [0, 2, 5] }
},
"pastSeqlensT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [3, 0] } },
"blockTableT": { "dtype": "int32", "shape": [2, 3], "data": { "kind": "values", "values": [0, 1, 2, 3, 4, 5] } }
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [5, 32], "tolerance": 0.00001, "relTolerance": 0.0001 },
"keyCacheT": { "dtype": "float16", "shape": [6, 4, 2, 8], "tolerance": 0.00001, "relTolerance": 0.0001 }
}
},
{
"name": "explicit_scale",
"attrs": { "num_heads": 4, "kv_num_heads": 2, "scale": 0.125, "is_causal": 1 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [5, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.9 }
},
"keyT": {
"dtype": "float16",
"shape": [5, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.13, "scale": 0.8 }
},
"valueT": {
"dtype": "float16",
"shape": [5, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.41, "cosStep": 0.07, "scale": 0.7 }
},
"keyCacheT": {
"dtype": "float16",
"shape": [6, 4, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.37, "scale": 0.6 }
},
"valueCacheT": {
"dtype": "float16",
"shape": [6, 4, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.19, "scale": 0.5 }
},
"cumulativeSequenceLengthT": {
"dtype": "int32",
"shape": [3],
"data": { "kind": "values", "values": [0, 2, 5] }
},
"pastSeqlensT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [3, 0] } },
"blockTableT": { "dtype": "int32", "shape": [2, 3], "data": { "kind": "values", "values": [0, 1, 2, 3, 4, 5] } }
},
"outputs": { "outputT": { "dtype": "float16", "shape": [5, 32], "tolerance": 0.00001, "relTolerance": 0.0001 } }
},
{
"name": "slot_mapping_explicit",
"provenance": {
"notes": "slot_mapping names each token's flat cache slot directly; these values reproduce the derived mapping, and this case requests only the updated value-cache alias."
},
"attrs": { "num_heads": 4, "kv_num_heads": 2 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [5, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.9 }
},
"keyT": {
"dtype": "float16",
"shape": [5, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.13, "scale": 0.8 }
},
"valueT": {
"dtype": "float16",
"shape": [5, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.41, "cosStep": 0.07, "scale": 0.7 }
},
"keyCacheT": {
"dtype": "float16",
"shape": [6, 4, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.37, "scale": 0.6 }
},
"valueCacheT": {
"dtype": "float16",
"shape": [6, 4, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.19, "scale": 0.5 }
},
"cumulativeSequenceLengthT": {
"dtype": "int32",
"shape": [3],
"data": { "kind": "values", "values": [0, 2, 5] }
},
"pastSeqlensT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [3, 0] } },
"blockTableT": { "dtype": "int32", "shape": [2, 3], "data": { "kind": "values", "values": [0, 1, 2, 3, 4, 5] } },
"slotMappingT": { "dtype": "int32", "shape": [5], "data": { "kind": "values", "values": [3, 4, 12, 13, 14] } }
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [5, 32], "tolerance": 0.00001, "relTolerance": 0.0001 },
"valueCacheT": { "dtype": "float16", "shape": [6, 4, 2, 8], "tolerance": 0.00001, "relTolerance": 0.0001 }
}
},
{
"name": "slot_mapping_skips_token",
"provenance": {
"notes": "A slot of -1 suppresses that token's cache write, which a scheduler uses for a prefix-cache hit or a rejected speculative token. The cache slot keeps its prior contents and attention still reads it."
},
"attrs": { "num_heads": 4, "kv_num_heads": 2 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [5, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.9 }
},
"keyT": {
"dtype": "float16",
"shape": [5, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.13, "scale": 0.8 }
},
"valueT": {
"dtype": "float16",
"shape": [5, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.41, "cosStep": 0.07, "scale": 0.7 }
},
"keyCacheT": {
"dtype": "float16",
"shape": [6, 4, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.37, "scale": 0.6 }
},
"valueCacheT": {
"dtype": "float16",
"shape": [6, 4, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.19, "scale": 0.5 }
},
"cumulativeSequenceLengthT": {
"dtype": "int32",
"shape": [3],
"data": { "kind": "values", "values": [0, 2, 5] }
},
"pastSeqlensT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [3, 0] } },
"blockTableT": { "dtype": "int32", "shape": [2, 3], "data": { "kind": "values", "values": [0, 1, 2, 3, 4, 5] } },
"slotMappingT": { "dtype": "int32", "shape": [5], "data": { "kind": "values", "values": [3, -1, 12, 13, 14] } }
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [5, 32], "tolerance": 0.00001, "relTolerance": 0.0001 },
"keyCacheT": { "dtype": "float16", "shape": [6, 4, 2, 8], "tolerance": 0.00001, "relTolerance": 0.0001 },
"valueCacheT": { "dtype": "float16", "shape": [6, 4, 2, 8], "tolerance": 0.00001, "relTolerance": 0.0001 }
}
},
{
"name": "packed_qkv_slot_mapping",
"provenance": {
"notes": "Packed [Q|K|V] with an explicit slot mapping, so the scatter reads K and V out of the query row and binds no schedule tensors at all."
},
"attrs": { "num_heads": 4, "kv_num_heads": 2 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [5, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.9 }
},
"keyCacheT": {
"dtype": "float16",
"shape": [6, 4, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.37, "scale": 0.6 }
},
"valueCacheT": {
"dtype": "float16",
"shape": [6, 4, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.19, "scale": 0.5 }
},
"cumulativeSequenceLengthT": {
"dtype": "int32",
"shape": [3],
"data": { "kind": "values", "values": [0, 2, 5] }
},
"pastSeqlensT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [3, 0] } },
"blockTableT": { "dtype": "int32", "shape": [2, 3], "data": { "kind": "values", "values": [0, 1, 2, 3, 4, 5] } },
"slotMappingT": { "dtype": "int32", "shape": [5], "data": { "kind": "values", "values": [3, 4, 12, 13, 14] } }
},
"outputs": {
"outputT": { "dtype": "float16", "shape": [5, 32], "tolerance": 0.00001, "relTolerance": 0.0001 },
"keyCacheT": { "dtype": "float16", "shape": [6, 4, 2, 8], "tolerance": 0.00001, "relTolerance": 0.0001 },
"valueCacheT": { "dtype": "float16", "shape": [6, 4, 2, 8], "tolerance": 0.00001, "relTolerance": 0.0001 }
}
},
{
"name": "single_sequence_decode",
"provenance": {
"notes": "One decode token whose history spans two full blocks and lands at the start of the third."
},
"attrs": { "num_heads": 4, "kv_num_heads": 2 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [1, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.9 }
},
"keyT": {
"dtype": "float16",
"shape": [1, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.13, "scale": 0.8 }
},
"valueT": {
"dtype": "float16",
"shape": [1, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.41, "cosStep": 0.07, "scale": 0.7 }
},
"keyCacheT": {
"dtype": "float16",
"shape": [3, 4, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.37, "scale": 0.6 }
},
"valueCacheT": {
"dtype": "float16",
"shape": [3, 4, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.19, "scale": 0.5 }
},
"cumulativeSequenceLengthT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 1] } },
"pastSeqlensT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [7] } },
"blockTableT": { "dtype": "int32", "shape": [1, 3], "data": { "kind": "values", "values": [0, 1, 2] } }
},
"outputs": { "outputT": { "dtype": "float16", "shape": [1, 32], "tolerance": 0.00001, "relTolerance": 0.0001 } }
},
{
"name": "equal_head_counts",
"provenance": { "notes": "num_heads equals kv_num_heads, so the grouped-query mapping is the identity." },
"attrs": { "num_heads": 4, "kv_num_heads": 4 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [5, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.9 }
},
"keyT": {
"dtype": "float16",
"shape": [5, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.13, "scale": 0.8 }
},
"valueT": {
"dtype": "float16",
"shape": [5, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.41, "cosStep": 0.07, "scale": 0.7 }
},
"keyCacheT": {
"dtype": "float16",
"shape": [6, 4, 4, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.37, "scale": 0.6 }
},
"valueCacheT": {
"dtype": "float16",
"shape": [6, 4, 4, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.19, "scale": 0.5 }
},
"cumulativeSequenceLengthT": {
"dtype": "int32",
"shape": [3],
"data": { "kind": "values", "values": [0, 2, 5] }
},
"pastSeqlensT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [3, 0] } },
"blockTableT": { "dtype": "int32", "shape": [2, 3], "data": { "kind": "values", "values": [0, 1, 2, 3, 4, 5] } }
},
"outputs": { "outputT": { "dtype": "float16", "shape": [5, 32], "tolerance": 0.00001, "relTolerance": 0.0001 } }
},
{
"name": "long_history_multi_tile",
"provenance": {
"notes": "A 71-key history exceeds one workgroup tile, and the block table is deliberately not the identity, so the online-softmax merge runs over multiple tiles rather than a single one."
},
"attrs": { "num_heads": 2, "kv_num_heads": 1 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [1, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.9 }
},
"keyT": {
"dtype": "float16",
"shape": [1, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.13, "scale": 0.8 }
},
"valueT": {
"dtype": "float16",
"shape": [1, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.41, "cosStep": 0.07, "scale": 0.7 }
},
"keyCacheT": {
"dtype": "float16",
"shape": [9, 8, 1, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.37, "scale": 0.6 }
},
"valueCacheT": {
"dtype": "float16",
"shape": [9, 8, 1, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.19, "scale": 0.5 }
},
"cumulativeSequenceLengthT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 1] } },
"pastSeqlensT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [70] } },
"blockTableT": {
"dtype": "int32",
"shape": [1, 9],
"data": { "kind": "values", "values": [5, 2, 8, 0, 7, 1, 6, 3, 4] }
}
},
"outputs": { "outputT": { "dtype": "float16", "shape": [1, 16], "tolerance": 0.00001, "relTolerance": 0.0001 } }
},
{
"name": "head_size_16",
"provenance": {
"notes": "A head dimension wider than the tile's per-thread share, so the accumulator loop strides."
},
"attrs": { "num_heads": 2, "kv_num_heads": 1 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [3, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.9 }
},
"keyT": {
"dtype": "float16",
"shape": [3, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.13, "scale": 0.8 }
},
"valueT": {
"dtype": "float16",
"shape": [3, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.41, "cosStep": 0.07, "scale": 0.7 }
},
"keyCacheT": {
"dtype": "float16",
"shape": [4, 4, 1, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.37, "scale": 0.6 }
},
"valueCacheT": {
"dtype": "float16",
"shape": [4, 4, 1, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.19, "scale": 0.5 }
},
"cumulativeSequenceLengthT": {
"dtype": "int32",
"shape": [3],
"data": { "kind": "values", "values": [0, 2, 3] }
},
"pastSeqlensT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 5] } },
"blockTableT": { "dtype": "int32", "shape": [2, 2], "data": { "kind": "values", "values": [0, 1, 2, 3] } }
},
"outputs": { "outputT": { "dtype": "float16", "shape": [3, 32], "tolerance": 0.00001, "relTolerance": 0.0001 } }
},
{
"name": "f16_two_sequences",
"attrs": { "num_heads": 4, "kv_num_heads": 2 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [5, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.9 }
},
"keyT": {
"dtype": "float16",
"shape": [5, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.13, "scale": 0.8 }
},
"valueT": {
"dtype": "float16",
"shape": [5, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.41, "cosStep": 0.07, "scale": 0.7 }
},
"keyCacheT": {
"dtype": "float16",
"shape": [6, 4, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.37, "scale": 0.6 }
},
"valueCacheT": {
"dtype": "float16",
"shape": [6, 4, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.19, "scale": 0.5 }
},
"cumulativeSequenceLengthT": {
"dtype": "int32",
"shape": [3],
"data": { "kind": "values", "values": [0, 2, 5] }
},
"pastSeqlensT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [3, 0] } },
"blockTableT": { "dtype": "int32", "shape": [2, 3], "data": { "kind": "values", "values": [0, 1, 2, 3, 4, 5] } }
},
"outputs": { "outputT": { "dtype": "float16", "shape": [5, 32], "tolerance": 0.004, "relTolerance": 0.01 } }
},
{
"name": "f16_packed_qkv",
"attrs": { "num_heads": 4, "kv_num_heads": 2 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [5, 64],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.9 }
},
"keyCacheT": {
"dtype": "float16",
"shape": [6, 4, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.37, "scale": 0.6 }
},
"valueCacheT": {
"dtype": "float16",
"shape": [6, 4, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.19, "scale": 0.5 }
},
"cumulativeSequenceLengthT": {
"dtype": "int32",
"shape": [3],
"data": { "kind": "values", "values": [0, 2, 5] }
},
"pastSeqlensT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [3, 0] } },
"blockTableT": { "dtype": "int32", "shape": [2, 3], "data": { "kind": "values", "values": [0, 1, 2, 3, 4, 5] } }
},
"outputs": { "outputT": { "dtype": "float16", "shape": [5, 32], "tolerance": 0.004, "relTolerance": 0.01 } }
},
{
"name": "pinned_paged_history",
"provenance": {
"notes": "Expected values computed by an independent implementation written from the ONNX Runtime schema text alone, with every tensor value rounded to its declared float16 dtype before evaluation, so this case checks the trusted reference as well as the kernels. The block table [2, 0, 1] is deliberately not the identity, so a kernel that ignored it would read the wrong blocks; the two new tokens land in blocks 0 and 1 respectively."
},
"attrs": { "num_heads": 2, "kv_num_heads": 1 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [2, 4],
"data": { "kind": "values", "values": [0.7854, 1.0234, 1.039, 0.8123, 0.3859, -0.1448, -0.6562, -1.028] }
},
"keyT": {
"dtype": "float16",
"shape": [2, 2],
"data": { "kind": "values", "values": [-0.3046, -0.0781, 0.1597, 0.3877] }
},
"valueT": {
"dtype": "float16",
"shape": [2, 2],
"data": { "kind": "values", "values": [0.5647, 0.756, 0.8391, 0.7958] }
},
"keyCacheT": {
"dtype": "float16",
"shape": [3, 2, 1, 2],
"data": {
"kind": "values",
"values": [0.2751, 0.3295, 0.3637, 0.3794, 0.3798, 0.369, 0.3514, 0.3311, 0.3118, 0.296, 0.2849, 0.2785]
}
},
"valueCacheT": {
"dtype": "float16",
"shape": [3, 2, 1, 2],
"data": {
"kind": "values",
"values": [-0.0755, 0.1377, 0.2257, 0.1768, 0.0339, -0.1232, -0.2093, -0.1675, 0.0079, 0.2677, 0.5238, 0.6804]
}
},
"cumulativeSequenceLengthT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 2] } },
"pastSeqlensT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2] } },
"blockTableT": { "dtype": "int32", "shape": [1, 3], "data": { "kind": "values", "values": [2, 0, 1] } }
},
"outputs": {
"outputT": {
"dtype": "float16",
"shape": [2, 4],
"data": {
"kind": "values",
"values": [0.32763671875, 0.5322265625, 0.32470703125, 0.52978515625, 0.4765625, 0.6181640625, 0.4970703125, 0.64599609375]
},
"tolerance": 0.000001,
"relTolerance": 0.00001
},
"keyCacheT": {
"dtype": "float16",
"shape": [3, 2, 1, 2],
"data": {
"kind": "values",
"values": [-0.3046, -0.0781, 0.1597, 0.3877, 0.3798, 0.369, 0.3514, 0.3311, 0.3118, 0.296, 0.2849, 0.2785]
},
"tolerance": 0.000001,
"relTolerance": 0.000001
},
"valueCacheT": {
"dtype": "float16",
"shape": [3, 2, 1, 2],
"data": {
"kind": "values",
"values": [0.5647, 0.756, 0.8391, 0.7958, 0.0339, -0.1232, -0.2093, -0.1675, 0.0079, 0.2677, 0.5238, 0.6804]
},
"tolerance": 0.000001,
"relTolerance": 0.000001
}
}
},
{
"name": "splitk_multi_split_history",
"provenance": {
"notes": "A 301-key history over a 512-key block table, which is what puts the split-K schedule above its two-split floor: four contiguous key ranges of 76 keys each cross a workgroup tile boundary, so every range runs the tile loop more than once and the merge folds four non-empty online states. Grouped-query (2 query heads per KV head) so the split epilogue writes both streams."
},
"attrs": { "num_heads": 2, "kv_num_heads": 1 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [1, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.9 }
},
"keyT": {
"dtype": "float16",
"shape": [1, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.13, "scale": 0.8 }
},
"valueT": {
"dtype": "float16",
"shape": [1, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.41, "cosStep": 0.07, "scale": 0.7 }
},
"keyCacheT": {
"dtype": "float16",
"shape": [64, 8, 1, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.37, "scale": 0.6 }
},
"valueCacheT": {
"dtype": "float16",
"shape": [64, 8, 1, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.19, "scale": 0.5 }
},
"cumulativeSequenceLengthT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 1] } },
"pastSeqlensT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [300] } },
"blockTableT": {
"dtype": "int32",
"shape": [1, 64],
"data": {
"kind": "values",
"values": [3, 10, 17, 24, 31, 38, 45, 52, 59, 2, 9, 16, 23, 30, 37, 44, 51, 58, 1, 8, 15, 22, 29, 36, 43, 50, 57, 0, 7, 14, 21, 28, 35, 42, 49, 56, 63, 6, 13, 20, 27, 34, 41, 48, 55, 62, 5, 12, 19, 26, 33, 40, 47, 54, 61, 4, 11, 18, 25, 32, 39, 46, 53, 60]
}
}
},
"outputs": { "outputT": { "dtype": "float16", "shape": [1, 16], "tolerance": 0.00001, "relTolerance": 0.0001 } }
},
{
"name": "splitk_empty_trailing_split",
"provenance": {
"notes": "One key of history over a 256-key block table: the split schedule is two ranges of one key each, so the second range covers nothing. It is the split that must write the (-FLT_MAX, 0) identity rather than a normalized row, and the merge must fold that identity away."
},
"attrs": { "num_heads": 2, "kv_num_heads": 1 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [1, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.9 }
},
"keyT": {
"dtype": "float16",
"shape": [1, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.13, "scale": 0.8 }
},
"valueT": {
"dtype": "float16",
"shape": [1, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.41, "cosStep": 0.07, "scale": 0.7 }
},
"keyCacheT": {
"dtype": "float16",
"shape": [32, 8, 1, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.37, "scale": 0.6 }
},
"valueCacheT": {
"dtype": "float16",
"shape": [32, 8, 1, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.19, "scale": 0.5 }
},
"cumulativeSequenceLengthT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 1] } },
"pastSeqlensT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
"blockTableT": {
"dtype": "int32",
"shape": [1, 32],
"data": {
"kind": "values",
"values": [5, 12, 19, 26, 1, 8, 15, 22, 29, 4, 11, 18, 25, 0, 7, 14, 21, 28, 3, 10, 17, 24, 31, 6, 13, 20, 27, 2, 9, 16, 23, 30]
}
}
},
"outputs": { "outputT": { "dtype": "float16", "shape": [1, 16], "tolerance": 0.00001, "relTolerance": 0.0001 } }
},
{
"name": "splitk_slot_mapping",
"provenance": {
"notes": "The split-K schedule with an explicit slot mapping instead of a derived write slot: same 201-key history over a 256-key block table, so the two split ranges both run and the scatter pass takes the slot-mapping arm."
},
"attrs": { "num_heads": 2, "kv_num_heads": 1 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [1, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.9 }
},
"keyT": {
"dtype": "float16",
"shape": [1, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.13, "scale": 0.8 }
},
"valueT": {
"dtype": "float16",
"shape": [1, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.41, "cosStep": 0.07, "scale": 0.7 }
},
"keyCacheT": {
"dtype": "float16",
"shape": [32, 8, 1, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.37, "scale": 0.6 }
},
"valueCacheT": {
"dtype": "float16",
"shape": [32, 8, 1, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.19, "scale": 0.5 }
},
"cumulativeSequenceLengthT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 1] } },
"pastSeqlensT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [200] } },
"blockTableT": {
"dtype": "int32",
"shape": [1, 32],
"data": {
"kind": "values",
"values": [7, 14, 21, 28, 3, 10, 17, 24, 31, 6, 13, 20, 27, 2, 9, 16, 23, 30, 5, 12, 19, 26, 1, 8, 15, 22, 29, 4, 11, 18, 25, 0]
}
},
"slotMappingT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [176] } }
},
"outputs": { "outputT": { "dtype": "float16", "shape": [1, 16], "tolerance": 0.00001, "relTolerance": 0.0001 } }
},
{
"name": "splitk_packed_qkv",
"provenance": {
"notes": "The split-K schedule reading a packed [Q; K; V] query row, so the split pass strides the packed query layout while the merge writes the unpacked output."
},
"attrs": { "num_heads": 2, "kv_num_heads": 1 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [1, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.9 }
},
"keyCacheT": {
"dtype": "float16",
"shape": [32, 8, 1, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.37, "scale": 0.6 }
},
"valueCacheT": {
"dtype": "float16",
"shape": [32, 8, 1, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.19, "scale": 0.5 }
},
"cumulativeSequenceLengthT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 1] } },
"pastSeqlensT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [200] } },
"blockTableT": {
"dtype": "int32",
"shape": [1, 32],
"data": {
"kind": "values",
"values": [9, 16, 23, 30, 5, 12, 19, 26, 1, 8, 15, 22, 29, 4, 11, 18, 25, 0, 7, 14, 21, 28, 3, 10, 17, 24, 31, 6, 13, 20, 27, 2]
}
}
},
"outputs": { "outputT": { "dtype": "float16", "shape": [1, 16], "tolerance": 0.00001, "relTolerance": 0.0001 } }
},
{
"name": "splitk_packed_qkv_slot_mapping",
"provenance": {
"notes": "The split-K schedule with both a packed query row and an explicit slot mapping, the last of the four scatter/query combinations the family covers."
},
"attrs": { "num_heads": 2, "kv_num_heads": 1 },
"inputs": {
"queryT": {
"dtype": "float16",
"shape": [1, 32],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31, "scale": 0.9 }
},
"keyCacheT": {
"dtype": "float16",
"shape": [32, 8, 1, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.37, "scale": 0.6 }
},
"valueCacheT": {
"dtype": "float16",
"shape": [32, 8, 1, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.29, "cosStep": 0.19, "scale": 0.5 }
},
"cumulativeSequenceLengthT": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 1] } },
"pastSeqlensT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [200] } },
"blockTableT": {
"dtype": "int32",
"shape": [1, 32],
"data": {
"kind": "values",
"values": [11, 18, 25, 0, 7, 14, 21, 28, 3, 10, 17, 24, 31, 6, 13, 20, 27, 2, 9, 16, 23, 30, 5, 12, 19, 26, 1, 8, 15, 22, 29, 4]
}
},
"slotMappingT": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [208] } }
},
"outputs": { "outputT": { "dtype": "float16", "shape": [1, 16], "tolerance": 0.00001, "relTolerance": 0.0001 } }
}
]
}
|