Battery-less devices harvest energy from the environment using small capacitors as energy buffers. The scarsity of harvested energy causes the battery-less devices to endure frequent energy failures, since the device consumes more energy than what it can harvest. Thus, its computation is intermittent, alternating active computing periods, where the program execution progresses, with inactive recharging periods of unknown length. Due to memory and computation constraints of battery-less devices, they execute code directly on bare hardware since we cannot install an OS on them. Thus, unlike mainstream devices equipped with an OS that handles energy failures, they lose the content of main memory whenever an energy failures arise. To avoid this, we must save the program's state on Non-Volatile Memory (NVM), since the latter persists its content across energy failures. At reboot, we restore the last successfully stored program's state continuing the computation from that point instead of the beginning. Unfortunately, operations on NVM are very expensive in terms of energy consumption. In this scenario, where devices have low energy availability but high energy demand, maximizing energy efficiency becomes crucial. Each instruction in a program has its own optimal execution frequency at which it should be executed to achieve the best energy efficiency. NVMs generally operate at lower frequency than Micro Controller Units (MCUs). When an MCU accesses the NVM at a frequency higher than the maximum supported by the NVM, it needs to wait the NVM to complete the operation, so wait cycles are added to the execution. Limiting the MCU frequency to the highest operating frequency of the NVM allows us to avoid additional wait cycles. On the other hand, higher MCU frequencies are more efficient for computation not involving NVM. By configuring statically the MCU frequency, it is difficult to optimize the execution of all instructions. To overcome this limitation, we can place frequency scaling function calls into the code of the program, adjusting the MCU frequency based on the instructions to be executed and their optimal frequency. Even if this method saves energy by increasing the number of instructions executed at their optimal frequency, frequency scaling operations introduce an overhead. For this reason, executing all the instructions in the code at their optimal frequency is not always the most efficient solution, since the energy cost of frequency switching may outweigh the energy savings. In this work we aim to find the most efficient positioning of frequency scaling operations in the execution code to maximize energy efficiency. We implement three optimization techniques: switching, reordering and merging. After analyzing the program instructions, they consider all the possible frequency scaling configurations, following three different procedures, and select the most efficient one. We apply these techniques at compile-time, as opposite to runtime, limiting the overhead, and we can combine them in specific ways. In our experimental evaluation we demonstrate that we can improve the energy performance of the system up to 11%, with negligible costs.

I dispositivi senza batteria raccolgono energia dall'ambiente e utilizzano piccoli condensatori per salvarla. La scarsità di energia raccolta dai dispositivi senza batteria causa frequenti interruzioni energetiche, poiché il dispositivo consuma più energia di quanta ne riesca a raccogliere. Pertanto, la loro computazione è intermittente, alternando periodi attivi, durante i quali l'esecuzione del programma avanza, con periodi inattivi di ricarica che hanno durata imprevedibile. A causa dei limiti di memoria e computazionali dei dispositivi senza batteria, essi eseguono il codice direttamente sull'hardware poiché non possiamo installarvi un sistema operativo. Di conseguenza, a differenza dei dispositivi convenzionali dotati di un sistema operativo che gestisce le interruzioni energetiche, essi perdono il contenuto della memoria principale ogni volta che si verifica un'interruzione energetica. Per evitare ciò, dobbiamo salvare lo stato del programma sulla memoria non volatile (NVM), poiché quest'ultima mantiene il suo contenuto anche quando avvengono le interruzioni energetiche. Al riavvio, ripristiniamo l'ultimo stato del programma che abbiamo salvato con successo, continuando la computazione da quel punto anziché dall'inizio. Sfortunatamente, le operazioni che accedono alla NVM sono molto costose in termini di consumo energetico. In questo scenario, in cui i dispositivi hanno una ridotta disponibilità ma un’alta richiesta di energia, massimizzare l'efficienza energetica diventa fondamentale. Ogni istruzione in un programma ha la propria frequenza di esecuzione ottimale alla quale dovrebbe essere eseguita per ottenere la massima efficienza energetica. Le NVM generalmente operano a una frequenza inferiore rispetto ai microcontrollori (MCU). Quando una MCU accede ad una NVM a una frequenza superiore a quella massima supportata dalla NVM, deve aspettare che la NVM completi l'operazione, aggiungendo così cicli di attesa all'esecuzione. Limitare la frequenza della MCU alla massima frequenza operativa della NVM quando vi si accede, ci consente di evitare cicli di attesa aggiuntivi. D'altra parte, frequenze della MCU più elevate sono più efficienti per calcoli che non coinvolgono la NVM. Configurando staticamente la frequenza della MCU, è difficile ottimizzare l'esecuzione di tutte le istruzioni. Per superare questo limite, possiamo inserire nel codice del programma delle chiamate a funzioni che scalano la frequenza della MCU, regolandola in base alle istruzioni da eseguire e alla loro frequenza ottimale. Anche se questo metodo consente di risparmiare energia aumentando il numero di istruzioni eseguite alla loro frequenza ottimale, le operazioni che scalano la frequenza introducono un costo aggiuntivo. Per questo motivo, eseguire tutte le istruzioni nel codice alla loro frequenza ottimale non è sempre la soluzione più efficiente, poiché il costo energetico del cambio di frequenza potrebbe superare i risparmi energetici. In questo lavoro il nostro obiettivo è trovare la posizione più efficiente delle operazioni che scalano la frequenza nel codice di esecuzione per massimizzare l'efficienza energetica. Abbiamo implementato tre tecniche di ottimizzazione: switching, reordering e merging. Dopo aver analizzato le istruzioni del programma, queste tecniche considerano tutte i possibili posizionamenti delle funzioni che scalano la frequenza, seguendo tre diverse procedure, e selezionano la più efficiente. Applichiamo queste tecniche in fase di compilazione, non durante l'esecuzione per limitare il costo aggiuntivo, e possiamo combinarle in modi specifici. Nella nostra valutazione sperimentale dimostriamo di poter migliorare le prestazioni energetiche del sistema fino al 11%, con costi trascurabili.

