vllm.models.deepseek_v32.nvidia.kernels ¶
Functions:
-
fused_eh_norm–Returns cat([enorm(masked embeds), hnorm(prev_hidden)]) -> [N, 2H].
-
fused_q–Fuse the MQA-query and indexer-query RoPE/quantization.
_fp8_ue8m0_quantize(vals) ¶
Quantize float32 values to FP8 E4M3 with a ue8m0 (power-of-2) scale.
Returns (fp8_vals, scale) so the caller can store them or reuse the scale.
Source code in vllm/models/deepseek_v32/nvidia/kernels.py
_fused_eh_norm_kernel(pos_ptr, embeds_ptr, embeds_stride, prev_ptr, prev_stride, enorm_w_ptr, hnorm_w_ptr, eps, out_ptr, out_stride, H, BLOCK) ¶
MTP input fusion: zero embeds at position 0, RMSNorm(embeds) with enorm and RMSNorm(prev_hidden) with hnorm, written side-by-side into out ([N, 2H]) ready for the eh_proj GEMM. Replaces where + 2x RMSNorm + cat.
Source code in vllm/models/deepseek_v32/nvidia/kernels.py
fused_eh_norm(positions, inputs_embeds, previous_hidden, enorm_w, hnorm_w, eps) ¶
Returns cat([enorm(masked embeds), hnorm(prev_hidden)]) -> [N, 2H].
Source code in vllm/models/deepseek_v32/nvidia/kernels.py
fused_q(positions, q_pe, q_pe_cos_sin_cache, index_q, index_q_cos_sin_cache, ql_nope, q_scale, index_weights, index_weights_softmax_scale, index_weights_head_scale, has_indexer=True, index_rope_interleave=False, quantize_mqa=True) ¶
Fuse the MQA-query and indexer-query RoPE/quantization.
Returns (index_q_fp8, index_weights_out, mqa_q). When quantize_mqa is True (FlashInfer sparse, fp8 query) mqa_q is a single fp8 tensor packing [ql_nope; q_pe]. When False (FlashMLA sparse, bf16 query) it is the RoPE'd q_pe in bf16; the caller pairs it with ql_nope as the (ql_nope, q_pe) tuple the backend expects.
Source code in vllm/models/deepseek_v32/nvidia/kernels.py
751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 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 | |