In the first article, we looked at what happens to an AI accelerator when it gets hot: power creeps up as it heats, then performance drops once it reaches its thermal throttling point.

Series: Edge AI Thermal Management

In this article, we want to achieve two things:

  1. Determine how much airflow is needed to prevent thermal throttling for a selection of M.2 AI accelerator modules.
  2. Implement a thermal control loop that reacts to power consumption, and previous power-temperature observations, in order to be more proactive in the thermal management.

First, let’s take a look at the setup we will build.

Setup Overview

In my previous power telemetry project, I used a USB-I2C bridge to control the INA228 power monitor:

This limited the number of readings that were achievable, since the host PC was involved in performing each reading, in addition to running the AI pipeline under test.

In this project, we will be offloading that host processing to the Renesas RA6M5 embedded microcontroller.

I chose the RA6M5 because it belongs to the Renesas RA family, which scales from this 200 MHz Cortex-M33 down to small, inexpensive microcontrollers, all supported by the same software package (Renesas FSP). The thermal control loop can be developed on a part with plenty of margin, and then moved to a much smaller RA device for a product.

We will also be using the following additional components:

General Diagram

The I2C connections are easy with the Qwiic cabling solution. The SPI interface, and other signals, need to be connected manually. The next section goes into more detail for these manual connections.

Wiring Diagrams

The fan controller provides a PWM signal (FAN) to the fan, and reads back its speed with a feedback signal (TACH). The fan’s 5 V power comes from the VU pin of the SparkFun Thing Plus RA6M5 module.

The thermocouple amplifier uses an SPI interface, which needs to be connected as follows:

Assembly Plate

In order to hold the various components in place, I created a base plate that will slide underneath the M.2 accelerator module.

The following diagram illustrates how the components attach to the base plate, as well as how the assembly is placed underneath the M.2 accelerator module.

I have identified the location of a second FS3000 module. This can be used as an alternate location (downstream instead of upstream), or for a second airflow sensor. Since this module has a fixed I2C address, a Qwiic-compatible I2C mux module would be required to support multiple FS3000 devices.

A 1:1 printable template of the plate is also available. Check the 100 mm scale bar after printing. The plate outline and holes are also available as a DXF file, for cutting on a CNC or laser cutter.

Final Assembly

Here is my final assembly, shown with a DX-M1 module installed.

How Much Airflow Is Needed ?

In order to determine how much airflow was needed, I started by loading the AI accelerator for 30 minutes, enough for it to reach its stable thermally-throttled state.

Next, I progressively increased the fan’s speed, and measured the airflow, in order to determine when the AI accelerator no longer throttled its operating frequency.

Both accelerators ran ResNet-50 for 320 minutes, with the same fan schedule: 30 minutes with the fan off, then the fan stepped up one EMC2101 duty level every 5 minutes, from 9.5% to 100%. The EMC2101 fan controller only has 64 duty levels, 1.6 points apart, so each step lands exactly on the next level. The 9.5% starting point is the lowest level at which this fan rotates continuously. After the load stopped, the fan stayed at 100% for a 30-minute cool-down. The fan, the airflow sensor and the M.2 slot were the same for both runs. Only the accelerator changed.

I used my mb-benchmark-gui application to run these sessions:

Here is a snapshot of my latest run with the Hailo-8, a few minutes into the fan-off soak:

The raw logs are available for the Hailo-8 and the DX-M1.

Comparative Analysis

The following charts compare the results for Hailo-8 and DeepX DX-M1, on the same time axis, each at full scale.

Thermal Throttling

The first graph indicates the on-die temperature for each NPU, as well as its operating frequency. When the NPU reaches a certain temperature threshold (104 °C for Hailo-8, about 88 °C for DX-M1), the operating frequency is lowered, thus implementing its thermal throttling. This is the behaviour we want to characterize and avoid.

Hailo-8DX-M1
Die temperature (°C) · hottest on-die sensor
Reported core clock (MHz) · Hailo-8 steps 400 / 350 / 300; DX-M1 lowest of 3 cores, 1 Hz read
Frame rate (FPS) · ResNet-50; Hailo-8 at async depth 8, DX-M1 at depth 4
Both runs on one time axis, full scale. Plotted every 10 s; hover any panel to read both modules at that moment.

The two modules throttle in very different ways.

The Hailo-8 steps its core clock down in discrete levels: from 400 MHz to 350 MHz, then 300 MHz. During the last 10 minutes of the soak, it spent 63% of the time at 350 MHz and 37% at 300 MHz, and its frame rate followed the clock exactly. The result is a large, slow oscillation (1028–1202 FPS), clearly visible in the reported clock, the frame rate and the power.

The DX-M1 throttles with a fast, shallow dither between 1000 MHz and 800 MHz. Over the same last 10 minutes of the soak, its frame rate was 6% below its cooled value, which implies that it spent roughly 30% of the time at 800 MHz (assuming throughput scales with the clock). However, the reported clock caught 800 MHz in fewer than 1% of the samples, and the samples reporting a full 1000 MHz were themselves 6% slow.

This is a limitation of my measurement setup. The clock is read once per second, as an instantaneous value, while the frame rate is averaged over the whole second. The DX-M1’s dither is faster than this 1 Hz sampling, so we are not able to see its fine-grain throttling, only its effect on the frame rate. For this module, the frame rate is the only reliable throttling indicator.

Power Efficiency

The following graph illustrates the effects of heat and thermal throttling on the power efficiency.

Hailo-8DX-M1
Frame rate (FPS) · ResNet-50; Hailo-8 at async depth 8, DX-M1 at depth 4
Module power (W) · INA228 on the 3.3 V rail
Efficiency (FPS/W) · frames per joule
Both runs on one time axis, full scale. Plotted every 10 s; hover any panel to read both modules at that moment.

Although the Hailo-8 NPU undergoes more heat and more pronounced thermal throttling, it remains more power efficient than DeepX DX-M1.

Power versus Temperature

When running at their full frame rate, both modules consume more power as they get hotter. Since the AI workload is identical, most of this increase is likely leakage. The INA228 measures the whole module, however, so the memory and voltage regulators, which can also drift with temperature, are included.

