vllm.model_executor.kernels.linear.scaled_mm.aiter ¶
Classes:
-
AiterInt8ScaledMMLinearKernel– -
AiterPreshuffledFp8BlockScaledMMKernel–Aiter FP8 block-scaled GEMM using a pre-shuffled (bpreshuffle) weight.
AiterInt8ScaledMMLinearKernel ¶
Bases: CutlassInt8ScaledMMLinearKernel
Methods:
-
apply_weights–AiterInt8ScaledMMLinearKernelimplements a fused version of
Source code in vllm/model_executor/kernels/linear/scaled_mm/aiter.py
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 | |
apply_weights(layer, x, bias=None) ¶
AiterInt8ScaledMMLinearKernel implements a fused version of output = torch.mm((scale_a * a), (scale_b * b)).to(out_dtype) where scale_a * a and scale_b * b are implemented using numpy-style broadcasting. Currently only support per-tensor-per-tensor GEMM and per-token-per-channel GEMM through AITER w8a8 scaled gemm. AiterInt8ScaledMMLinearKernel also does not support ATIER block scaled GEMM and mix-precision GEMM.
Source code in vllm/model_executor/kernels/linear/scaled_mm/aiter.py
AiterPreshuffledFp8BlockScaledMMKernel ¶
Bases: Fp8BlockScaledMMLinearKernel
Aiter FP8 block-scaled GEMM using a pre-shuffled (bpreshuffle) weight.
Methods:
-
apply_block_scaled_mm–Block-scaled GEMM for callers that pre-quantize their activations.
Source code in vllm/model_executor/kernels/linear/scaled_mm/aiter.py
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 | |
_reads_weight_directly(layer) staticmethod ¶
True when something other than apply_weights consumes layer.weight.
Such a weight must stay in the plain layout: is_bmm marks a stack of matrices (wo_a), skip_weight_relayout marks MLA's kv_b_proj. Both are stamped after construction, so can_implement cannot see them.
Source code in vllm/model_executor/kernels/linear/scaled_mm/aiter.py
apply_block_scaled_mm(A, B, As, Bs) ¶
Block-scaled GEMM for callers that pre-quantize their activations.
As must be column-major; a row-major one will not raise, it just returns wrong numbers for M > 1.