TensorRT-LLMs/cpp/tensorrt_llm/thop
Simeng Liu 873c7532fd
feat: Add group_rms_norm kernel to normalize multiple inputs in a single operator. (#3438)
* feat: Add group_rms_norm kernel to normalize multiple inputs in a single operator.

Previously, the RMSNorm implementation only supported a single input tensor. With group_rms_norm, multiple tensors can be normalized together:
```python
input_a, input_b, ... = group_rms_norm([input_a, input_b, ...])
```
All input tensors must share the same batch dimension. The kernel partitions work by dynamically assigning warp groups proportional to the last dimension of each input, improving launch efficiency and reducing overhead.

This MR provides two implementations:
GroupRMSNormKernel: Optimized for small-to-medium batch sizes
GroupRMSNormKernelLargeBatch: Contains additional optimizations for large batch sizes

Both kernels are currently exposed as custom PyTorch ops. A future MR will implement heuristic-based kernel selection and expose a unified interface.

Signed-off-by: Simeng Liu <simengl@nvidia.com>

* Resolve comments and fix typo with IS_FLASHINFER_AVAILABLE

Signed-off-by: Simeng Liu <simengl@nvidia.com>

---------

Signed-off-by: Simeng Liu <simengl@nvidia.com>
2025-05-02 13:25:30 +08:00
..
allgatherOp.cpp Update TensorRT-LLM (#2792) 2025-02-18 21:27:39 +08:00
allreduceOp.cpp Clean up allreduce op in Deepseek V3 model. (#3829) 2025-05-01 07:56:36 +08:00
attentionOp.cpp Add attention workspace memory check (#3970) 2025-04-30 23:51:09 -07:00
CMakeLists.txt feat: Add group_rms_norm kernel to normalize multiple inputs in a single operator. (#3438) 2025-05-02 13:25:30 +08:00
convertSpecDecodingMaskToPackedMaskOp.cpp Update TensorRT-LLM (#2873) 2025-03-11 21:13:42 +08:00
cublasScaledMM.cpp feat: Introduce UB allocator for pytorch flow (#3257) 2025-04-08 18:39:49 +08:00
cutlassScaledMM.cpp Update TensorRT-LLM (#2582) 2024-12-16 21:50:47 -08:00
deepseekAllreduceFusionOp.cpp Fixing minor typo in allreduce kernel selection (#3912) 2025-04-28 23:06:49 +08:00
dynamicDecodeOp.cpp Feat: Variable-Beam-Width-Search (VBWS) part3 (#3338) 2025-04-08 23:51:27 +08:00
dynamicDecodeOp.h Update TensorRT-LLM (#2783) 2025-02-13 18:40:22 +08:00
fmhaPackMaskOp.cpp Update TensorRT-LLM (#2873) 2025-03-11 21:13:42 +08:00
fp4BatchedQuantize.cpp update FP4 quantize layout (#3045) 2025-04-03 13:13:54 -04:00
fp4BlockScaleMoe.cpp feat: [Deepseek] Add trtllm-gen MOE FP4 MOE backend (#3387) 2025-04-21 10:01:33 +08:00
fp4Gemm.cpp TRTLLM-4624 feat: Add nvfp4 gemm and moe support for SM120 (#3770) 2025-04-29 11:19:11 -04:00
fp4GemmTrtllmGen.cpp feat: trtllm-gen fp4 GEMM for pytorch workflow (#3423) 2025-04-11 02:28:07 +08:00
fp4Op.cpp feat: [Deepseek] Add trtllm-gen MOE FP4 MOE backend (#3387) 2025-04-21 10:01:33 +08:00
fp4Quantize.cpp update FP4 quantize layout (#3045) 2025-04-03 13:13:54 -04:00
fp8BatchedGemmTrtllmGen.cpp feat: Adding FP8 BMM from Codegen (#3541) 2025-04-16 10:37:15 +02:00
fp8BlockScaleMoe.cpp feat: [Deepseek] Add trtllm-gen MOE FP4 MOE backend (#3387) 2025-04-21 10:01:33 +08:00
fp8BlockScalingGemm.cpp [feat] open source fp8_blockscale_gemm (#3071) 2025-04-02 12:12:52 +08:00
fp8Op.cpp Update TensorRT-LLM (#2755) 2025-02-11 03:01:00 +00:00
fp8Quantize.cpp [feat] open source fp8_blockscale_gemm (#3071) 2025-04-02 12:12:52 +08:00
fusedTopkSoftmax.cpp Add Llama 4 (#3302) 2025-04-09 03:35:21 +08:00
gatherTreeOp.cpp Update TensorRT-LLM (#2873) 2025-03-11 21:13:42 +08:00
groupRmsNormOp.cpp feat: Add group_rms_norm kernel to normalize multiple inputs in a single operator. (#3438) 2025-05-02 13:25:30 +08:00
logitsBitmaskOp.cpp Update (#2978) 2025-03-23 16:39:35 +08:00
loraOp.cpp added loraOp into lora layer + test for mlp and comparison to lora plugin (#3455) 2025-04-17 12:48:27 +08:00
mambaConv1dOp.cpp Update TensorRT-LLM (#2873) 2025-03-11 21:13:42 +08:00
moeCommOp.cpp feat: Add MNNVL MoE A2A support (#3504) 2025-04-25 17:29:08 +08:00
moeOp.cpp chore: bump version to 0.19.0 (#3598) (#3841) 2025-04-29 16:57:22 +08:00
mtpOp.cpp feat: add relaxed acceptance for DS (#3865) 2025-05-01 21:50:36 +08:00
ncclCommunicatorOp.cpp Update TensorRT-LLM (#941) 2024-01-23 23:22:35 +08:00
ncclCommunicatorOp.h Update TensorRT-LLM (#787) 2024-01-02 17:54:32 +08:00
noAuxTcOp.cpp Update TensorRT-LLM (#2873) 2025-03-11 21:13:42 +08:00
parallelDecodeKVCacheUpdateOp.cpp Update TensorRT-LLM (#2582) 2024-12-16 21:50:47 -08:00
redrafterCurandOp.cpp Update TensorRT-LLM (#2873) 2025-03-11 21:13:42 +08:00
reducescatterOp.cpp Update TensorRT-LLM (#2792) 2025-02-18 21:27:39 +08:00
relativeAttentionBiasOp.cpp Update TensorRT-LLM (#2873) 2025-03-11 21:13:42 +08:00
selectiveScanOp.cpp Update TensorRT-LLM (#2873) 2025-03-11 21:13:42 +08:00
thUtils.cpp Update TensorRT-LLM (#2849) 2025-03-04 18:44:00 +08:00
thUtils.h Update TensorRT-LLM (#2849) 2025-03-04 18:44:00 +08:00
userbuffersFinalizeOp.cpp feat: Introduce UB allocator for pytorch flow (#3257) 2025-04-08 18:39:49 +08:00
userbuffersTensor.cpp feat: Introduce UB allocator for pytorch flow (#3257) 2025-04-08 18:39:49 +08:00
userbuffersTensor.h feat: Introduce UB allocator for pytorch flow (#3257) 2025-04-08 18:39:49 +08:00
weightOnlyQuantOp.cpp chore: remove usernames from comments (#3291) 2025-04-05 13:44:28 +08:00