Hailo-8DX-M1
Module power against die temperature, at full frame rate only (full scale)
Mean power in 2 °C bins, using only the samples where the module ran at its full frame rate, so the rise is leakage rather than extra work. Dashed lines are straight-line fits: about 18 mW/°C for the Hailo-8 and 13 mW/°C for the DX-M1.
Show the data
Hailo-8
°CWsamples
594.3755285
614.391675
634.414630
654.438618
674.463636
694.491540
714.524564
734.553378
754.586413
774.624508
794.655590
814.692502
834.725464
854.772339
874.813255
894.859289
914.91284
934.968123
955.016190
975.084223
995.137162
1015.21421
1035.265348
DX-M1
°CWsamples
555.42721
575.44320
595.46921
615.48627
635.4595454
655.4811618
675.5011494
695.5261102
715.5481086
735.573827
755.599594
775.627598
795.656548
815.686481
835.717497
855.75550
875.76743
895.77442

At full scale, the leakage is visible, but modest compared with each module’s total power. Over the temperatures each module covered at its full frame rate, the Hailo-8’s power rises from 4.38 W at 59 °C to 5.27 W at 103 °C (+20%), and the DX-M1’s from 5.43 W at 55 °C to 5.77 W at 89 °C (+6%). At every temperature both modules reached, the DX-M1 draws between 0.9 W and 1.1 W more than the Hailo-8.

Zooming in on the 4 W to 6 W range makes the two slopes easier to compare:

Hailo-8DX-M1
Module power against die temperature, at full frame rate only (zoomed in)
Mean power in 2 °C bins, using only the samples where the module ran at its full frame rate, so the rise is leakage rather than extra work. Dashed lines are straight-line fits: about 18 mW/°C for the Hailo-8 and 13 mW/°C for the DX-M1.
Show the data
Hailo-8
°CWsamples
594.3755285
614.391675
634.414630
654.438618
674.463636
694.491540
714.524564
734.553378
754.586413
774.624508
794.655590
814.692502
834.725464
854.772339
874.813255
894.859289
914.91284
934.968123
955.016190
975.084223
995.137162
1015.21421
1035.265348
DX-M1
°CWsamples
555.42721
575.44320
595.46921
615.48627
635.4595454
655.4811618
675.5011494
695.5261102
715.5481086
735.573827
755.599594
775.627598
795.656548
815.686481
835.717497
855.75550
875.76743
895.77442

The Hailo-8’s power rises by about 18 mW/°C, and the DX-M1’s by about 13 mW/°C. Relative to their cooled power (4.38 W and 5.46 W), that is 0.42%/°C for the Hailo-8, almost twice the DX-M1’s 0.23%/°C.

This confirms the observation from Part 1: the power drift with temperature is larger on the Hailo-8 than on the DX-M1.

Efficiency versus Temperature

Combining these two effects, efficiency degrades steadily with temperature on both modules.

Hailo-8DX-M1
Efficiency against die temperature, every sample of each run (full scale)
Mean efficiency in 2 °C bins over all samples, throttled ones included. Hollow points are bins where the module was throttling (frame rate more than 1 % below its cooled rate). Throttling lowers power, but not enough to recover efficiency.
Show the data
Hailo-8
°CFPS/Wsamplesthrottled
59313.65285
61312.5675
63310.9630
65309.2618
67307.5636
69305.6540
71303.3564
73301.4378
75299.2414
77296.8508
79294.8590
81292.5502
83290.4464
85287.6339
87285.2255
89282.4289
91279.5284
93276.2123
95273.6190
97269.9223
99266.1227yes
101261.9796yes
103258.4689yes
105251.3380yes
107246.33530yes
109246.735yes
DX-M1
°CFPS/Wsamplesthrottled
55199.021
57198.420
59197.621
61196.827
63195.45504
65194.81630
67194.21508
69193.41115
71192.71089
73191.9831
75191.1598
77190.2603
79189.4550
81188.5483
83187.6500
85186.7554
87184.61377yes
89180.92692yes

At full scale, the gap between the two modules dominates the chart. The two curves never overlap: the Hailo-8’s least efficient point (246 FPS/W, heat-soaked and throttling) is still above the DX-M1’s most efficient one (199 FPS/W). The hollow points mark the temperatures at which each module was throttling. On the Hailo-8, these extend down to about 99 °C, below its 104 °C trigger point: once throttled, the Hailo-8 only returned to full speed after it had cooled to about 99 °C, and throttled again as soon as it climbed back to 104 °C.

Zooming in on the 150 to 350 FPS/W range shows how steadily each curve declines:

Hailo-8DX-M1
Efficiency against die temperature, every sample of each run (zoomed in)
Mean efficiency in 2 °C bins over all samples, throttled ones included. Hollow points are bins where the module was throttling (frame rate more than 1 % below its cooled rate). Throttling lowers power, but not enough to recover efficiency.
Show the data
Hailo-8
°CFPS/Wsamplesthrottled
59313.65285
61312.5675
63310.9630
65309.2618
67307.5636
69305.6540
71303.3564
73301.4378
75299.2414
77296.8508
79294.8590
81292.5502
83290.4464
85287.6339
87285.2255
89282.4289
91279.5284
93276.2123
95273.6190
97269.9223
99266.1227yes
101261.9796yes
103258.4689yes
105251.3380yes
107246.33530yes
109246.735yes
DX-M1
°CFPS/Wsamplesthrottled
55199.021
57198.420
59197.621
61196.827
63195.45504
65194.81630
67194.21508
69193.41115
71192.71089
73191.9831
75191.1598
77190.2603
79189.4550
81188.5483
83187.6500
85186.7554
87184.61377yes
89180.92692yes

The Hailo-8 drops from 314 FPS/W at 59 °C to 247 FPS/W at 109 °C (−21%), and the DX-M1 from 199 FPS/W at 55 °C to 181 FPS/W at 89 °C (−9%). Throttling reduces power, but it reduces the frame rate in at least the same proportion, so it does not recover any efficiency.

The Hailo-8 has the most to lose from heat, since it suffers from both more leakage and deeper throttling. Even fully heat-soaked, however, it remains more efficient than the cooled DX-M1 on this model.

How Much Airflow ?

The following graph shows the fan schedule that drove both runs: the duty cycle applied by the EMC2101, and the airflow measured upstream by the FS3000.

Hailo-8DX-M1
Fan duty (%) · applied by the EMC2101, same schedule in both runs
Airflow (m/s) · measured upstream by the FS3000, both runs
Both runs on one time axis, full scale. Plotted every 10 s; hover any panel to read both modules at that moment.

The fan stays off for the 30-minute soak, then climbs one EMC2101 level (1.6 points) every 5 minutes. At its first level (9.5% duty), the fan is kicked into motion, briefly spinning up to about 2,700 RPM before settling at about 350 RPM and 0.17 m/s. From there, the airflow rises almost linearly with the duty cycle.

The fan and airflow traces of the two runs lie on top of each other: across the 58 fan levels, their airflow differs by 0.01 m/s on average, and never by more than 0.03 m/s. Since the rig behaved the same way in both runs, the differences we observe between the two modules come from the modules themselves.

For both modules, about 1.5 m/s of airflow was enough to eliminate thermal throttling: 1.18 m/s for the DX-M1, and 1.47 m/s for the Hailo-8. The dashed markers in the graph above show when this happened: after about 72 minutes for the DX-M1 (22.2% duty), and after about 86 minutes for the Hailo-8 (27.0% duty).

Hailo-8DX-M1
Frame rate against airflow, one point per fan level (settled end of each level)
Each fan level was held for 5 minutes; each point is the mean of its last 60 s. Full frame rate from 1.18 m/s on the DX-M1 and 1.47 m/s on the Hailo-8.
Show the data
One row per fan level. The EMC2101 has 64 duty levels, 1.6 points apart; the "Held" column is how long each level was held, in seconds.
Hailo-8
Duty %Held sm/sFPS %Die °C
9.53000.1780.8107.1
11.13000.2879.8107.4
12.73000.481.2107.4
14.33000.5681.7107.2
15.93010.7184.3107.8
17.52990.8787.5107.7
19.03000.9987.5106.9
20.63001.187.5105.2
22.23001.287.5102.2
23.83001.2887.5100.3
25.43001.3887.5100.7
27.03001.47100.0103.6
28.63001.55100.0101.0
30.23001.62100.097.6
31.73011.69100.093.9
33.32991.75100.090.3
34.93001.82100.088.6
36.53001.89100.086.1
38.13001.95100.084.1
39.73002.03100.082.4
41.33002.1100.081.5
42.93002.17100.080.4
44.43002.24100.079.8
46.03002.3100.078.2
47.63002.36100.077.4
49.23002.43100.075.7
50.83002.5100.074.5
52.43012.56100.072.6
54.02992.62100.071.6
55.63002.68100.070.7
57.13002.74100.069.4
58.73002.8100.068.0
60.33002.85100.067.1
61.93002.9100.066.3
63.53002.95100.065.2
65.13003.03100.064.1
66.73003.08100.063.4
68.33003.15100.062.5
69.83003.21100.061.6
71.43003.29100.060.6
73.03003.35100.059.6
74.63003.36100.059.8
76.23003.36100.059.8
77.83003.36100.059.7
79.43003.36100.059.7
81.03003.36100.059.9
82.53003.37100.059.6
84.13003.38100.059.4
85.73003.36100.059.7
87.33003.36100.060.0
88.93003.37100.059.7
90.53003.36100.059.5
92.13003.37100.059.7
93.73003.37100.059.5
95.23003.37100.059.6
96.83003.37100.059.5
98.43003.37100.059.7
100.02993.37100.059.9
DX-M1
Duty %Held sm/sFPS %Die °C
9.53000.1692.888.0
11.13000.2893.289.0
12.73000.3993.089.0
14.33000.5593.289.0
15.93000.6993.888.0
17.53000.8495.088.0
19.03000.9796.787.0
20.63001.0998.787.0
22.23001.18100.186.0
23.83001.27100.386.0
25.43001.36100.485.0
27.03001.44100.483.0
28.63001.52100.382.0
30.23001.59100.380.0
31.73001.66100.379.0
33.33001.73100.377.0
34.93001.79100.377.0
36.53001.87100.275.0
38.13001.94100.274.0
39.73002.01100.273.0
41.33002.08100.272.0
42.93002.16100.272.0
44.43002.23100.271.0
46.03002.3100.271.0
47.63002.37100.270.0
49.23002.43100.170.0
50.83002.49100.169.0
52.43002.56100.168.0
54.03002.62100.168.0
55.63002.67100.067.0
57.13002.73100.167.0
58.73002.79100.166.0
60.33002.84100.166.0
61.93002.91100.166.0
63.53002.96100.265.0
65.13003.02100.165.0
66.73003.08100.165.0
68.33003.15100.065.0
69.83003.2199.964.0
71.43003.29100.163.0
73.03003.35100.063.0
74.63003.35100.063.0
76.23003.36100.063.0
77.83003.35100.063.0
79.43003.35100.163.0
81.03003.35100.063.0
82.53003.35100.063.0
84.13003.36100.063.0
85.73003.35100.163.0
87.33003.35100.063.0
88.93003.3599.963.0
90.53003.36100.063.0
92.13003.3699.863.0
93.73003.36100.063.0
95.23003.36100.163.0
96.83003.3599.963.0
98.43003.35100.063.0
100.02993.35100.063.0

With the Noctua NF-A4x10, this is less than a third of the fan’s range. Beyond about 73% duty, the fan’s speed and airflow (3.37 m/s) no longer increased at all.

