TensorRT-LLMs/jenkins/license_cpp.json
Bo Li 515dd0d78f
feat: Add support for FP8 MLA on Hopper and Blackwell. (#3190)
* fp8 kv + bf16 ctx MLA + fp8 gen MLA

Use BF16 for context MLA.
mFP8GenerationMLA and mFP8ContextFMHA shouldn't be enabled together.

Allow mSM==90 for mFP8GenerationMLA==true.
For FMHA, dataTypeKv should be FP8.

For FP8 MLA generation, the output is still in BF16.

Refine debug info for FMHA kernel metadata.

Use inputType, outputType, SM together to hash kernel list.

Add FP8 MLA generation FMHA kernel.

Special WAR of NUM_COMPUTE_GROUPS for MLA generation kernel.

Separate the implementation of fused_multihead_attention_v2.h to CPP and print some debug info if checkIfKernelExist fails.

Refine debug info in fused_multihead_attention_v2.cpp

Correct FP8 MLA metadata.

New kernel provided by Yuxin, which outputs BF16.

smem size is not set correctly, which will lead to illegal mem access.

Yuxin fixed the error in FMHA MLA kernel: previously the BF16 isn't correctly written: some parts are repeatedly written, while some others are untouched.

There are two bmm1 scales that should be set correctly.

New kernel generated by Yuxin.

Modificatiosn to common/attentionOp for FP8 MLA on Hopper using FMHA.

Not necessary. If mFP8GenerationMLA, is_fp8_out is false, so mFP8ContextFMHA is false.

Skip a check in fmhaDispatcher.

Modifications in fmhaRunner:
- Debug dump.
- if (!isFP8GenerationMLA) skips a lot of flag setting.
- TMA descriptor modification for qo (by Yuxin).

Cleanup debug output.

Clean up o tma descriptor modifications.

Signed-off-by: Bo Li <bobboli0202@gmail.com>

* Resolve conflicts.

Signed-off-by: Bo Li <bobboli0202@gmail.com>

* Apply the patch of FP8 FlashMLA and resolve conflicts.

Signed-off-by: Bo Li <bobboli0202@gmail.com>

* Fix compilation error.

Signed-off-by: Bo Li <bobboli0202@gmail.com>

* Fix compile error.

Signed-off-by: Bo Li <bobboli0202@gmail.com>

* pick blackwell support

Signed-off-by: Dylan Chen <191843203+DylanChen-NV@users.noreply.github.com>

* Add copyright notice to fused_multihead_attention_v2.cpp.

Signed-off-by: Bo Li <bobboli0202@gmail.com>

* Add license.

Signed-off-by: Bo Li <bobboli0202@gmail.com>

* Add missing license.

Signed-off-by: Bo Li <bobboli0202@gmail.com>

* Exclude building flashMLA kernels under sm90.

Signed-off-by: Bo Li <bobboli0202@gmail.com>

* Revert "Exclude building flashMLA kernels under sm90."

    This reverts commit f0c859d459.

Signed-off-by: Bo Li <bobboli0202@gmail.com>

* Use macro to skip compiling FlashMLA for non sm90 targets.

Signed-off-by: Bo Li <bobboli0202@gmail.com>

---------

Signed-off-by: Bo Li <bobboli0202@gmail.com>
Signed-off-by: Dylan Chen <191843203+DylanChen-NV@users.noreply.github.com>
Co-authored-by: Dylan Chen <ziqingc@nvidia.com>
Co-authored-by: Dylan Chen <191843203+DylanChen-NV@users.noreply.github.com>
Co-authored-by: QI JUN <22017000+QiJune@users.noreply.github.com>
2025-04-07 15:14:13 +08:00

57 lines
2.8 KiB
JSON

{
"filters": [
{
"include_re": "this is an example. every file with patch match 'include_re' should match the license by 'license_name'",
"exclude": {
"<filename1>": "exclude file here. you can add your own description",
"<filename2>": "<description>"
},
"license_name": "<nvidia/bsd/apache>"
},
{
"include_re": "^include/",
"license_name": "apache"
},
{
"include_re": "^tensorrt_llm/",
"exclude_re": [
"^tensorrt_llm/kernels/decoderMaskedMultiheadAttention/decoderXQAImplJIT/nvrtcWrapper/src/",
"^tensorrt_llm/kernels/internal_cutlass_kernels/src/"
],
"license_name": "apache"
},
{
"include_re": "^tensorrt_llm/kernels/decoderMaskedMultiheadAttention/decoderXQAImplJIT/nvrtcWrapper/src/",
"license_name": "nvidia"
},
{
"include_re": "^tensorrt_llm/kernels/internal_cutlass_kernels/src/",
"license_name": "nvidia"
}
],
"skip": {
"<filename>": "<description>",
"tensorrt_llm/kernels/selectiveScan/selectiveScan.h": "external",
"tensorrt_llm/kernels/cutlass_kernels/python/generate_kernels.py": "py",
"tensorrt_llm/kernels/cutlass_kernels/fp8_rowwise_gemm/fp8_rowwise_gemm_kernel_template_sm90.h": "dual license",
"tensorrt_llm/kernels/cutlass_kernels/fp8_rowwise_gemm/fp8_rowwise_gemm_template.h": "dual license",
"tensorrt_llm/kernels/flashMLA/flash_fwd_mla_bf16_sm90.cu": "dual license",
"tensorrt_llm/kernels/flashMLA/flash_fwd_mla_fp16_sm90.cu": "dual license",
"tensorrt_llm/kernels/flashMLA/flash_fwd_mla_fp8_sm90.cu": "dual license",
"tensorrt_llm/kernels/flashMLA/flash_fwd_mla_kernel.h": "dual license",
"tensorrt_llm/kernels/flashMLA/flash_fwd_mla_metadata.cu": "dual license",
"tensorrt_llm/kernels/flashMLA/flash_mla.h": "dual license",
"tensorrt_llm/kernels/flashMLA/named_barrier.h": "dual license",
"tensorrt_llm/kernels/flashMLA/softmax.h": "dual license",
"tensorrt_llm/kernels/flashMLA/static_switch.h": "dual license",
"tensorrt_llm/kernels/flashMLA/utils.h": "dual license",
"tensorrt_llm/kernels/flashMLA/fp8_transpose_v.h": "dual license",
"include/tensorrt_llm/deep_gemm/fp8_gemm.cuh": "dual license",
"include/tensorrt_llm/deep_gemm/mma_utils.cuh": "dual license",
"include/tensorrt_llm/deep_gemm/scheduler.cuh": "dual license",
"include/tensorrt_llm/deep_gemm/tma_utils.cuh": "dual license",
"include/tensorrt_llm/deep_gemm/utils.cuh": "dual license",
"_": "don't remove, for trailing comma"
}
}