Commit a21cd4c
committed
[None][perf] DSV4 o_proj: fuse fp8/UE8M0 quantize into o_a CuTe-DSL epilogue (gated)
Fold the o_lora bf16->fp8 + 1x128 packed-UE8M0 quantization into the o_a blockwise
GEMM epilogue (single-pass, tree-reduce amax), so o_a emits fp8+sf directly and
o_b (DeepGEMM 1d1d) consumes it without the separate fp8_quantize_1x128_packed
kernel and the bf16 o_lora HBM round-trip.
- blockwise_gemm.py: optional fp8+SF epilogue path, gated by sf_out tensor; the
bf16 path is byte-identical when off. Single-pass register cache, tree-reduce
amax (byte-exact), packed-UE8M0 MN-major sf store, predicated for tail-M,
config-guarded to (128,128)/1-CTA.
- cute_dsl_custom_ops.py: new trtllm::cute_dsl_fp8_bmm_blackwell_fp8out op.
- attention.py: gated DSV4_FUSE_OPROJ branch in _deepseek_v4_o_proj (tp_size==1),
falls back to the existing path when the flag is off.
Validated byte-exact (G=1/G=16/tail-M/negative guards) and net-positive
(+1.6us/o_a in decode, nsys hardware-timestamp measured). Default OFF -> zero
functional change unless DSV4_FUSE_OPROJ=1.
Signed-off-by: Mingyang Hao <mingyangh@nvidia.com>1 parent ec3da87 commit a21cd4c
3 files changed
Lines changed: 713 additions & 33 deletions
File tree
- tensorrt_llm/_torch
- custom_ops
- cute_dsl_kernels/blackwell/blockwise_gemm
- modules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3849 | 3849 | | |
3850 | 3850 | | |
3851 | 3851 | | |
| 3852 | + | |
| 3853 | + | |
| 3854 | + | |
| 3855 | + | |
| 3856 | + | |
| 3857 | + | |
| 3858 | + | |
| 3859 | + | |
| 3860 | + | |
| 3861 | + | |
| 3862 | + | |
| 3863 | + | |
| 3864 | + | |
| 3865 | + | |
| 3866 | + | |
| 3867 | + | |
| 3868 | + | |
| 3869 | + | |
| 3870 | + | |
| 3871 | + | |
| 3872 | + | |
| 3873 | + | |
| 3874 | + | |
| 3875 | + | |
| 3876 | + | |
| 3877 | + | |
| 3878 | + | |
| 3879 | + | |
| 3880 | + | |
| 3881 | + | |
| 3882 | + | |
| 3883 | + | |
| 3884 | + | |
| 3885 | + | |
| 3886 | + | |
| 3887 | + | |
| 3888 | + | |
| 3889 | + | |
| 3890 | + | |
| 3891 | + | |
| 3892 | + | |
| 3893 | + | |
| 3894 | + | |
| 3895 | + | |
| 3896 | + | |
| 3897 | + | |
| 3898 | + | |
| 3899 | + | |
| 3900 | + | |
| 3901 | + | |
| 3902 | + | |
| 3903 | + | |
| 3904 | + | |
| 3905 | + | |
| 3906 | + | |
| 3907 | + | |
| 3908 | + | |
| 3909 | + | |
| 3910 | + | |
| 3911 | + | |
| 3912 | + | |
| 3913 | + | |
| 3914 | + | |
| 3915 | + | |
| 3916 | + | |
| 3917 | + | |
| 3918 | + | |
| 3919 | + | |
| 3920 | + | |
| 3921 | + | |
| 3922 | + | |
| 3923 | + | |
| 3924 | + | |
| 3925 | + | |
| 3926 | + | |
| 3927 | + | |
| 3928 | + | |
| 3929 | + | |
| 3930 | + | |
| 3931 | + | |
| 3932 | + | |
| 3933 | + | |
| 3934 | + | |
| 3935 | + | |
| 3936 | + | |
| 3937 | + | |
| 3938 | + | |
| 3939 | + | |
| 3940 | + | |
| 3941 | + | |
| 3942 | + | |
| 3943 | + | |
| 3944 | + | |
| 3945 | + | |
| 3946 | + | |
| 3947 | + | |
| 3948 | + | |
| 3949 | + | |
| 3950 | + | |
| 3951 | + | |
| 3952 | + | |
| 3953 | + | |
| 3954 | + | |
| 3955 | + | |
| 3956 | + | |
| 3957 | + | |
| 3958 | + | |
| 3959 | + | |
3852 | 3960 | | |
3853 | 3961 | | |
3854 | 3962 | | |
| |||
0 commit comments