[Cherry-pick]bmm_transpose to v011dev (#3995)

### What this PR does / why we need it?
Add a custom op to acclerater the deepseek model. The fusion ops combine
the bmm and transpose together, which is applied to mla module.
Cherry-pick from this commtid c68ddc11ce53334fc9a17bad58342148cbf14e86

### Does this PR introduce _any_ user-facing change?
No

---------

Signed-off-by: hust17yixuan <303660421@qq.com>
This commit is contained in:
Wang Yixuan
2025-12-08 19:22:14 +08:00
committed by GitHub
parent 6391f0625f
commit d412565ec9
15 changed files with 1736 additions and 13 deletions

15
csrc/kernels/math_utils.h Normal file
View File

@@ -0,0 +1,15 @@
#ifndef KERNEL_MATH_UTILS_H
#define KERNEL_MATH_UTILS_H
#include <cstdint>
namespace device_utils {
template <typename T, T roundVal>
__aicore__ __force_inline__ T RoundUp(const T &val)
{
return (val + roundVal - 1) / roundVal * roundVal;
}
}; // namespace device_utils
#endif