Repository navigation
Commit de7a01b
committed
sycl: spread PQ2_0 MMVQ across 16 lanes per block (~2x tg)
The MMVQ kernel derives its lane split from qi/vdr. PQ2_0 was passing
QI_PQ2_0 (= QK_PQ2_0/32 = 4), which put only 4 lanes on each 128-element
block and left every lane an 8-deep serial dp4a chain over 8 bytes of qs.
Pass a dedicated MMVQ_PQ2_0_QI of 16 instead, so a block is covered by 16
lanes reading 2 bytes / 8 elements each with 2 dp4a per call, and a
sub-group keeps more blocks in flight. Measured on an Arc iGPU with
test-backend-ops perf, MUL_MAT m=4096 n=1 k=14336, alternating the two
builds to cancel out background load: 827/846/837 us before, 397/395/384
us after (~2.1x). On an idle machine the same case goes 247.6 -> 123.0 us.
8 and 32 lanes per block were both tried and were slower; at 32 the
per-call scale setup dominates the single remaining dp4a.
Also fold the 2-bit-to-byte-lane unpack shared with the q2_0 path into
unpack_2bit_to_byte_lanes(), and switch the epilogue to the q4_0-style
sumi*ds.x - zp*ds.y form. The previous PQ2_0 epilogue applied the zero
point with byte_sub_4 and then used only ds[0], dropping the ds.y term.
test-backend-ops test -o MUL_MAT -p type_a=pq2_0: 38/38 on both SYCL
devices, 3/3 backends passed. The unrelated q1_0 failures on SYCL1 are
present with and without this change.1 parent c5f6c97 commit de7a01b
2 files changed
Lines changed: 34 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1351 | 1351 | | |
1352 | 1352 | | |
1353 | 1353 | | |
1354 | | - | |
| 1354 | + | |
1355 | 1355 | | |
1356 | 1356 | | |
1357 | 1357 | | |
| |||
1373 | 1373 | | |
1374 | 1374 | | |
1375 | 1375 | | |
1376 | | - | |
| 1376 | + | |
1377 | 1377 | | |
1378 | 1378 | | |
1379 | 1379 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
430 | 440 | | |
| 441 | + | |
431 | 442 | | |
432 | 443 | | |
433 | 444 | | |
434 | 445 | | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
439 | 455 | | |
440 | 456 | | |
441 | 457 | | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
451 | 463 | | |
452 | 464 | | |
453 | | - | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
454 | 470 | | |
455 | 471 | | |
456 | 472 | | |
| |||
814 | 830 | | |
815 | 831 | | |
816 | 832 | | |
817 | | - | |
818 | | - | |
819 | | - | |
820 | | - | |
821 | | - | |
822 | | - | |
823 | | - | |
824 | | - | |
825 | | - | |
| 833 | + | |
| 834 | + | |
826 | 835 | | |
827 | 836 | | |
828 | 837 | | |
| |||
0 commit comments