Tensor core MMA指令教程
参考 https://zhuanlan.zhihu.com/p/1892346599864238276
以mma.m8n8k4为例
A warp executing mma.m8n8k4 with .f16 floating point type will compute 4 MMA operations of shape .m8n8k4.
一个...
MoE基本实现in short
topk expert选择
linear(dim, num expert)赋权
topk at dim -1
permute: 让同一个expert的token揍在一起, 方便做一组mlp(grouped gemm)
技巧:
topk_ids.view(num_token, topk).view(-1).argsort()会根据topk排序, 相同exp...