Hailo-8DX-M1
Airflow against applied fan duty, Noctua NF-A4x10 5V PWM (mean of each level)
The two runs were made separately, with the accelerator swapped in between, and their curves overlap. The fan does not rotate continuously below 9.5 % duty, and airflow stops rising at about 73 % duty (3.37 m/s).
Show the data
One row per fan level. The EMC2101 has 64 duty levels, 1.6 points apart; the "Held" column is how long each level was held, in seconds.
Hailo-8
Duty %Held sRPMm/s
9.53003700.17
11.13004910.28
12.73006070.4
14.33007380.56
15.93018540.71
17.52999730.87
19.030010870.99
20.630012001.1
22.230013161.2
23.830014251.28
25.430015421.38
27.030016451.47
28.630017541.55
30.230018601.62
31.730119671.69
33.329920711.75
34.930021751.82
36.530022831.89
38.130023851.95
39.730024932.03
41.330025922.1
42.930026932.17
44.430027952.24
46.030028922.3
47.630029982.36
49.230030942.43
50.830031962.5
52.430132972.56
54.029933962.62
55.630034922.68
57.130035932.74
58.730036942.8
60.330037812.85
61.930038832.9
63.530039692.95
65.130040763.03
66.730041693.08
68.330042603.15
69.830043613.21
71.430044773.29
73.030045763.35
74.630045823.36
76.230045823.36
77.830045853.36
79.430045853.36
81.030045893.36
82.530045913.37
84.130045903.38
85.730045843.36
87.330045883.36
88.930045903.37
90.530045913.36
92.130045913.37
93.730045893.37
95.230045893.37
96.830045853.37
98.430045843.37
100.029945833.37
DX-M1
Duty %Held sRPMm/s
9.53003700.16
11.13004940.28
12.73006100.39
14.33007440.55
15.93008560.69
17.53009720.84
19.030010860.97
20.630011981.09
22.230013141.18
23.830014201.27
25.430015401.36
27.030016441.44
28.630017541.52
30.230018561.59
31.730019621.66
33.330020671.73
34.930021701.79
36.530022821.87
38.130023881.94
39.730024972.01
41.330025982.08
42.930027052.16
44.430028082.23
46.030029082.3
47.630030132.37
49.230031112.43
50.830032112.49
52.430033122.56
54.030034132.62
55.630035072.67
57.130036132.73
58.730037142.79
60.330038042.84
61.930039112.91
63.530040002.96
65.130041013.02
66.730042003.08
68.330042893.15
69.830043933.21
71.430045013.29
73.030046013.35
74.630046063.35
76.230046063.36
77.830046043.35
79.430046043.35
81.030046053.35
82.530046063.35
84.130046073.36
85.730046053.35
87.330046073.35
88.930046083.35
90.530046093.36
92.130046093.36
93.730046073.36
95.230046073.36
96.830046063.35
98.430046073.35
100.029946083.35

Each duty step was held for 5 minutes. This is about three thermal time constants for the Hailo-8, so its die temperature had settled before each step. The slower DX-M1 has a time constant of about 4 minutes, so its die was still settling at the end of each step, and its true threshold may be slightly lower.

Deeper Hailo-8 Analysis with Thermocouple

For this session, I repeated the Hailo-8 run with the MAX31855 thermocouple fitted, using the same 320-minute fan schedule. The raw log is available here.

The thermocouple measures the heatsink temperature, which adds a third point along the thermal path, between the die and the ambient air.

The thermocouple bead sits on the heatsink, between the fins, directly over the NPU. It makes contact through a dab of Thermal Grizzly Kryonaut thermal paste (3.7 g/cm³), and a wooden dowel inserted between the fins holds it in place.

The bead, in Kryonaut thermal paste between the fins, over the NPU.
The bead, in Kryonaut thermal paste between the fins, over the NPU.
Side view: the wooden dowel between the fins holds the bead in place.
Side view: the wooden dowel between the fins holds the bead in place.
The module installed, heatsink facing down: the dowel works against gravity, holding the thermocouple in place.
The module installed, heatsink facing down: the dowel works against gravity, holding the thermocouple in place.

Die (on-die sensor)Heatsink (thermocouple)Ambient (EMC2101)
Temperatures (°C) · die (on-die sensor), heatsink (thermocouple), ambient (EMC2101)
Hailo-8 run with the thermocouple fitted, full scale. Plotted every 10 s; hover to read every value at that moment.

The heatsink closely tracks the die throughout the run, about 8 °C below it: 99 °C against 107 °C with the fan off, and 53 °C against 60 °C with the fan at full speed. The ambient air near the module stays between 23 °C and 26 °C. At idle, before the load starts, the die and the heatsink both read 40 °C, and they converge again during the cool-down.

Since the INA228 also gives us the module’s power, we can split the junction-to-ambient thermal resistance (R_ja) into its two parts: die to heatsink (R_js), and heatsink to ambient (R_sa).

R_ja (die to ambient)R_sa (heatsink to ambient)R_js (die to heatsink)
Thermal resistances against airflow: R_ja = R_js + R_sa
R_js = (T_die − T_heatsink) / P, R_sa = (T_heatsink − T_ambient) / P, with P the module power. The 0 m/s points are the end of the 30-minute fan-off soak; the others use the last 60 s of each fan level. Below 1.54 m/s the module is throttling and holding its 104 °C limit, so these points are set by the throttling, not by the fan.
Show the data
Duty %m/sDie °CHeatsink °CAmbient °CWR_jaR_jsR_sa
0.00.0107.099.324.44.5218.271.716.57
9.50.14107.199.324.74.6117.931.6916.24
11.10.26107.199.424.74.618.01.6916.3
12.70.38107.199.324.94.5818.031.6916.34
14.30.55107.399.525.04.5718.081.716.38
15.90.7107.399.424.94.6517.791.6916.1
17.50.86107.099.324.94.6217.841.6716.17
19.01.0107.199.125.04.8316.981.6515.34
20.61.1105.497.625.14.7716.841.6415.2
22.21.19103.795.725.04.716.741.6915.05
23.81.28101.093.524.94.6216.471.6314.85
25.41.37103.595.325.04.9216.011.6714.34
27.01.46103.795.125.05.2515.021.6513.37
28.61.54102.794.025.05.2514.791.6513.13
30.21.61100.892.425.05.214.591.6212.97
31.71.6898.189.825.05.1114.311.6312.68
33.31.7594.786.525.05.0113.921.6312.29
34.91.8192.684.424.94.9513.661.6512.02
36.51.8890.682.524.94.8913.421.6511.77
38.11.9588.780.824.94.8513.151.6311.53
39.72.0287.179.224.94.8212.921.6311.29
41.32.0985.978.224.74.7912.791.6111.17
42.92.1684.476.824.64.7612.561.6110.96
44.42.2383.475.624.54.7312.441.6510.79
46.02.381.773.924.44.712.191.6510.53
47.62.3780.572.824.34.6812.021.6610.36
49.22.4379.271.524.34.6511.811.6610.15
50.82.4977.769.924.24.6211.571.699.88
52.42.5675.968.224.14.5911.281.679.6
54.02.6274.566.724.14.5711.021.699.33
55.62.6873.065.424.04.5510.761.679.09
57.12.7371.463.924.04.5310.471.668.81
58.72.7970.462.524.04.5110.291.758.54
60.32.8569.461.624.04.4910.111.748.37
61.92.967.860.023.94.479.821.758.07
63.52.9666.959.223.94.469.651.737.92
65.13.0265.758.023.84.449.431.747.68
66.73.0864.756.923.84.439.221.757.47
68.33.1463.956.123.84.429.071.767.31
69.83.2162.855.123.74.418.881.777.11
71.43.2861.653.823.64.398.641.776.87
73.03.3560.653.023.44.388.491.756.74
74.63.3560.953.223.44.398.541.756.79
76.23.3560.653.023.34.388.511.756.76
77.83.3560.552.823.24.388.521.776.75
79.43.3560.652.923.24.388.541.756.79
81.03.3560.853.123.24.388.581.756.83
82.53.3560.753.023.24.388.561.756.8
84.13.3560.853.123.14.388.591.756.84
85.73.3560.552.823.14.388.551.766.79
87.33.3460.853.123.14.398.591.756.84
88.93.3660.753.023.14.388.571.766.81
90.53.3460.753.023.14.388.581.766.83
92.13.3560.652.923.14.388.561.756.8
93.73.3560.753.023.14.388.591.756.83
95.23.3560.452.723.14.388.521.756.77
96.83.3560.752.923.14.388.581.766.82
98.43.3560.352.523.14.388.51.776.73
100.03.3460.552.823.04.388.551.766.79

