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, # he chose 1 million
num_experts_per_head = 16, # he 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.4.tar.gz
(97.9 kB
view details)
Built Distribution
File details
Details for the file peer_pytorch-0.0.4.tar.gz
.
File metadata
- Download URL: peer_pytorch-0.0.4.tar.gz
- Upload date:
- Size: 97.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14d42c7cb7c760a298db8328e6f9041b210fb632987fb24d4a1ad4be0af65a89 |
|
MD5 | e9b484d69a00e816498b04f1a724604a |
|
BLAKE2b-256 | e6c00ac5b7dff5af63d369235abd77fc369c43abc7197b358c612d64da928336 |
File details
Details for the file peer_pytorch-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: peer_pytorch-0.0.4-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73dc5bb5429359d6eb2e6787e499552b828b3c1e53d27840fa272252ac5a7f7a |
|
MD5 | 7c63658f6c80acfbff31ba635811393c |
|
BLAKE2b-256 | 182b0cadde4c648097c10807045e106aee09c6abe4d89ee7e7e6bf7c892f9bef |