Power and Energy Efficiency Measurement of the MCXN947 eIQ Neutron NPU
1. Background
For edge AI applications, developers typically focus on two key metrics:
AI inference performance (Inference Time)
Power consumption
For inference performance, NXP provides the dm-mcxn947-npu-vs-tensorflm-benchmark , which compares TensorFlow Lite Micro running on the CPU with the eIQ Neutron NPU. The benchmark demonstrates the significant inference performance improvement that can be achieved by using the NPU.
When it comes to power consumption, however, MCU developers often have another question:
Does enabling the NPU necessarily increase power consumption?
A similar analysis is provided in NXP application note AN14700 for the i.MX RT700. Although the NPU introduces a higher instantaneous current during inference, it significantly reduces inference time. As a result, the total energy consumed per inference can actually be much lower.
In this article, we use the MCXN947 to perform a similar experiment. Several TensorFlow Lite Micro (TFLM) models from the MCUXpresso SDK are measured to evaluate the impact of the eIQ Neutron NPU on overall energy consumption.
2. Theoretical Analysis
Current consumption is often used as a direct indicator of power consumption:
Current (mA)
However, for AI inference workloads, a more meaningful metric is:
Energy per Inference
In other words, how much energy is required to complete a single inference?
The basic relationships are:
Power = Voltage × Current
Energy = Power × Time
Therefore:
Energy = Voltage × Current × Inference Time
This means that even if the operating current increases, the total energy consumption can still decrease significantly if the inference time is reduced enough.
3. Experiment
NXP provides several TFLM-based eIQ examples for the MCXN947 in the MCUXpresso SDK.
For this experiment, the tflm_cifar10 demo is used as the baseline.
3.1 Test Environment
Hardware
FRDM-MCXN947
USB cable connected to J17
Joulescope current analyzer
The current is measured at J24 on the FRDM-MCXN947 board.
Software
MCUXpresso IDE
eIQ Toolkit
tflm_cifar10 demo from MCUXpresso SDK v26.3
3.2 Code Modifications
a. Create CPU and NPU Models
Following the model conversion procedure described in Sections 7.2 and 7.3 of AN14700, use the eIQ Toolkit to generate two models:
cifar10_quant.h
cifar10_npu.h
After conversion:
The CPU model runs on the Cortex-M33.
The NPU model is accelerated by the eIQ Neutron NPU.
The two versions can be selected by modifying line 27 in model.cpp.
b. Reduce the Overall Active Power Consumption
To reduce the system's active power consumption, the project can be modified based on the MCX N Power Manager AppCodeHub example.
Call lower_active_power() from low_power.cpp in main.cpp:
void lower_active_power()
{
APP_SetVBATConfiguration();
APP_SetSPCConfiguration();
APP_SetCMCConfiguration();
/* Disable unused clocks */
CLOCK_DisableClock(kCLOCK_Rom);
CLOCK_DisableClock(kCLOCK_PkcRam);
CLOCK_DisableClock(kCLOCK_Gdet);
CLOCK_DisableClock(kCLOCK_Pkc);
CLOCK_DisableClock(kCLOCK_Css);
}
This disables unused clocks and helps reduce the baseline active current.
c. Disable the NPU Clock for the CPU Baseline Test
To obtain a clean CPU-only baseline, the NPU clock should also be disabled when the NPU is not being used.
Define a USES_NPU macro for each model.
In cifar10_quant.h:
#define USES_NPU 0
In cifar10_npu.h:
#define USES_NPU 1
Then modify MODEL_RunInference() so that the NPU clock is enabled only when NPU inference is performed:
status_t MODEL_RunInference(void)
{
//If model uses NPU then turn on the NPU clock before inferencing
#if (USES_NPU==1)
SYSCON->AHBCLKCTRLSET[3] |= (1UL << SYSCON_AHBCLKCTRL3_NPU_SHIFT); //Turn NPU clock on to do inference using NPU
#endif
if (s_interpreter->Invoke() != kTfLiteOk)
{
PRINTF("Invoke failed!\r\n");
return kStatus_Fail;
}
SYSCON->AHBCLKCTRLCLR[3] |= (1UL << SYSCON_AHBCLKCTRL3_NPU_SHIFT); //Turn off NPU clock
return kStatus_Success;
}
d. Make the Current Waveform Easier to Measure
To make the different execution phases easier to distinguish in Joulescope, add the following macros to demo_config.h:
#define NUM_INFERENCES 8
#define USE_DELAY 1
NUM_INFERENCES controls the number of inference iterations, while USE_DELAY adds delays between operations so that the corresponding sections can be identified more clearly in the Joulescope waveform.
e. Turn Off the NPU Clock Outside Inference
To ensure that the measured current difference mainly reflects the AI inference itself, disable the NPU clock outside the actual inference period:
SYSCON->AHBCLKCTRLCLR[3] |=
(1UL << SYSCON_AHBCLKCTRL3_NPU_SHIFT);
3.3 Obtaining the Measurement Results
a. Inference Time
After running the application, the inference time can be obtained directly from the serial console output.
The measured CIFAR-10 results are:
CIFAR-10 CPU (150 MHz): 185.13 ms
CIFAR-10 NPU: 5.54 ms
This already shows a significant reduction in execution time when the Neutron NPU is used.
b. Current Measurement
Connect the Joulescope to the J24 measurement point on the FRDM-MCXN947.
Open Waveform and Multimeter from the Widgets menu in Joulescope UI to monitor and measure the current.
Before taking power measurements, make sure to perform a power reset. Otherwise, the measured current may be higher than expected.
c. Calculate Energy per Inference
The energy consumed for each inference can be calculated as:
Energy per Inference = Voltage × Current × Inference Time
3.4 Test Results
The table below summarizes the measurements for two SDK example models. The supply voltage is assumed to be 3.3 V.
3.5 Analysis
The results reveal an interesting point.
Taking CIFAR-10 as an example, if we look only at current consumption, the NPU appears to consume slightly more current:
CPU: 9.4 mA
NPU: 10.0 mA
However, the inference time decreases dramatically:
CPU: 185.13 ms
NPU: 5.54 ms
As a result, the energy required for one inference decreases from 5742.7 µJ to 182.8 µJ, corresponding to a 31.4× reduction in energy consumption per inference.
The same trend can be observed with the KWS model, where the NPU reduces the energy per inference by 13.7×.
This behavior is consistent with the observations reported for the i.MX RT700 in AN14700.
4. Conclusion
Most edge AI systems operate in an event-driven manner. The device remains in a low-power state most of the time and wakes up only when a specific event occurs to perform an AI inference.
Typical examples include:
Keyword spotting
Environmental anomaly detection
Visual detection
Predictive maintenance
For this type of application, looking only at the average current during inference does not provide a complete picture of the system's energy efficiency.
A more meaningful metric is Energy per Inference, because it represents the total amount of energy required to complete one AI inference operation and directly affects how many inference tasks a battery-powered device can perform over its operating lifetime.
The measurements in this experiment show that although the MCXN947 eIQ Neutron NPU introduces a slightly higher instantaneous operating current, it significantly reduces model execution time. As a result, the total energy consumed per inference is greatly reduced.
For the CIFAR-10 and KWS models tested here, the NPU achieved more than an order-of-magnitude improvement in energy efficiency, with energy reductions of 31.4× and 13.7×, respectively.
For long-running, battery-powered edge AI applications, this improvement in energy efficiency can be even more valuable than the inference performance improvement itself.
MCXN NPU|ML
View full article