R_js stays at about 1.7 °C/W across the entire run, whatever the airflow: it is fixed by the module, its package and its thermal interface. All of the improvement comes from R_sa. Above about 1.5 m/s, where the module runs at its full frame rate, R_sa falls steadily from about 13 °C/W to 6.8 °C/W with the fan at full speed, taking R_ja down to 8.5 °C/W. This confirms the thermal network shown above: the fan only acts on the heatsink-to-air resistance.

Below about 1.5 m/s, however, the flat part of the R_sa curve (about 16.5 °C/W) does not describe the fan. In that range, the Hailo-8 sits on its 104 °C thermal limit and reduces its power to stay there, so the heatsink temperature is set by the throttling, not by the airflow. Measured at idle power with the fan off, the heatsink’s true natural-convection resistance is about 21.8 °C/W.

This has an important consequence for our thermal control loop. With R_js constant, the RA6M5 can estimate the die temperature from the heatsink temperature and the module power alone:

T_die ≈ T_heatsink + 1.7 °C/W × P

Once the module has warmed up, this estimate matches the on-die sensor to within 0.4 °C for 95% of the samples, and never misses by more than 0.9 °C. It only lags during the first minutes of heat-up, when the die heats faster than the heatsink (up to 3.6 °C of error).

Note that in this session, the Hailo-8 returned to its full frame rate at 28.6% duty (1.54 m/s), slightly later than in the earlier session (27.0% duty, 1.47 m/s). This gives an idea of the run-to-run variation of the threshold.

Who’s In Control?

Before going further, we need to clarify who has been in control of the telemetry for our exploration.

Host PC in control

In our previous exploration, the RA6M5 acted as a USB bridge between the host PC and the sensors.

This had the advantage of being able to combine these metrics with the AI accelerator telemetry (via its SDK) and the application:

  • Host telemetry:
    • knowledge of application/model
    • frame rate
  • Accelerator telemetry (via vendor’s SDK):
    • on-die temperature
    • operating frequency
  • RA6M5 telemetry:
    • fan control
    • air flow
    • heatsink temperature
    • power consumption

In order to implement a thermal control solution, we need a tighter loop. This is the main reason we chose the Renesas RA6M5 microcontroller.

RA6M5 in control

The RA6M5 provides more determinism and faster access to the telemetry we have set up for the project.

The disadvantage is that we no longer have access to the following insightful information:

  • which model is running ?
  • which frame rate is being achieved ?
  • what is the on-die temperature reported by the accelerator ?
  • what is its operating frequency ? is it throttling ?

Implementing a Thermal Control Loop

A conventional fan controller is purely reactive: it measures a temperature, compares it with a target, and adjusts the fan. With minutes of thermal inertia in the heatsink, it only reacts once the heat has already arrived.

Our measurements give us something better: a model of the thermal path. We know the module’s power (INA228), the ambient temperature (EMC2101), the heatsink temperature (thermocouple), the die-to-heatsink resistance (R_js ≈ 1.7 °C/W), and how the heatsink-to-air resistance falls as the fan speeds up. The control loop uses this model to act before the heat arrives, and the measurements to correct whatever the model gets wrong.

The loop runs entirely on the RA6M5, so it keeps cooling the module even if the host application exits or crashes. It regulates a single quantity: the estimated die temperature.

Characterizing the Thermal Resistance of our Heatsink and Fan

Every part of the control loop described below relies on one curve: the heatsink-to-air thermal resistance (R_conv) as a function of the fan duty. At steady state, the heatsink settles above the ambient air by the module’s power times this resistance:

T_heatsink = T_ambient + W × R_conv(duty)

The fan ladder of the thermocouple run described above measured R_conv at each of its 59 fan settings, including fan-off. Here are these measurements, against the curve that the RA6M5 ended up carrying:

Measured, module at full rateMeasured while throttling (not the fan)Firmware curve (nine nodes)
Heatsink-to-air thermal resistance against fan duty
Measured points: the 59 levels of the fan ladder (last 60 s of each 5-minute level). Below 30.2 % duty the module was throttling, so the heatsink temperature, and therefore these points, were set by the throttle limit rather than the fan. The firmware's lowest nodes come from fan-off and floor-duty measurements at idle power instead.
Show the data
Duty %R_conv °C/Wτ (s)Source
0.021.75226.0natural convection, from four fan-off brackets at 0.86 W
9.521.28221.0two settled 9.5 % blocks, 0.86 W; at its floor the fan turns 262 rpm
20.615.82165.0the one unthrottled low-duty tread that exists (n=1)
30.212.97135.0the ladder's unthrottled region, lag-corrected by the joint fit
39.711.3118.0the ladder's unthrottled region, lag-corrected by the joint fit
50.89.77102.0the ladder's unthrottled region, lag-corrected by the joint fit
60.38.3186.0the ladder's unthrottled region, lag-corrected by the joint fit
69.87.0774.0the ladder's unthrottled region, lag-corrected by the joint fit
73.06.7370.0the ladder's unthrottled region, lag-corrected by the joint fit

