想请教一下论文中的3D full attention的实现具体在哪里呢?
看到paper中提出了3D full attention和2D+1D attention的对比,并实验证明说生成视频的效果更好。论文中也提到可以用多种并行策略优化,想请教一下这部分有开源的代码吗
3D full attention和2D+1D可以理解为patch化的方式不一样吧,3D full就是直接3个维度全都patch了,一个patch就是221(hwt),分开attention是分别保留了时间和空间维度信息的。
3D full attention就是对整个序列做attention,时空分离的attention是指同一帧内部(空间)做attention或所有帧同一个位置(时间)做attention
3D full attention就是对整个序列做attention,时空分离的attention是指同一帧内部(空间)做attention或所有帧同一个位置(时间)做attention
你可以进行调试,假设tensor shape是(b,f,h,w)。之前的工作通常(b * f,h * w)进行spatial attention ,(b * h * w,f)进行temporal attentio。而在cogvideox是(b,f * h * w)的3d full attention。以10 * 480 * 720为例,他的attention map是(2,48,3* 30* 45+226,3* 30* 45+226),其中2是batch,48是head,3是进过3dvae缩减的frame个数,30和45是attention map长宽,226是text emb长度。我写了一份可视化cogvideox中3d full attention map的代码,感兴趣可以star使用一下。https://github.com/YibooZhao/cogvideox_vis_attention
你可以进行调试,假设tensor shape是(b,f,h,w)。之前的工作通常(b * f,h * w)进行spatial attention ,(b * h * w,f)进行temporal attentio。而在cogvideox是(b,f * h * w)的3d full attention。以10 * 480 * 720为例,他的attention map是(2,48,3* 30* 45+226,3* 30* 45+226),其中2是batch,48是head,3是进过3dvae缩减的frame个数,30和45是attention map长宽,226是text emb长度。我写了一份可视化cogvideox中3d full attention map的代码,感兴趣可以star使用一下。https://github.com/YibooZhao/cogvideox_vis_attention
多谢哥们