Energy efficiency in intermittent computing systems through static frequency scaling techniques

ROVELLI, VERONICA
2023/2024

Abstract

Battery-less devices harvest energy from the environment using small capacitors as energy buffers. The scarsity of harvested energy causes the battery-less devices to endure frequent energy failures, since the device consumes more energy than what it can harvest. Thus, its computation is intermittent, alternating active computing periods, where the program execution progresses, with inactive recharging periods of unknown length. Due to memory and computation constraints of battery-less devices, they execute code directly on bare hardware since we cannot install an OS on them. Thus, unlike mainstream devices equipped with an OS that handles energy failures, they lose the content of main memory whenever an energy failures arise. To avoid this, we must save the program's state on Non-Volatile Memory (NVM), since the latter persists its content across energy failures. At reboot, we restore the last successfully stored program's state continuing the computation from that point instead of the beginning. Unfortunately, operations on NVM are very expensive in terms of energy consumption. In this scenario, where devices have low energy availability but high energy demand, maximizing energy efficiency becomes crucial. Each instruction in a program has its own optimal execution frequency at which it should be executed to achieve the best energy efficiency. NVMs generally operate at lower frequency than Micro Controller Units (MCUs). When an MCU accesses the NVM at a frequency higher than the maximum supported by the NVM, it needs to wait the NVM to complete the operation, so wait cycles are added to the execution. Limiting the MCU frequency to the highest operating frequency of the NVM allows us to avoid additional wait cycles. On the other hand, higher MCU frequencies are more efficient for computation not involving NVM. By configuring statically the MCU frequency, it is difficult to optimize the execution of all instructions. To overcome this limitation, we can place frequency scaling function calls into the code of the program, adjusting the MCU frequency based on the instructions to be executed and their optimal frequency. Even if this method saves energy by increasing the number of instructions executed at their optimal frequency, frequency scaling operations introduce an overhead. For this reason, executing all the instructions in the code at their optimal frequency is not always the most efficient solution, since the energy cost of frequency switching may outweigh the energy savings. In this work we aim to find the most efficient positioning of frequency scaling operations in the execution code to maximize energy efficiency. We implement three optimization techniques: switching, reordering and merging. After analyzing the program instructions, they consider all the possible frequency scaling configurations, following three different procedures, and select the most efficient one. We apply these techniques at compile-time, as opposite to runtime, limiting the overhead, and we can combine them in specific ways. In our experimental evaluation we demonstrate that we can improve the energy performance of the system up to 11%, with negligible costs.
MAIOLI, ANDREA
ING - Scuola di Ingegneria Industriale e dell'Informazione
16-lug-2024
2023/2024
I dispositivi senza batteria raccolgono energia dall'ambiente e utilizzano piccoli condensatori per salvarla. La scarsità di energia raccolta dai dispositivi senza batteria causa frequenti interruzioni energetiche, poiché il dispositivo consuma più energia di quanta ne riesca a raccogliere. Pertanto, la loro computazione è intermittente, alternando periodi attivi, durante i quali l'esecuzione del programma avanza, con periodi inattivi di ricarica che hanno durata imprevedibile. A causa dei limiti di memoria e computazionali dei dispositivi senza batteria, essi eseguono il codice direttamente sull'hardware poiché non possiamo installarvi un sistema operativo. Di conseguenza, a differenza dei dispositivi convenzionali dotati di un sistema operativo che gestisce le interruzioni energetiche, essi perdono il contenuto della memoria principale ogni volta che si verifica un'interruzione energetica. Per evitare ciò, dobbiamo salvare lo stato del programma sulla memoria non volatile (NVM), poiché quest'ultima mantiene il suo contenuto anche quando avvengono le interruzioni energetiche. Al riavvio, ripristiniamo l'ultimo stato del programma che abbiamo salvato con successo, continuando la computazione da quel punto anziché dall'inizio. Sfortunatamente, le operazioni che accedono alla NVM sono molto costose in termini di consumo energetico. In questo scenario, in cui i dispositivi hanno una ridotta disponibilità ma un’alta richiesta di energia, massimizzare l'efficienza energetica diventa fondamentale. Ogni istruzione in un programma ha la propria frequenza di esecuzione ottimale alla quale dovrebbe essere eseguita per ottenere la massima efficienza energetica. Le NVM generalmente operano a una frequenza inferiore rispetto ai microcontrollori (MCU). Quando una MCU accede ad una NVM a una frequenza superiore a quella massima supportata dalla NVM, deve aspettare che la NVM completi l'operazione, aggiungendo così cicli di attesa all'esecuzione. Limitare la frequenza della MCU alla massima frequenza operativa della NVM quando vi si accede, ci consente di evitare cicli di attesa aggiuntivi. D'altra parte, frequenze della MCU più elevate sono più efficienti per calcoli che non coinvolgono la NVM. Configurando staticamente la frequenza della MCU, è difficile ottimizzare l'esecuzione di tutte le istruzioni. Per superare questo limite, possiamo inserire nel codice del programma delle chiamate a funzioni che scalano la frequenza della MCU, regolandola in base alle istruzioni da eseguire e alla loro frequenza ottimale. Anche se questo metodo consente di risparmiare energia aumentando il numero di istruzioni eseguite alla loro frequenza ottimale, le operazioni che scalano la frequenza introducono un costo aggiuntivo. Per questo motivo, eseguire tutte le istruzioni nel codice alla loro frequenza ottimale non è sempre la soluzione più efficiente, poiché il costo energetico del cambio di frequenza potrebbe superare i risparmi energetici. In questo lavoro il nostro obiettivo è trovare la posizione più efficiente delle operazioni che scalano la frequenza nel codice di esecuzione per massimizzare l'efficienza energetica. Abbiamo implementato tre tecniche di ottimizzazione: switching, reordering e merging. Dopo aver analizzato le istruzioni del programma, queste tecniche considerano tutte i possibili posizionamenti delle funzioni che scalano la frequenza, seguendo tre diverse procedure, e selezionano la più efficiente. Applichiamo queste tecniche in fase di compilazione, non durante l'esecuzione per limitare il costo aggiuntivo, e possiamo combinarle in modi specifici. Nella nostra valutazione sperimentale dimostriamo di poter migliorare le prestazioni energetiche del sistema fino al 11%, con costi trascurabili.
File allegati
File Dimensione Formato  
2024_07_Rovelli_Executive Summary.pdf

accessibile in internet per tutti

Descrizione: Executive Summary
Dimensione 1.46 MB
Formato Adobe PDF
1.46 MB Adobe PDF Visualizza/Apri
2024_07_Rovelli_Tesi.pdf

accessibile in internet per tutti

Descrizione: Tesi
Dimensione 3.76 MB
Formato Adobe PDF
3.76 MB Adobe PDF Visualizza/Apri

I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/10589/223509