vllm.models.kimi_k3.amd.ops.third_party.kda
¶
Modules:
Functions:
-
chunk_kda_with_fused_gate–Run chunk KDA from raw gate and beta projections.
-
fused_kda_gate–Forward pass for KDA gate:
-
fused_recurrent_kda–Run recurrent KDA from raw gate and beta inputs.
-
fused_recurrent_kda_fwd–Launch recurrent KDA with dense inner dimensions and row strides.
-
fused_recurrent_kda_packed_decode–Run one-token KDA decode directly from packed post-conv QKV.
chunk_kda_with_fused_gate(q, k, v, raw_g, raw_beta, A_log, g_bias, scale=None, initial_state=None, output_final_state=False, lower_bound=None, use_qk_l2norm_in_kernel=False, cu_seqlens=None, chunk_indices=None, chunk_offsets=None, **kwargs)
¶
Run chunk KDA from raw gate and beta projections.
Source code in vllm/models/kimi_k3/amd/ops/third_party/kda/chunk.py
fused_kda_gate(g, A, head_k_dim, g_bias=None, beta=1.0, threshold=20.0, lower_bound=None)
¶
Forward pass for KDA gate: input g: [..., H*D] param A: [H] or [1, 1, H, 1] beta: softplus beta parameter threshold: softplus threshold parameter return : [..., H, D]
Source code in vllm/models/kimi_k3/amd/ops/third_party/kda/chunk.py
fused_recurrent_kda(q, k, v, raw_g, raw_beta, A_log, dt_bias, lower_bound, initial_state, cu_seqlens, ssm_state_indices, num_accepted_tokens=None, uniform_sequence_length=None, out=None, fuse_gate=None)
¶
Run recurrent KDA from raw gate and beta inputs.
This vLLM wrapper applies the gate activation and beta sigmoid, selecting whether to materialize them before launching the recurrent kernel.
Source code in vllm/models/kimi_k3/amd/ops/third_party/kda/fused_recurrent.py
fused_recurrent_kda_fwd(q, k, v, g, beta, scale=None, initial_state=None, inplace_final_state=True, cu_seqlens=None, ssm_state_indices=None, num_accepted_tokens=None, uniform_sequence_length=None, use_qk_l2norm_in_kernel=True, A_log=None, dt_bias=None, lower_bound=None, use_gate_in_kernel=False, use_beta_sigmoid_in_kernel=False, out=None)
¶
Launch recurrent KDA with dense inner dimensions and row strides.
Source code in vllm/models/kimi_k3/amd/ops/third_party/kda/fused_recurrent.py
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 | |
fused_recurrent_kda_packed_decode(mixed_qkv, raw_g, raw_beta, A_log, dt_bias, lower_bound, initial_state, state_indices, scale=None)
¶
Run one-token KDA decode directly from packed post-conv QKV.
Source code in vllm/models/kimi_k3/amd/ops/third_party/kda/fused_recurrent.py
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 | |