文件最后提交记录最后更新时间
!4809 【PyTorch】【built-in】【data2vec】初次提交 * data2vec 首次提交 2 年前
fix link validity Co-authored-by: frozenleaves<914814442@qq.com> # message auto-generated for no-merge-commit merge: !7517 merge master into master fix link validity Created-by: frozenn Commit-by: frozenleaves Merged-by: ascend-robot Description: ## Motivation Please describe the motivation of this PR and the goal you want to achieve through this PR. ## Modification Please briefly describe what modification is made in this PR. ## Self-test (Optional) If modifications to this PR may cause/fix function/accuracy/performance DTSs/issues, a self-inspection record needs to be attached. ## BC-breaking (Optional) If there are compatibility issues, such as dependencies on cann/torch_npu versions, they need to be explained in the PR. ## Checklist **Before PR**: - [ ] The new code needs to comply with the Clean Code specification. - [ ] The PR content is self-checked, and the expression can be clear and the writing standardized **After PR**: - [ ] CLA has been signed and all committers have signed the CLA in this PR. - [ ] The ci-pipeline is passed, Code Check is passed. See merge request: Ascend/ModelZoo-PyTorch!75171 个月前
!4879 【PyTorch】【built-in】【data2vec】第二次提交 * data2vec patch 2 年前
!5590 [PyTorch]批量模型混精适配INF/NAN模式 Merge pull request !5590 from chensida/master 2 年前
!5360 【fix】【data2vec】修改hydra的工作路径为原始工作路径 * 修改hydra的工作路径为原始工作路径 2 年前
!4809 【PyTorch】【built-in】【data2vec】初次提交 * data2vec 首次提交 2 年前
!4809 【PyTorch】【built-in】【data2vec】初次提交 * data2vec 首次提交 2 年前
!5088 【PyTorch】【built-in】【data2vec】问题修复 * data2vec 问题修复 2 年前
!4809 【PyTorch】【built-in】【data2vec】初次提交 * data2vec 首次提交 2 年前
!4809 【PyTorch】【built-in】【data2vec】初次提交 * data2vec 首次提交 2 年前
!4809 【PyTorch】【built-in】【data2vec】初次提交 * data2vec 首次提交 2 年前
!4809 【PyTorch】【built-in】【data2vec】初次提交 * data2vec 首次提交 2 年前
!6074 PyTorch 2.2 版本依赖配套更新 Merge pull request !6074 from Chai/master 2 年前
!6349 PyTorch 2.3 版本依赖配套更新 Merge pull request !6349 from 周嘉益/master 1 年前
!6574 PyTorch 2.4 版本依赖配套更新 Merge pull request !6574 from 周嘉益/pt24 1 年前
!4809 【PyTorch】【built-in】【data2vec】初次提交 * data2vec 首次提交 2 年前
!4809 【PyTorch】【built-in】【data2vec】初次提交 * data2vec 首次提交 2 年前
!4809 【PyTorch】【built-in】【data2vec】初次提交 * data2vec 首次提交 2 年前
!4809 【PyTorch】【built-in】【data2vec】初次提交 * data2vec 首次提交 2 年前
fix link validity Co-authored-by: frozenleaves<914814442@qq.com> # message auto-generated for no-merge-commit merge: !7517 merge master into master fix link validity Created-by: frozenn Commit-by: frozenleaves Merged-by: ascend-robot Description: ## Motivation Please describe the motivation of this PR and the goal you want to achieve through this PR. ## Modification Please briefly describe what modification is made in this PR. ## Self-test (Optional) If modifications to this PR may cause/fix function/accuracy/performance DTSs/issues, a self-inspection record needs to be attached. ## BC-breaking (Optional) If there are compatibility issues, such as dependencies on cann/torch_npu versions, they need to be explained in the PR. ## Checklist **Before PR**: - [ ] The new code needs to comply with the Clean Code specification. - [ ] The PR content is self-checked, and the expression can be clear and the writing standardized **After PR**: - [ ] CLA has been signed and all committers have signed the CLA in this PR. - [ ] The ci-pipeline is passed, Code Check is passed. See merge request: Ascend/ModelZoo-PyTorch!75171 个月前
fix link validity Co-authored-by: frozenleaves<914814442@qq.com> # message auto-generated for no-merge-commit merge: !7517 merge master into master fix link validity Created-by: frozenn Commit-by: frozenleaves Merged-by: ascend-robot Description: ## Motivation Please describe the motivation of this PR and the goal you want to achieve through this PR. ## Modification Please briefly describe what modification is made in this PR. ## Self-test (Optional) If modifications to this PR may cause/fix function/accuracy/performance DTSs/issues, a self-inspection record needs to be attached. ## BC-breaking (Optional) If there are compatibility issues, such as dependencies on cann/torch_npu versions, they need to be explained in the PR. ## Checklist **Before PR**: - [ ] The new code needs to comply with the Clean Code specification. - [ ] The PR content is self-checked, and the expression can be clear and the writing standardized **After PR**: - [ ] CLA has been signed and all committers have signed the CLA in this PR. - [ ] The ci-pipeline is passed, Code Check is passed. See merge request: Ascend/ModelZoo-PyTorch!75171 个月前
!4809 【PyTorch】【built-in】【data2vec】初次提交 * data2vec 首次提交 2 年前
!4809 【PyTorch】【built-in】【data2vec】初次提交 * data2vec 首次提交 2 年前
!7376 optimize public_address_statement.md Merge pull request !7376 from 王凯宇/master 8 个月前
!4809 【PyTorch】【built-in】【data2vec】初次提交 * data2vec 首次提交 2 年前
!4809 【PyTorch】【built-in】【data2vec】初次提交 * data2vec 首次提交 2 年前
!5088 【PyTorch】【built-in】【data2vec】问题修复 * data2vec 问题修复 2 年前
!4809 【PyTorch】【built-in】【data2vec】初次提交 * data2vec 首次提交 2 年前
!5088 【PyTorch】【built-in】【data2vec】问题修复 * data2vec 问题修复 2 年前
!4809 【PyTorch】【built-in】【data2vec】初次提交 * data2vec 首次提交 2 年前
README.md

