Navigation

    Gpushare.com

    • Register
    • Login
    • Search
    • Popular
    • Categories
    • Recent
    • Tags

    【2 数据下载+模型训练】哪个男孩不想拥有自己的预训练模型(留下贫穷的眼泪)

    技术交流
    2
    2
    458
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • 183****0229
      183****0229 last edited by Alice_恒源云

      由于openwebtext文件太大,故本教程提供本人处理好的数据集。

      1、环境选择

      • pytorch 1.8.1
      • python 3.8
      • cuda 11.1

      2、准备openwebtext数据集

      # 切换路径
      cd /hy-tmp
      # 登录oss
      oss login
      # 从公共数据集路径下载处理好的openwebtext.tar.gz压缩包
      oss cp -public oss://junyu-dataset/openwebtext.tar.gz /hy-tmp
      # 在当前目录解压文件
      tar -zxvf openwebtext.tar.gz
      

      3、下载electra预训练代码并安装依赖环境

      # 切换路径
      cd /hy-tmp
      # 代码已经上传到github
      git clone https://github.com/JunnYu/hy_tutorial.git 
      # 如果下载失败请使用镜像地址git clone https://hub.fastgit.org/JunnYu/hy_tutorial.git
      # 切换路径
      cd hy_tutorial
      # 解压缩文件
      unzip electra_small_pretrain_pytorch.zip
      # 切换路径
      cd electra_small_pretrain_pytorch
      # 安装所需的python依赖包
      pip install -r requirements.txt
      

      4、注册wandb账号

      (1)打开 https://wandb.ai/site

      (2)点击头像下的Settings,寻找api key

      下拉到api keys,如果没有就New key。复制该api key

      (3)登录

      # 登录wandb
      wandb login
      # 复制进去api key
      

      5、后台运行预训练程序

      # 切换路径,确保在这个路径
      cd /hy-tmp/hy_tutorial/electra_small_pretrain_pytorch
      # 后台运行程序
      nohup python pretrain.py >> electra_small_pretrain.log 2>&1 &
      # 查看训练日志
      tail -f electra_small_pretrain.log
      

      6、终止预训练程序

      # 查看进程
      ps -aux
      # 终止进程
      kill 2983
      

      7、等待程序运行完毕(差不多需要55h)

      # 同步训练损失等数据到wandb
      wandb sync wandb/latest-run
      


      Reference

      https://github.com/richarddwang/electra_pytorch

      1 Reply Last reply Reply Quote 2
      • Alice_恒源云
        Alice_恒源云 last edited by

        关于本篇RTX 3090训练结果的展示,大家可以移步至lz的另一篇帖子:

        【1 结果展示】哪个男孩不想拥有自己的预训练模型(留下贫穷的眼泪)

        另外,平台已经收到lz精心准备的训练视频了,这两天会上线,感兴趣的用户,记得关注本帖的更新动态哈~

        1 Reply Last reply Reply Quote 0
        • Pinned by  Alice_恒源云 Alice_恒源云 
        • Unpinned by  System 
        • Pinned by  Alice_恒源云 Alice_恒源云 
        • Unpinned by  System 
        • First post
          Last post