Skip to content

  • 体验新版
    • 正在加载...
  • 登录
  • PaddlePaddle
  • Paddle
  • 合并请求
  • !23910

P
Paddle
  • 项目概览

PaddlePaddle / Paddle
大约 2 年 前同步成功

通知 2325
Star 20933
Fork 5424
  • 代码
    • 文件
    • 提交
    • 分支
    • Tags
    • 贡献者
    • 分支图
    • Diff
  • Issue 1423
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 543
  • Wiki 0
    • Wiki
  • 分析
    • 仓库
    • DevOps
  • 项目成员
  • Pages
P
Paddle
  • 项目概览
    • 项目概览
    • 详情
    • 发布
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 分支图
    • 比较
  • Issue 1,423
    • Issue 1,423
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 543
    • 合并请求 543
  • Pages
  • 分析
    • 分析
    • 仓库分析
    • DevOps
  • Wiki 0
    • Wiki
  • 成员
    • 成员
  • 收起侧边栏
  • 动态
  • 分支图
  • 创建新Issue
  • 提交
  • Issue看板

enable cudnn in softmax API [WIP] !23910

  • Report abuse
!23910 开放中 4月 16, 2020 由 saxon_zh@saxon_zh 创建
#<User:0x000055935baad838>
  • 概览 4
  • 提交 1
  • 变更 1

Created by: mapingshuo

Problem

When training the bert-large model on 4 V100 cards, I found that the softmax operator runs very slow. I turn use_cudnn in softmax API to True, and the training process obtains 20% speed accelerated. We should turn the default value of use_cudnn to True since it is 10 times quicker than the non-cudnn one.

speed
without cudnn 11.1 steps/s
with cudnn 13.1 steps/s

profile without cudnn:

Event                                                       Calls       Total       CPU Time (Ratio)        GPU Time (Ratio)        Min.        Max.        Ave.        Ratio.
softmax                                                     24          41.3891     2.063354 (0.049853)     39.325744 (0.950147)    1.702       1.81038     1.72455     0.0165059
softmax_grad                                                24          93.6806     5.729520 (0.061160)     87.951125 (0.938840)    3.42631     6.93811     3.90336     0.0373596

profile with cudnn:

Event                                                       Calls       Total       CPU Time (Ratio)        GPU Time (Ratio)        Min.        Max.        Ave.        Ratio.
softmax                                                     24          9.38122     0.746789 (0.079605)     8.634429 (0.920395)     0.360629    0.4713      0.390884    0.00478599
softmax_grad                                                24          9.14636     1.081652 (0.118260)     8.064708 (0.881740)     0.330742    0.640794    0.381098    0.00466618

Reproduce

git clone https://github.com/PaddlePaddle/Fleet.git
cd Fleet/benchmark/collective/bert
sh  train.sh

The way to turn on use_cudnn=True in model/transformer_encoder.py is as follows:

        weights = layers.softmax(product, use_cudnn=True)
指派人
分配到
审核者
Request review from
无
里程碑
无
分配里程碑
工时统计
标识: paddlepaddle/Paddle!23910
Source branch: github/fork/mapingshuo/softmax_enable_cudnn
渝ICP备2023009037号

京公网安备11010502055752号

网络110报警服务 Powered by GitLab CE v13.7
开源知识
Git 入门 Pro Git 电子书 在线学 Git
Markdown 基础入门 IT 技术知识开源图谱
帮助
使用手册 反馈建议 博客
《GitCode 隐私声明》 《GitCode 服务条款》 关于GitCode
Powered by GitLab CE v13.7