Skip to content

Instantly share code, notes, and snippets.

@hewumars
Last active February 12, 2020 04:49
Show Gist options
  • Save hewumars/018317cce46a1389cf4d35191ff4996d to your computer and use it in GitHub Desktop.
Save hewumars/018317cce46a1389cf4d35191ff4996d to your computer and use it in GitHub Desktop.
1.卷积和全连接层计算量FLOPs 2.带宽计算 3.峰值计算能力

HWC_in为特征图,K为卷积核

FLOPs=2HW(C_{in}K^2+1)C_{out}

I输入维度,O输出维度

FLOPs=(2I-1)O

  1. 一个MFLOPS(megaFLOPS)等於每秒一佰万(=10^6)次的浮点运算,
  2. 一个GFLOPS(gigaFLOPS=BillionFlops)等於每秒拾亿(=10^9)次的浮点运算,
  3. 一个TFLOPS(teraFLOPS)等於每秒万亿(=10^12)次的浮点运算,
  4. 一个PFLOPS(petaFLOPS)等於每秒千万亿(=10^15)次的浮点运算,
  5. 一个EFLOPS(exaFLOPS)等於每秒百亿亿(=10^18)次的浮点运算。

  1. (数据字节数byte)计算核心数主频=带宽(*B/s)
  2. 4个DDR4提供的带宽:19.2GB/s*4 = 76.8GB/s

GPU设备的单精度计算能力的理论峰值计算公式: 单精度计算能力的峰值 = 单核单周期计算次数 × 处理核个数 × 主频

以GTX680为例,   单核一个时钟周期单精度计算次数为两次,处理核个数 为1536, 主频为1006MHZ,那他的计算能力的峰值P 为
P = 2 × 1536 × 1006MHZ = 3.09TFLOPS
这里1MHZ = 1000000HZ, 1T为1兆,也就是说,GTX680每秒可以进行超过3兆次的单精度运算。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment