雑記

参考文献

  1. GitHub - lucidrains/performer-pytorch: An implementation of Performer, a linear attention-based transformer, in Pytorch(2022年4月29日参照).


performer_pytorch(v1.1.4)をインストールして以下のようにするとモデルにデータを流せるようにはみえる。ただメッセージが出る。

import torch
from performer_pytorch import Performer

model = Performer(
    dim=8,
    depth=3,
    heads=4,
    dim_head=6,
    causal=True
)
x = torch.randn(5, 128, 8)
y = model(x)
assert list(y.shape) == [5, 128, 8]
unable to import cuda code for auto-regressive Performer. 
will default to the memory inefficient non-cuda version