vllm.model_executor.layers.mamba.ops.cpu.gdn_attention
¶
Functions:
-
cpu_gdn_attention_core–CPU custom op for the core GDN attention computation.
_conv_buffer_view(layer)
¶
Return the conv-state cache as (num_slots, dim, state_len).
Source code in vllm/model_executor/layers/mamba/ops/cpu/gdn_attention.py
_spec_aware_nonspec(layer, attn_metadata_i, mixed_qkv, b, a, core_attn_out, conv_buf, ssm_state, width)
¶
Non-spec prefill/decode with a wide conv buffer.
Source code in vllm/model_executor/layers/mamba/ops/cpu/gdn_attention.py
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 | |
_spec_aware_nonspec_subset(layer, attn_metadata_i, mixed_qkv, b, a, conv_buf, ssm_state, width)
¶
Process non-spec (prefill) tokens that coexist with spec sequences.
Returns outputs ordered like non_spec_token_indx.
Source code in vllm/model_executor/layers/mamba/ops/cpu/gdn_attention.py
_spec_forward(layer, attn_metadata_i, mixed_qkv_spec, b_spec, a_spec, conv_buf, ssm_state, width, state_len)
¶
Run the GDN core for the multi-query (speculative) tokens.
Returns the core attention output for the spec tokens, in the same token
order as mixed_qkv_spec (i.e. ordered by spec_query_start_loc).
Source code in vllm/model_executor/layers/mamba/ops/cpu/gdn_attention.py
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 | |
_unpacked_conv_weight(layer)
¶
Return the plain (dim, width) conv weight.
On AMX and aarch64+bf16 the conv1d weight is packed in place at load time,
so the torch spec-decode path relies on the un-packed copy stashed by
dispatch_cpu_unquantized_gemm.
Source code in vllm/model_executor/layers/mamba/ops/cpu/gdn_attention.py
cpu_gdn_attention_core(mixed_qkv, b, a, core_attn_out, layer_name)
¶
CPU custom op for the core GDN attention computation.