博客
分类
标签
归档
友链
关于
Dark Mode
博客
分类
标签
归档
友链
关于
Dark Mode
Mens et Manus
Roofline Model and Flash Attention
Roofline Model and Flash Attention 计算强度: Flops/Byte => 反映每个字节的传输会产生多少计算 roofline model: 纵轴: 算力, 单位Flop/s 横轴: 计算强度I, 单位Flop/Byte 斜率: 内存带宽, 单位Byte/s 算力的上限决定了roofline model的屋顶 带宽的上限决定了roofline mode...
2025-08-06
Read More
手把手实现Ring Attention
手把手实现Ring Attention 官方ring attention是jax实现的,这里用pytorch实现一个ring attention的学习版本。 source code 是ring attention是attention机制的分布式版本。分布式的持有QKV分块从而降低单机的显存消耗。 主要流程: 数据并行模拟: 不想折腾DDP, 使用一些技巧来模拟 p2p通信 给ring at...
2024-03-01
Read More