libai
libai copied to clipboard
LiBai(李白): A Toolbox for Large-Scale Distributed Parallel Training
* 增加 MoE 支持 * 利用 libai moe 做 cifar10 分类任务 project
在 projects 中增加一个使用 MAE 在 StandfordCars 数据集上进行微调的实际示例,属于精细图像分类任务,支持微调和推理。
## TODO - [x] 添加Repeated Augmentation (一种Mini-batch的采样策略) 在Swin-T,DeiT等主流ViT中都用到的一个增强策略,对于大模型涨点比较明显,对于小模型没有太大影响 ## Reference - deit实现: https://github.com/facebookresearch/deit/blob/main/samplers.py - 知乎解读: https://zhuanlan.zhihu.com/p/430563265 - mmcls的实现: https://github.com/open-mmlab/mmclassification/blob/master/mmcls/datasets/samplers/repeat_aug.py
自动 loss 对齐分支,周期性运行以确保之前对齐过的模型没有在后续的代码中引入新的精度问题
## TODO - [x] 对接vision下的模型到libai中的训练,暂时命名为`OneCls` - [x] 写README - [x] 添加模型的example, 可以用vision中的注册机制轻松添加自己的模型进行训练
调研了不同的 NLP 库在预测阶段的处理方式 ### FairSeq 针对生成任务的代码主要在 https://github.com/pytorch/fairseq/blob/main/fairseq/sequence_generator.py ```python class SequenceGenerator(nn.Module): def __init__( self, models, tgt_dict, beam_size=1, ... ): """Generates translations of a given source sentence.""" ... def _generate( self, sample:...