Data2vec for PyTorch

概述

简述

data2vec 是首个适用于多模态的高性能自监督算法。Meta AI 将 data2vec 分别应用于语音、图像和文本,在计算机视觉、语音任务上优于最佳单一用途算法,并且在 NLP 任务也能取得具有竞争力的结果。此外,data2vec 还代表了一种新的、全面的自监督学习范式,其提高了多种模态的进步,而不仅仅是一种模态。data2vec 不依赖对比学习或重建输入示例,除了帮助加速 AI 的进步,data2vec 让我们更接近于制造能够无缝地了解周围世界不同方面的机器。

  • 参考实现:

    url=https://github.com/facebookresearch/fairseq/tree/main/examples/data2vec
    commit_id=3f6ba43f07a6e9e2acf957fc24e57251a7a3f55c
    
  • 适配昇腾 AI 处理器的实现:

    url=https://gitcode.com/ascend/ModelZoo-PyTorch.git
    code_path=PyTorch/built-in/nlp
    

准备训练环境

该模型为不随版本演进模型(随版本演进模型范围可在此处查看),未在最新昇腾配套软件中适配验证,您可以:

  1. 根据下面提供PyTorch版本在软件版本配套表中选择匹配的CANN等软件下载使用。
  2. 查看软件版本配套表后确认对该模型有新版本PyTorch和CANN中的适配需求,请在modelzoo/issues中提出您的需求。自行适配不保证精度和性能达标。

准备环境

  • 当前模型支持的 PyTorch 历史版本和已知三方库依赖如下表所示。

    表 1 版本支持表

    Torch_Version 三方库依赖版本
    PyTorch 1.11 -
    PyTorch 2.1 -
    PyTorch 2.2 torchvision=0.17.0
    PyTorch 2.3 torchvision=0.18.1
    PyTorch 2.4 torchvision=0.19.0
  • 环境准备指导。

    请参考《Pytorch框架训练环境准备》。

  • 安装依赖。

    pip uninstall fairseq
    pip install -e ./
    pip install -r requirements.txt
    pip install -r 2.2_requirements.txt    # PyTorch 2.2版本
    pip install -r 2.3_requirements.txt    # PyTorch 2.3版本
    pip install -r 2.4_requirements.txt    # PyTorch 2.4版本
    

准备数据集

  1. 获取数据集。

    用户自行下载wikitext-103-raw-v1.zip数据集。参考examples/roberta/README.pretraining.md中的介绍进行数据集预处理。 数据集目录结构参考如下所示。

    $data_path
    ├── dict.txt
    ├── preprocess.log
    ├── test.bin
    ├── test.idx
    ├── train.bin
    ├── train.idx
    ├── valid.bin
    └── valid.idx
    

    说明: 该数据集的训练过程脚本只作为一种参考示例。

开始训练

训练模型

  1. 进入解压后的源码包根目录。

    cd /${模型文件夹名称} 
    
  2. 运行训练脚本。

    该模型支持单机单卡训练。

    • 单机单卡训练

      启动单卡训练

      bash ./test/train_full_1p.sh --data_path=$data_path  # 单卡精度
      bash ./test/train_performance_1p.sh --data_path=$data_path  # 单卡性能
      
    • 单机单卡评测

      启动单卡评测

      bash ./test/train_eval_1p.sh --data_path=$data_path --checkpoint_path=$checkpoint_path  # 单卡评测
      

    模型训练脚本参数说明如下。

    公共参数:
    --task.data                                     //数据集路径
    --distributed_training.distributed_world_size   //训练设备数量
    --optimization.max_update                       //优化器最大更新次数
    --config-dir                                    //配置文件路径
    --config-name                                   //配置文件名称
    

    训练完成后,权重文件保存在当前路径下,并输出模型训练精度和性能信息。

训练结果展示

表 2 训练结果展示表

Name wer UPS Iters AMP_Type Torch_Version
1P-竞品V - 10.88 1000000 fp16 1.8
1P-NPU - 5.18 1000000 fp16 1.8

版本说明

变更

2023.05.30:首次发布。

FAQ

无。