libai icon indicating copy to clipboard operation
libai copied to clipboard

LiBai(李白): A Toolbox for Large-Scale Distributed Parallel Training

Results 97 libai issues
Sort by recently updated
recently updated
newest added

## 项目介绍 Swin-Transformer V2 [Liu et al.2021] 是微软对原有 Swin-Transformer 的继续深入研究。原有的 Swin-Transformer 通过引入图像自身的先验知识(shift 窗口来实现)在图像分类,目标检测,语义分割上取得了良好的性能。然而由于一系列问题: 大模型训练产生的激活阈值过大,下游任务的分辨率太大而预训练的分辨率太低导致相对位置编码损害了性能,以及预训练需要大量标记数据的问题。作者分别采用将 Layernorm 移动至 MLP 以及 Attention 的后方,采用 log-spaced 的元网络生成,利用 SimMIM 来辅助训练解决了上述问题。最后设计了一个具备 3 亿参数量的模型在众多数据集上取得了极为优异的性能。本课题的目标便是通过 Libai 复现网络,并且能够拓展模型,支持各种并行形式的训练。并在 ImageNet-21k, ImageNet-1k...

### TODO - [ ] swin tiny 8卡 cifar100 上对齐官方实现精度 - [ ] swin v2 tiny 8卡 cifar100 上对齐官方实现精度

TODO LIST: - [x] coco_dataset预处理 - [x] modeling - [x] trainer - [x] torch权重加载测试(已对齐) - [x] eager global tensor parallel [evaluation结果对齐](https://github.com/Oneflow-Inc/libai/issues/288) - [x] 更libai的transformer实现,目前版本参考很多torch.nn.MultiHeadAttention - [ ] 推进训练 oneflow bug和不支持算子记录...

将 [RWKV-v4](https://github.com/BlinkDL/RWKV-LM/tree/main/RWKV-v4) 迁移到 libai 的需求。 - [进度 issue ](https://github.com/Oneflow-Inc/OneTeam/issues/1587) - quick run - 数据集下载 `wget https://data/deepai.org/enwik8.zip `

### SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers 基于transformer的语义分割模型 [论文地址](https://arxiv.org/abs/2105.15203) ![image](https://user-images.githubusercontent.com/63182546/182790447-079eabed-cd79-4273-ae1f-479013ee377f.png) #### 项目目的 1. 丰富libai的支持的视觉任务类别。目前已有或正在做的任务类别包括:分类、检测任务,可扩充分割任务 2. 该模型对对于使用Transformer做分割的开篇之作[SETR](https://link.zhihu.com/target=https%3A//arxiv.org/abs/2012.15840)主要做了创新,提高了效率, 且部分moudle基于ViT可直调用libai现有layer,较适合作为libai项目 #### 预期结果 1. 可加载huggingface提供的预训练权重,并实现精度对齐 2. 可完成基于libai的训练,并实现精度对齐 4. 成熟后可直接做为libai的model,包括其中的一些layer可做为common layer

Eager global 模型并行 参数对齐:https://github.com/facebookresearch/detr 问题排查TODO LIST: - [x] 继承libai attention实现的MultiHeadAttention是否对齐torch.nn.MultiHeadAttention (已对齐) - [x] PyTorch权重加载正确性 - [x] bakebone权重加载 - [x] libai-like transformer完善 - [x] [对某些input shape导致loss.backward报错"F20220602 14:17:25.050042 15603 shape.cpp:187] Check failed:...

# 添加dalle2,后续持续完善中并记录遇到的一些问题。 python: 3.6.9 oneflow: 0.7.0+cu112 代码主要参考[dalle2_pytorch](https://github.com/lucidrains/DALLE2-pytorch), 里面还有一部分没太看明白:( ,基本上是 `import torch` -> `import oneflow as flow`, 然后把代码中的'torch'全部替换为'flow', 少部分接口改一改入参格式,基本可以跑通 :) 。

该pr完善了`libai/optim/build.py/get_default_optimizer_params`中自定义不同层lr不方便的问题。