百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

st-moe-pytorch

> DevOps
开源

在 Pytorch 中实现 ST-Moe,这是 Brain 多年来研究的 MoE 的最新版本

387 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

在 Pytorch 中实现 ST-Moe,这是 Brain 多年来研究的 MoE 的最新版本

ST-MoE - Pytorch

Implementation of ST-MoE, the latest incarnation of mixture of experts after years of research at Brain, in Pytorch. Will be largely a transcription of the official Mesh Tensorflow implementation. If you have any papers you think should be added, while I have my attention on mixture of experts, please open an issue.

This should be SOTA for mixture-of-experts for autoregressive transformers. It is rumored that GPT4 is using 16 experts with top2 gating.

For non-autoregressive, would recommend going with the simpler and better Soft MoE.

Install

bash
$ pip install st-moe-pytorch

Appreciation

  • StabilityAI for the generous sponsorship, as well as my other sponsors, for affording me the independence to open source artificial intelligence.

  • Aran Komatsuzaki for consultation on mixture-of-experts, for removal of 2-level MoE and simplifications to code

Usage

…

Todo

  • add the router z-loss proposed in paper

  • add the geglu expert with multiplicative gating

  • add an entire sparse moe block, complete with rmsnorm + residual as well as the ability to specify a feedforward before or after for stability

  • double check equation for router z-loss for experts inner in hierarchical moe

  • redo all the transcribed code from google with einops, as it is not very clear

  • consult some MoE experts in the open source community; question why hierarchical MoE is needed, in light of results from soft-MoE

  • offer top-n gating generalization, as it seems top3 (with smaller threshold) can work even better

  • figure out if there was an error in a previous transcription - no there was not an error

  • allow for different thresholds for second vs third routed expert

  • add coordinate descent based routing

  • make first naive non-optimized attempt at distributed code for mixture of experts

  • distributed

    • handle any world size less than number of experts
    • handle any world size greater than number of experts - for now, just have remainder machines do nothing
    • support variable batch sizes
    • support variable seq lengths
    • figure out how to move assert.py to pytests
    • simplify the variable sequence length test code from another folder and move in so other researchers gain confidence
    • optimize
    • figure out what is faster, all gather, or broadcast with async followed by barrier
    • make all distributed code pluggable, for different strategies
    • figure out why there is tiny error in gradients
  • improvise a Top2GatingWithCoordinateDescent for MoE without importance

Citations

bibtex
@inproceedings{Zoph2022STMoEDS,
    title   = {ST-MoE: Designing Stable and Transferable Sparse Expert Models},
    author  = {Barret Zoph and Irwan Bello and Sameer Kumar and Nan Du and Yanping Huang and Jeff Dean and Noam M. Shazeer and William Fedus},
    year    = {2022}
}

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Pythonartificial-intelligenceconditional-computationdeep-learningmixture-of-experts

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类DevOps
定价开源

> 相关工具

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理