Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
| ) | ||
|
|
||
|
|
||
| @triton.jit |
There was a problem hiding this comment.
Do we already have some fused CUDA kernel for this? We might try to reuse that one if possible
There was a problem hiding this comment.
I didn't see an existing fused CUDA kernel for this in TRT-LLM. This kernel is very simple with elementwise operations, I haven't done the analysis but it's likely memory bound and most of the savings come from fusing the operations to avoid additional MIO. I'm also not sure how much it impact the e2e latency. So maybe, the triton kernel is "good enough."
I can run some basic e2e benchmark + profiling once the main PR is merged and this is ready for closer review, to validate the above conjecture.
There was a problem hiding this comment.
I didn't see an existing fused CUDA kernel for this in TRT-LLM
What about in SGLang code base?
There was a problem hiding this comment.
the counterpart for FlashMLA does a fusion for the fp8 nope + bf16 rope KV pool, but nothing already exists for this exact operation (uniform fp8 pool) as far as I'm aware
There was a problem hiding this comment.
Existing path for FlashMLA: see python wrapper and cuda impl, which is called as part of CompressorBackendMixin._forward_compress_all_in_one here. I can look into adapting it for the uniform FP8 pool format.
df41f36 to
1ee6592
Compare
|
Updated the existing norm + rope + store kernel for the uniform fp8 format for trtllm attention backend by adding a third epilogue for this format, and removed the triton kernel. Performance is flat across sizes 32 to 4096, so most likely bounded by CPU overhead (measured eagerly). Measurements on B200: |
|
Closing, is folded into #36652 which includes additional performance optimizations. |
Motivation
Depends on #30805, improves e2e perf for dsv4 with trtllm sparse attention
Modifications
Accuracy Tests
Speed Tests and Profiling
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ❌ Run #32541328105
Latest PR Test (Extra): ❌ Run #32541327985
Latest PR Test (AMD ROCm 7.2): ❌ Run #32541328165