keepcalculator

06 Numbers and Powers

Estimate AI Workload Energy Use & Cost

Card No. 06·9996 · Updated · Standard formula, shown below

This guide shows you how to estimate the energy consumption and electricity cost of running AI workloads, whether you’re training a model on a GPU server or running inference in the cloud. You’ll learn a practical method that breaks the problem into three parts: hardware power draw, time, and electricity price. By the end, you’ll be able to produce a reasonable estimate for your own projects, useful for budgeting, comparing options, or understanding your environmental impact.

What You’ll Need

  • Details about your hardware (GPU model, CPU, etc.) or cloud instance type
  • Power consumption figures for that hardware (in watts) – often found in spec sheets or cloud provider documentation
  • Expected runtime of your workload (in hours)
  • Your electricity rate (in $ per kWh) – check your utility bill or cloud provider’s pricing
  • A simple calculator or spreadsheet

Step-by-Step

  1. Identify the hardware you’ll use. For on-premises, note the exact GPU model (e.g., NVIDIA A100, RTX 4090) and CPU. For cloud, note the instance type (e.g., p4d.24xlarge on AWS, A100 GPU on Google Cloud).
  2. Find the power draw (TDP) of each component. For GPUs, look up the Thermal Design Power (TDP) – for example, an NVIDIA A100 has a TDP of 400W. For CPUs, find the TDP (e.g., AMD EPYC 7763 is 280W). For cloud, the provider often lists the maximum power draw per instance; if not, use the sum of GPU TDPs plus a reasonable CPU and overhead estimate (see Tips).
  3. Determine the total system power draw. Add the power of all GPUs, the CPU, and a margin for memory, storage, and cooling. A common rule of thumb: total system power ≈ (GPU TDP × number of GPUs) + (CPU TDP × number of CPUs) + 50–100W for the rest. For a single A100 with a 280W CPU, that’s 400 + 280 + 80 = 760W.
  4. Estimate the runtime of your workload. This is the trickiest part. For training, you might estimate based on previous runs or use a benchmark. For inference, estimate the number of requests and the time per request. Be realistic – training can take days, inference might be milliseconds per query.
  5. Calculate energy consumption in kilowatt-hours (kWh). Use the formula: Energy (kWh) = (Power (W) / 1000) × Time (hours). For example, 760W for 10 hours = (760/1000) × 10 = 7.6 kWh.
  6. Multiply by your electricity rate. If your rate is $0.15 per kWh, then cost = 7.6 × 0.15 = $1.14. For cloud, you often pay for the instance per hour regardless of actual power, so you can skip the power calculation and just use the instance hourly price × runtime.
  7. Adjust for cooling and overhead (optional but recommended). Data centers have a Power Usage Effectiveness (PUE) factor, typically 1.2–2.0. Multiply your energy by PUE to account for cooling and other overheads. For on-prem, you might also consider the efficiency of your power supply (usually 80–95%).
  8. Sum up for your total cost. If you have multiple workloads, repeat the above for each and add them together. For cloud, don’t forget storage and network costs, but those are separate from energy.

Common Mistakes

  • Using TDP as actual power draw. TDP is the maximum under load, but your workload might not hit that 100% of the time. For a rough estimate, it’s fine, but for better accuracy, use measured power (e.g., with nvidia-smi) or a utilization factor (e.g., 70% of TDP).
  • Forgetting the CPU and other components. GPUs are the big draw, but a server has a CPU, RAM, and storage that also consume power. Ignoring them can underestimate by 20–30%.
  • Not converting watts to kilowatts. Power in watts, time in hours, but energy in kWh requires dividing watts by 1000. Missing this step gives you watt-hours, which is 1000× too small.
  • Using the wrong electricity rate. Your rate might be tiered or have demand charges. Use your effective rate (total bill / total kWh) for a more accurate estimate.
  • Forgetting PUE in cloud. Cloud providers include overhead in their pricing, but if you’re comparing to on-prem, you need to add that overhead yourself.

Tips

  • Use a power meter for on-prem. If you have access to the server, a cheap plug-in power meter gives you real numbers. Run a short benchmark and measure.
  • Check cloud provider documentation. Many providers list the maximum power draw per instance type. For example, AWS lists the power for GPU instances in their sustainability documentation.
  • Consider workload efficiency. If you optimize your code (using mixed precision, better batching), you can reduce runtime and thus energy. Sometimes spending a day optimizing saves more energy than you think.
  • Use a utilization factor. If your workload is not 100% GPU-bound, multiply the TDP by 0.6–0.8 for a more realistic average power.
  • For quick cloud estimates, use the instance price. It already includes energy and overhead, so you don’t need to calculate power separately.

Troubleshooting

  • Your estimate seems too high or too low. Check your power numbers – did you use the right TDP? Did you include all components? For cloud, are you using the correct instance type? Also, verify your runtime: training can be longer than expected due to data loading bottlenecks.
  • You don’t know the runtime. Run a small test job on a sample of your data, measure the time, and extrapolate. For inference, benchmark with a load test.
  • You can’t find the TDP for your cloud instance. Look for the GPU model in the instance specs, then look up that GPU’s TDP. Add a 20% overhead for the rest of the server.
  • Your electricity rate varies. Use an average rate, or calculate time-of-use rates if you know your workload runs during off-peak hours.
  • The cost seems negligible, but your bill is high. Remember that AI workloads often run 24/7. A small cost per hour adds up: 100W continuous for a month is 73 kWh, which could be $10–20. That’s not negligible for a hobbyist.

Frequently Asked Questions

How accurate is this estimate?

It’s a rough estimate, typically within 20–30% of actual. For better accuracy, use measured power and real runtime.

Does cloud pricing already include energy costs?

Yes, cloud instance pricing is all-inclusive: you pay per hour, and the provider covers electricity, cooling, and hardware. So for cloud, you don’t need to calculate energy separately – just multiply the instance price by runtime.

What is PUE and do I need it?

PUE (Power Usage Effectiveness) is the ratio of total facility energy to IT equipment energy. Data centers typically have PUE of 1.2–2.0. If you’re estimating on-prem energy, multiply your IT energy by PUE to account for cooling and losses.

Can I reduce energy use?

Yes: use efficient hardware (e.g., newer GPUs), optimize your code (mixed precision, better batching), and shut down idle instances. Also consider using spot instances for non-critical jobs.

How do I estimate inference energy for a web service?

Estimate the number of requests per second and the time per request (e.g., 0.1 seconds). Then power draw during inference is the GPU power at that utilization. Multiply by the number of hours the service runs.

Is it better to train on-prem or in the cloud for energy?

It depends on your hardware and electricity rates. On-prem might be cheaper if you have efficient hardware and low electricity costs. Cloud offers flexibility and often uses renewable energy, but you pay a premium. Compare your on-prem cost per hour to the cloud instance price.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →