Estimate forward-pass FLOPs from fully-connected and convolutional layer dimensions, to compare model architectures before training.
FLOPs 衡量模型计算量。
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Matmul counting | an m-by-k times k-by-n matrix product costs about 2mnk floating point operations | BLAS / cuBLAS convention |
| Parameter estimate | inference FLOPs approximate twice the parameter count times the token count | Kaplan et al. 2020 scaling laws |
| Unit | FLOPs counts operations while FLOPS counts operations per second | MLPerf benchmark rules |
全连接层 FLOPs≈2·in·out·batch·seq(乘加各算一次)。