pytorch - 当我将 SparseAttention 与 DeepSpeed 一起使用时遇到运行时错误
问题描述
我正在使用 Transformer 构建自回归模型,但潜在空间有点大。因此,我试图采用稀疏的注意力。我从此链接借用了 SparseAttention 模块,并使用如下测试代码测试其功能:
from sparse_attention import SparseAttention
shape = (2,32,32)
n_head = 2
casual = True
block = 32
num_local_blocks = 4
sparse_model = SparseAttention(shape,n_head,casual)
q = torch.randn(2,2,32,32,1,512)
decode_step = None
decode_idx = None
sparse_out = sparse_model(q,q,q,decode_step,decode_idx)
但是,此计算无法成功,错误如下所示。有人遇到同样的问题吗?顺便说一句,我用的是PyTorch=1.7,cuda=10.2,我已经安装了llvm-9-config。希望有人可以帮我解决这个问题!
解决方案
推荐阅读
- node.js - 如何从 accountKit 迁移到 Firebase Phone 注册?
- python - 如何在 Keras 中实现 LadderNet(2 个 U-Net)?(以可用的 PyTorch 脚本作为参考)
- barcode - 使用 ZPL 打印代码 39 时跳过特殊字符
- syntax-error - 使用 microbit 在 mu 上编码时出现语法错误
- python - 有谁知道在这个错误中该怎么做?它是为了我的自学编程技能\
- machine-learning - 在 keras 中更新权重的问题
- c# - 使 Square Checkout URL 无效
- r - 删除r中的空文件夹
- active-directory - 在 Windows Server 2012 上创建 LDAP 服务器
- linux - 如何使用bash打印具有由“n”个字符组成的字符串的列字段的内容?