Floating-Point Operations Calculator

Calculate layer, model, inference, and training operations with configurable counting conventions, precision, hardware throughput, visual breakdowns, exports, comparisons, and detailed formulas instantly for planning.

Workload settings

Two estimates backward work near twice forward work.

Model layers

Add, duplicate, remove, or reorder model components.

Counting conventions

Precision and hardware

TFLOP/s
%
%
GB/s
%
Peak throughput should match the selected precision. Real speed can differ greatly.

Formula used

Dense layers multiply inputs by every output unit. Convolutions repeat kernel operations across output positions. Counting rules determine whether each MAC means one or two.

ComponentCore estimate
DenseBatch × inputs × outputs × MAC factor
Conv2DBatch × output area × output channels × kernel area × input channels per group
RecurrentGates × batch × sequence × hidden size × combined input size
AttentionProjection operations plus score and value matrix operations
Hardware timeTotal FLOPs ÷ effective FLOPs per second

How to use this calculator

Choose the workload and enter global training values. Add every important model layer using matching dimensions. Review assumptions before comparing models or hardware performance estimates.

  1. Select layer, inference, or training mode.
  2. Add model layers and verify every output shape.
  3. Choose the MAC convention and included operations.
  4. Enter hardware throughput and sustained utilisation.
  5. Calculate, compare, chart, copy, or export results.

Example data

This example combines convolution and dense classification layers. It uses batches of thirty-two images. Replace these values with your model’s actual dimensions.

LayerInputsOutputsKernelBatch
Conv2D224 × 224 × 3224 × 224 × 643 × 332
Dense4,096 features1,000 featuresNot applicable32
Transformer512 tokens768 dimensions12 heads8

Understanding FLOPs

FLOPs and FLOP/s

FLOPs describe the arithmetic work required by computation. FLOP/s describes hardware processing speed over elapsed time. A large model can still run quickly on accelerators.

FLOPs and MACs

A MAC combines multiplication with an addition. Some reports count one MAC as two FLOPs. Always compare models using identical counting conventions and inclusions.

Why runtime differs

Memory access, kernel efficiency, and parallelism affect runtime. Equal-FLOP models can show very different measured latency. Benchmarking remains necessary for final deployment and purchasing decisions.

Frequently asked questions

What does this calculator measure?

It estimates arithmetic operations for machine learning workloads. It also estimates parameters, memory, and hardware time. Results remain theoretical until validated with actual benchmarks.

Is one MAC one or two FLOPs?

Both conventions appear in technical reports. This calculator supports either counting method. Use one convention consistently across every model comparison.

Are activation functions included?

Activation operations are optional through the counting controls. Costs differ between simple and transcendental functions. Custom activation layers accept user-defined operation costs directly.

How are training FLOPs estimated?

Training combines forward, backward, and optimizer operations. Epoch totals also use dataset and batch sizes. Checkpoint overhead can represent recomputation or extra processing.

Does lower precision reduce FLOPs?

Precision usually does not change arithmetic operation counts. It changes storage, bandwidth, and hardware throughput. Enter throughput matching the chosen precision for useful timing.

Why is measured speed often lower?

Peak specifications assume ideal kernels and full utilisation. Real workloads include memory and communication bottlenecks. Use sustained utilisation based on trustworthy measured performance.

How does key-value caching help?

Caching reuses previous attention keys and values. Autoregressive decoding then processes fewer new query tokens. Memory usage rises while repeated projection work decreases.

Can grouped convolutions be calculated?

Yes, enter the required number of groups. Input channels must divide evenly across those groups. Depthwise convolution automatically uses one group per channel.

Are FLOPs enough for model selection?

No, FLOPs exclude many practical deployment constraints. Accuracy, latency, memory, energy, and compatibility also matter. Test candidate models on the intended production hardware.

Related Calculators

Model Training Time CalculatorModel Throughput CalculatorGPU Memory Requirement CalculatorDataset Storage CalculatorModel File Size Calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.