Above 30% duty, the measurements and the curve agree. Below that, the measured points are not the fan’s: the module was throttling, and its temperature was set by its thermal limit. The curve’s three lowest nodes therefore come from fan-off and floor-duty measurements at idle power instead.

Is Our Thermal Resistance the Same at Every Load ?

The fan ladder measured R_conv at a single load: ResNet-50, at about 4.4 W. To check that the heatsink responds the same way at other loads, I ran eight different models on the Hailo-8, five minutes each, with the fan held at 73% duty:

ModelGOP/frameFPSPower (W)TOPSDie (°C)R_conv (°C/W)
YOLOv8s28.64927.7114.185.26.25
SCRFD-10G26.74415.0611.864.76.52
ResNet-508.213724.3811.260.36.76
SCRFD-2.5G6.910594.097.356.86.59
ArcFace MobileFaceNet0.951953.914.655.36.63
YOLOv8m78.9673.225.348.76.47
SCRFD-500M1.513023.101.948.46.67
OSNet x1.02.02151.120.430.97.13
YOLOv8s (7.7 W)SCRFD-10G (5.1 W)ResNet-50 (4.4 W)SCRFD-2.5G (4.1 W)ArcFace MobileFaceNet (3.9 W)YOLOv8m (3.2 W)SCRFD-500M (3.1 W)OSNet x1.0 (1.1 W)
Heatsink temperature rise for eight models, fan held at 73 % duty
One 5-minute run per model, back to back, each starting from where the previous one left off; the curves are shifted to share a clock. Same shape and time constant for every model; the height each settles at is proportional to its power.
Show the data
ModelGOP/frameFPSModule WTOPSDie °CR_conv °C/W
YOLOv8s28.6491.67.71214.0685.26.253
SCRFD-10G26.68441.45.05811.7864.76.524
ResNet-508.1741372.34.38311.2260.36.758
SCRFD-2.5G6.861059.24.0947.2756.86.587
ArcFace MobileFaceNet0.885195.23.9074.5755.36.634
YOLOv8m78.9467.23.2185.3148.76.468
SCRFD-500M1.471302.23.11.9148.46.668
OSNet x1.01.96214.61.1160.4230.97.127

Every model produces the same exponential curve, with the same time constant, and the height at which it settles is simply proportional to its power: from 1.1 W (OSNet) to 7.7 W (YOLOv8s), R_conv stays between 6.25 °C/W and 7.13 °C/W. The heatsink does not care which model is running, only how much power it dissipates.

I also tried to vary the load with ResNet-50 alone, by capping its frame rate. This did not work: the module’s power barely changes with the frame rate, so the cap only wastes energy per frame.

Frame rate capnone (1372 FPS)1000 FPS700 FPS500 FPS300 FPS
Power (W)4.374.374.364.364.16
Energy per frame (mJ)3.24.46.28.713.9

The fitting session therefore combined four fixed fan duties (73%, 50.8%, 33.3% and 20.6%) with different models and frame-rate caps: 24 runs of 6 minutes each. At each fan duty, the runs agreed on R_conv to within 1.1% (standard deviation). This session also revealed a trap: at 20.6% duty, three of the four ResNet-50 runs sat on the Hailo-8’s 104 °C thermal limit, throttling 63% to 67% of the time, while still reporting exactly the frame rate they had been capped at. With a frame-rate cap in place, the frame rate no longer reveals throttling.

The Resulting Curve

From these measurements, the RA6M5 carries R_conv as a nine-node table:

R_conv, nine-node table carried by the RA6M5
Heatsink-to-air thermal resistance against fan duty, as used by the feed-forward
The RA6M5 inverts this curve to find the fan duty that provides a required R_conv. Above 73 % duty the fan adds no airflow, so the curve stops there. Full scale.
Show the data
Duty %R_conv °C/W
0.021.75
9.521.28
20.615.82
30.212.97
39.711.3
50.89.77
60.38.31
69.87.07
73.06.73

Reacting to Power

The first part of the loop is a feed-forward term, driven by power. Rearranging the thermal network, the heatsink-to-air resistance (R_conv) required to hold the die at a target temperature T_die* is:

R_conv_required = (T_die* − R_int × W − T_ambient) / W

where W is the module power, and R_int = 1.709 °C/W is the die-to-heatsink resistance (the R_js measured in the thermocouple analysis above). The RA6M5 inverts the nine-node R_conv curve characterized above, to find the fan duty that provides R_conv_required.

As soon as the power changes, for example when the AI workload starts, the fan responds within one step, minutes before the heatsink warms up.

The RA6M5 has one blind spot: it cannot see the module’s clock or frame rate, which are only available to the host. It therefore cannot detect throttling, and must hold a die temperature that is known to be below the throttle point. For the Hailo-8, the default target is 95 °C, comfortably below the 99 °C at which its throttling releases. This also avoids a trap: when the Hailo-8 throttles, its power drops, and a power-driven feed-forward would then slow the fan down and keep the module hot.

Used on its own, the feed-forward is an open loop: it never measures the temperature it is trying to control. Here it is as pseudo-code:

// feed-forward only (open loop), every 250 ms
W      = ina228_power();                          // module power (W)
T_amb  = emc2101_temp();                          // air near the module (°C)
R_req  = (T_SET - R_INT * W - T_amb) / W;         // heatsink-to-air resistance needed
duty   = invert_rconv(R_req);                     // nine-node R_conv table, inverted
emc2101_set_duty(duty);

I ran this open loop with the controller ignoring the thermocouple, targeting a die temperature of 90 °C during a 30-minute ResNet-50 run. The thermocouple and the Hailo-8’s own on-die sensor were still logged, to see how well it did:

