CNN cost summary
| # | Layer | Type | Input | Output | Parameters | MACs | FLOPs | Activation | Compute share |
|---|
The chart uses each enabled layer’s FLOP estimate.
Store two result snapshots, then compare their costs.
Core CNN cost equations
A convolution output follows the standard discrete shape equation. Dilation expands the effective kernel without adding weights. Grouping reduces connected input channels per filter.
Build and analyse a CNN
- Enter the input tensor, precision, batch, and workload.
- Choose hardware assumptions for theoretical runtime estimates.
- Load a preset or build layers manually.
- Check every layer’s dimensions and grouping values.
- Select the FLOP convention used by your reference.
- Calculate, inspect bottlenecks, compare snapshots, and export results.
Small classifier example
| Layer | Input | Configuration | Expected output |
|---|---|---|---|
| Conv 1 | 32 × 32 × 3 | 16 filters, 3 × 3, stride 1, same | 32 × 32 × 16 |
| Max pool | 32 × 32 × 16 | 2 × 2, stride 2 | 16 × 16 × 16 |
| Conv 2 | 16 × 16 × 16 | 32 filters, 3 × 3, stride 1, same | 16 × 16 × 32 |
| Global average | 16 × 16 × 32 | Average each feature map | 1 × 1 × 32 |
| Dense | 32 features | 10 outputs | 10 features |
CNN computational cost questions
What is a MAC?
A MAC combines one multiplication and one accumulation. Some references count it as one FLOP. Others count it as two FLOPs.
Why do FLOP totals differ between tools?
Tools may use different MAC conventions. They may include activations, bias, normalization, or pooling. Always compare matching assumptions.
Does parameter count predict runtime?
Not reliably. Activation sizes and data movement also matter. Hardware kernels can favour specific layer shapes.
How is grouped convolution handled?
Each filter sees fewer input channels. Input channels must divide evenly by groups. Output channels must also divide evenly.
How is depthwise convolution calculated?
The group count equals input channels. Each channel receives separate spatial filters. Pointwise mixing is counted separately when selected.
Is training memory exact?
No. Framework workspaces and saved tensors vary. The estimate exposes adjustable memory multipliers.
Why can bandwidth limit latency?
Low arithmetic intensity moves many bytes per operation. Compute units then wait for memory transfers. The calculator reports both limits.
Can this replace hardware benchmarking?
No. It provides transparent theoretical estimates. Benchmark the final exported model on target hardware.
What does activation checkpointing change?
It stores fewer forward activations during training. Backward computation may increase through recomputation. This tool adjusts stored activation memory.