vllm.v1.attention.ops.dash_attention
¶
DASH paged KV kernels and segmented FlashAttention/FlashInfer execution.
Functions:
-
cache_dash_prefill–Store rotated keys and integer page state in one auxiliary KV head.
-
flash_dash_attention–Attend gathered segments and combine normalized partial outputs.
-
paged_dash_decode–One query per request; all sequence-dependent decisions stay on GPU.
-
paged_dash_prefill–Extend a prompt using paged history and full-prompt page coordinates.
cache_dash_prefill(k, v, ik, roles, slots, cache, sp, head_cls=None)
¶
Store rotated keys and integer page state in one auxiliary KV head.
Source code in vllm/v1/attention/ops/dash_attention.py
flash_dash_attention(q, k, v, used, bias, backend, bs, local)
¶
Attend gathered segments and combine normalized partial outputs.
k/v are contiguous [N(topkbs+local), Hkv, D]; used contains the valid prefix length of each segment, including zero for inactive rows.
Source code in vllm/v1/attention/ops/dash_attention.py
819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 | |
paged_dash_decode(q, k, v, iq, ik, roles, cache, block_table, seq_lens, slots, head_cls, sp, layer_idx, max_model_len, prefix_lens=None, backend='FLASH_ATTN', cached_summaries=False, positions=None)
¶
One query per request; all sequence-dependent decisions stay on GPU.
Source code in vllm/v1/attention/ops/dash_attention.py
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 | |
paged_dash_prefill(q, k, v, iq, ik, roles, positions, cache, block_table, length, slots, head_cls, sp, layer_idx, backend, prefix_lens=None)
¶
Extend a prompt using paged history and full-prompt page coordinates.
Source code in vllm/v1/attention/ops/dash_attention.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 | |