Module power (W) · INA228 on the 3.3 V rail
Module power (INA228)
Fan duty (%) · commanded by the RA6M5, and its feed-forward part
Fan duty (commanded)Feed-forward part
Temperatures (°C) · die (on-die sensor), die estimate, heatsink, setpoint
Die (on-die sensor)Die estimate (RA6M5)Heatsink (thermocouple, logged)Setpoint
Feed-forward only (no thermocouple, no PI), die-estimate setpoint 90 °C: one 30-minute ResNet-50 run and the idle half hour after it. The thermocouple is logged but not used. Full scale. Plotted every 5 s; hover any panel to read every value at that moment.

The die came within 1 °C of the target after 7.7 minutes, and held at 89.8 °C, with the fan at about 36.5% duty. The Hailo-8 never throttled, and ran at its full 1372 FPS. Note that in open loop, the RA6M5’s own die estimate equals the target by construction: the board has no independent measurement of the die. Only the Hailo-8’s on-die sensor, read by the host, shows how close the open loop really came.

Reacting to Power and Temperature

The feed-forward term is only as good as the model behind it. Ambient conditions drift, dust accumulates, and a different module or mounting changes the thermal resistances. The second part of the loop is therefore a feedback term, driven by temperature.

The RA6M5 estimates the die temperature from the thermocouple and the module power, as described earlier:

T_die_estimate = T_heatsink + R_int × W

A PI controller (proportional gain 1.0, integral gain 0.01) acts on the error between this estimate and the target, and adds its output to the feed-forward duty. Since the feed-forward does most of the work, the PI term is only allowed to trim it by at most 15 points of duty.

Without this limit, the integrator would accumulate the error of every approach, when the die simply has not caught up with the fan yet, and push the fan far beyond what is needed: no amount of airflow can remove the heatsink’s own time constant.

Here is the feed-forward with the feedback added, as pseudo-code:

// feed-forward + PI feedback on the thermocouple, every 250 ms
W      = ina228_power();                          // module power (W)
T_amb  = emc2101_temp();                          // air near the module (°C)
T_hs   = max31855_temp();                         // heatsink, thermocouple (°C)
T_est  = T_hs + R_INT * W;                        // estimated die temperature

u_ff   = invert_rconv((T_SET - R_INT * W - T_amb) / W);   // feed-forward, as above
e      = T_est - T_SET;                           // positive when too hot
u_pi   = clamp(KP * e + KI * integral(e), -15, +15);      // trims by 15 points at most
duty   = clamp(u_ff + u_pi, 9.5, 73);                     // fan turns from 9.5%, airflow saturates at 73%
emc2101_set_duty(duty);

I then ran this closed loop with the thermocouple, with the same 90 °C target and the same 30-minute ResNet-50 run:

Module power (W) · INA228 on the 3.3 V rail
Module power (INA228)
Fan duty (%) · commanded by the RA6M5, and its feed-forward part
Fan duty (commanded)Feed-forward part
Temperatures (°C) · die (on-die sensor), die estimate, heatsink, setpoint
Die (on-die sensor)Die estimate (RA6M5)Heatsink (thermocouple)Setpoint
Feed-forward plus PI feedback on the thermocouple, die-estimate setpoint 90 °C: one 30-minute ResNet-50 run and the idle half hour after it. Full scale. Plotted every 5 s; hover any panel to read every value at that moment.

The die came within 1 °C of the target after 6.4 minutes, and held at 89.5 °C. The die estimate stayed within 0.6 °C of the Hailo-8’s on-die sensor, reading slightly high, which is why the die settled about half a degree below the target. The Hailo-8 ran at its full 1372 FPS, without throttling. In steady state, the fan ran at 36.3% duty, of which the feed-forward provided 35.8%: the feedback only had to trim it by about half a point.

Doing Without the Thermocouple

Manually bonding a thermocouple to a heatsink is not realistic in production. It can be done once in order to characterize our final product, but would probably not hold in the long term in the real world.

For this reason, we want a “soft sensor” to stand in for the thermocouple, built from our observations and characterization.

The soft sensor is not a measurement. It is a model of the heatsink that predicts its temperature from the power, the ambient temperature and the fan duty alone, using the same R_conv curve as the feed-forward. What it adds to that curve is time: a single state, the heatsink temperature, and a single fitted parameter, the heatsink’s heat capacity C, which together give the heatsink’s lag:

T_heatsink_steady = T_ambient + W × R_conv(duty)

τ = R_conv(duty) × C

dT_heatsink/dt = (T_heatsink_steady − T_heatsink) / τ

C was fitted at 10.4 J/°C. The resulting time constant ranges from about 70 seconds with the fan at full speed, to almost 4 minutes with the fan off. On the RA6M5, the whole model is a handful of floating-point operations:

// soft sensor, every 250 ms (dt = 0.25 s)
r_conv  = rconv_table(duty);                      // nine-node table (°C/W)
tc_ss   = T_amb + W * r_conv;                     // where the heatsink is heading (°C)
tau     = r_conv * C;                             // time constant (s), C = 10.4 J/°C
tc_est += (tc_ss - tc_est) * dt / tau;            // first-order lag: the model's one state
T_hs    = tc_ok ? max31855_temp() : tc_est;       // measured if available, else modelled
T_est   = T_hs + R_INT * W;                       // estimated die temperature

Because the soft sensor sees the same inputs as the feed-forward, and uses the same R_conv curve, it cannot tell the PI anything the feed-forward does not already assume. Once the heatsink settles, the model lands exactly where the feed-forward aimed, the error goes to zero, and the PI trim with it. The only thing the PI sees is the lag: while the modelled heatsink is still warming up, the die estimate reads below the target, and the PI trims the fan down. In other words, the soft sensor turns the feed-forward into a feed-forward with a time lag. It is not feedback: if dust or a different mounting changed the real R_conv, the model would not see it.

To test it, I ran the loop on the soft sensor during a 30-minute ResNet-50 run at a 90 °C target, with the thermocouple still connected, but only logged:

Module power (W) · INA228 on the 3.3 V rail
Module power (INA228)
Fan duty (%) · decided by the loop, from the soft sensor
Fan duty (commanded)Feed-forward part
Temperatures (°C) · the soft sensor drives the loop; the thermocouple is only logged
Heatsink, thermocouple (measured)Heatsink, soft sensorDie, on-die sensor
One 30-minute ResNet-50 run at a 90 °C die-estimate setpoint, with the loop running on the soft sensor, followed by the 30-minute idle cool-down with the fan off (the soft sensor is only plotted while it drives the loop). Over the loaded run, the soft sensor is within 0.91 °C rms of the thermocouple (between -2.5 and +0.6 °C), and within 0.29 °C rms over its last 10 minutes. Full scale.

