Skip to content
NEURAX
Download
← All posts

Guide ·

How to estimate AI training memory and cost before you train

Most training failures are sizing mistakes found too late. Here is how to know a model's parameters, FLOPs and memory before you run it, and how far to trust the numbers.

The expensive way to learn that a model does not fit is to start training it. A sizing estimate made beforehand costs nothing and answers three questions: how many parameters, how much compute, and how much memory.

Why running the model is the slow way to measure it

A model is a graph of operations: matrix multiplications, convolutions, attention, normalizations. If you know the graph, you can count each operation's parameters and floating-point operations, and the bytes autograd keeps for the backward pass, without running anything.

That is how NEURAX works. It compiles the architecture to the operations it is made of and prices them, which is why it answers in milliseconds, and why it can cost a model far larger than your machine.

Can the numbers be trusted?

The compiler is checked against 73 published architectures measured with PyTorch: parameters, FLOPs by operator, and autograd bytes. An automated test compiles 56 of them on every change, and fails if parameters drift more than 1% or FLOPs more than 5%. Models it does not yet reproduce are listed with the reason.

Each figure in the studio says whether it is exact, measured or estimated, so you know how much weight it can carry. The [measurement report](/accuracy) lists what was tested and what the results do not prove.

A simple routine

1. Import a published model from Hugging Face or start from a template. 2. Tell NEURAX about your machine. 3. Read the analysis: parameters, memory, time and cost. 4. Change the design until it fits, then approve the training run.

The [documentation](/docs) walks through each step, and the Community plan is free.