PEER - Pytorch
Project description
PEER - Pytorch
Pytorch implementation of the PEER block from the Deepmind paper, Mixture of A Million Experts, by Xu Owen He.
Install
$ pip install PEER-pytorch
Usage
import torch
from PEER_pytorch import PEER
peer = PEER(
dim = 512,
heads = 8, # tested up to 32 - (hk = heads * num_experts_per_head (16))
num_experts = 1_000_000, # they chose 1 million
num_experts_per_head = 16, # they settled on 16, but was 32 in PKM paper
dim_key = 128,
).cuda()
x = torch.randn(2, 1024, 512).cuda()
out = peer(x)
assert x.shape == out.shape
Citations
@inproceedings{He2024MixtureOA,
title = {Mixture of A Million Experts},
author = {Xu Owen He},
year = {2024},
url = {https://api.semanticscholar.org/CorpusID:271038610}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
peer_pytorch-0.0.1.tar.gz
(97.9 kB
view hashes)
Built Distribution
Close
Hashes for peer_pytorch-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4445f96f35fb468e70cb2e5785f4295c7fdeb74bd2a8c407ad9481e39fb65c5e |
|
MD5 | 17f22a27bfb3246cdaea30456aa4c12f |
|
BLAKE2b-256 | 0a97ba6b3681310fb98b541d3d5921825cf26152e4e9d02cdca93f3a4f42b087 |