Given only the power, the board air and the fan duty, the soft sensor tracked the thermocouple to within 0.91 °C (rms) over the whole run, and within 0.29 °C (rms) over its last 10 minutes. Its largest error is during the warm-up: the model lags behind the heating heatsink, and reads up to 2.5 °C cold at first.

If the thermocouple fails, the loop falls back on this model, and if neither is available, on the feed-forward alone. Since the model can read up to 2.5 °C cold, a target of 90 °C rather than 95 °C is used when regulating on the model. The one sensor the loop cannot do without is the INA228: without power, there is nothing to estimate the die temperature from, so the fan goes to 100%.

Implementing our Thermal Control Loop

Here is the complete loop, simplified, as it runs on the RA6M5:

W      = ina228_power();                        // module power (W): mandatory
T_amb  = emc2101_temp();                        // air near the module (°C)
T_hs   = tc_ok ? max31855_temp()                // heatsink: measured,
               : soft_sensor(W, T_amb, duty);   //   or modelled
T_est  = T_hs + R_INT * W;                      // estimated die temperature

u_ff   = invert_rconv((T_SET - R_INT * W - T_amb) / W);   // feed-forward
e      = T_est - T_SET;                         // positive when too hot
u_pi   = clamp(pi_update(e), -15.0, +15.0);     // trims the feed-forward by 15 points at most
duty   = clamp(u_ff + u_pi, 9.5, 73.0);                 // fan turns from 9.5%, airflow saturates at 73%
emc2101_set_duty(duty);                         // written only when the 64-level setting changes

A closed-loop session compared three ways of running the same loop, regulating the estimated die temperature at 90 °C during three 30-minute ResNet-50 runs, each followed by 30 minutes idle: with the thermocouple, then without any heatsink temperature (feed-forward only), and then with the soft sensor in place of the thermocouple.

Module power (W) · INA228 on the 3.3 V rail
Module power (INA228)
Fan duty (%) · commanded by the RA6M5, and its feed-forward part
Fan duty (commanded)Feed-forward part
Temperatures (°C) · die (on-die sensor), die estimate, heatsink, setpoint
Die (on-die sensor)Die estimate (RA6M5)Heatsink (thermocouple, logged)Setpoint
Three 30-minute ResNet-50 steps at a 90 °C die-estimate setpoint, each followed by 30 minutes idle with the fan off. The thermocouple keeps logging in all three, but the controller only uses it in the first; the third runs on the soft sensor, a model of the heatsink with a time lag. Full scale. Plotted every 10 s; hover any panel to read every value at that moment.

With the thermocouple, the die came within 1 °C of the target after 6.4 minutes, and held at 89.5 °C. With the feed-forward alone, it took 7.7 minutes, and held at 89.8 °C. With the soft sensor, it took only 4.3 minutes, and held at 89.9 °C. In all three runs, the Hailo-8 ran at its full 1372 FPS, without throttling.

In steady state, running on the soft sensor costs nothing measurable: the fan settled at the same 36.3% duty as with the thermocouple, as expected from a model that converges on the feed-forward’s own answer. The difference is in the approach, where the model’s time lag shows. While the heatsink warms up, the modelled heatsink lags behind the real one, reading up to 2.5 °C cold, so the loop under-cools: the fan ran at about 26% duty during the first 3 minutes, against 30% with the thermocouple. The die therefore reached the target sooner, and overshot it by 0.8 °C instead of 0.2 °C.

This is the main result of this exploration: once the thermal path has been characterized, the power measurement does most of the work. The feed-forward from power alone holds the die within 0.2 °C of its target, and the temperature feedback only needs to correct small modelling errors.

How Small It Could Go

The RA6M5 is far more than this job needs. The control loop runs every 250 ms and does a handful of I2C reads, one SPI read, a lookup in a 9-entry table, a first-order filter and a PI update. That would fit easily on an entry-level part such as the Renesas RA2E1: a 48 MHz Cortex-M23 with as little as 32 KB of flash and 16 KB of SRAM, available in packages down to 25 pins (WLCSP). The RA2E1 has no FPU, but at 4 Hz, software floating point (or a simple fixed-point port) is more than fast enough.

Conclusion

In this article, we have explored how much airflow is needed to keep two M.2 AI accelerator modules out of thermal throttling, and how to close the thermal loop with the Renesas RA6M5.

With our Noctua fan, the Hailo-8 needed about 1.5 m/s of airflow, and the DX-M1 about 1.2 m/s. In both cases, this was less than a third of the fan’s range.

We then implemented a thermal control loop on the RA6M5, in three stages:

  • reacting to power (feed-forward only)
  • reacting to power and temperature (feed-forward, plus feedback on the thermocouple)
  • doing without the thermocouple (feed-forward, plus a soft sensor: a model of the heatsink with a time lag)

My main take-away is that having access to power measurements gets us 95% of the way to a reliable thermal control loop: in steady state, the feed-forward from power alone supplied about 99% of the fan duty, and held the die within 0.2 °C of its target.

With the feed-forward alone, the die came within 1 °C of its target in 7.7 minutes, and the Hailo-8 never throttled. Adding the thermocouple only got it there about a minute sooner (6.4 minutes), and the feedback only had to trim the fan duty by about half a point.

Replacing the thermocouple with the soft sensor made no measurable difference in steady state, which is an interesting option when placing a thermocouple is not feasible on multiple products. The soft sensor is a model, not a measurement: it adds the heatsink’s time lag to the feed-forward, but no new information.

The thermocouple only provides marginal improvements. Its real value is as a safety net: it corrects the feed-forward when the conditions drift away from the ones it was characterized in. The soft sensor cannot do that, since it drifts along with the model it shares with the feed-forward.

If I were to consider implementing this solution in a product, I would characterize over a much longer period of time, and at different ambient temperatures using a heat chamber.

Measure the power, characterize your heatsink and fan,
and you have a reliable thermal control loop.

The temperature measurement acts as an additional safety net.

Version History

DateDescription
2026/12/03Initial Draft