... | ... | @@ -4,7 +4,7 @@ This page contains some advanced guidelines for adding new functionality to the |
|
|
|
|
|
In this paragraph some steps that a user has to follow in order to add more embedded platforms in the SDK4ED energy toolbox and more specifically in static energy consumption estimation, are provided.
|
|
|
|
|
|
*Backend*
|
|
|
**Backend**
|
|
|
|
|
|
The main script (main_static_analysis.py) receives as input the source files of an application and performs the energy analysis for all the functions and loop statements. The predictions are based on a set of data collected on a specific platform (as described before).
|
|
|
|
... | ... | @@ -19,7 +19,7 @@ where <fileout> is a random file that contains some temporary data about the sou |
|
|
|
|
|
Script main_static_analysis.py calls the script energy_estimation.py with different <data2> files for each platform and the results for every platform are stored in the same file. A new call to the energy_estimation.py with the same arguments and the new <data2> file will be added below the previous calls. Comments in the source code will help the user to find the specific place.
|
|
|
|
|
|
- Step 1: The user collects the data for the new platform and provide an additional call to the script energy_estimation.py, giving the new data as a 3rd argument (<data2>).
|
|
|
- **Step 1:** The user collects the data for the new platform and provide an additional call to the script energy_estimation.py, giving the new data as a 3rd argument (<data2>).
|
|
|
|
|
|
The user has to follow the following steps in order to compute the execution time and energy consumption of the training-set applications on new platform.
|
|
|
|
... | ... | @@ -33,28 +33,28 @@ where <input_file> contains the code of the training programs (training_set.txt) |
|
|
|
|
|
The script sdk4edselector.py takes as input a set of source files from an application and runs script main_static_analysis.py to all of them. The results of each platform are stored in dictionaries. There is a dictionary for function statements and loops and separate dictionaries per platform.
|
|
|
|
|
|
- Step 2: In order for the user to add an extra platform, two extra dictionaries to store the results are needed to be added. All the dictionaries are stored in a json file that is loaded when a specific event in the main page is triggered. Comments in sdk4edselector.py will guide the user
|
|
|
- **Step 2:** In order for the user to add an extra platform, two extra dictionaries to store the results are needed to be added. All the dictionaries are stored in a json file that is loaded when a specific event in the main page is triggered. Comments in sdk4edselector.py will guide the user
|
|
|
|
|
|
*Front-end*
|
|
|
|
|
|
For adding the new platform on the Front-end, the file EnergyDashPage.js contains the Energy toolbox page. The prediction results are shown in the static analysis panel and are taken from the json file sent by the back-end services. The user can choose a specific platform from a drop-down list to show the prediction results.
|
|
|
|
|
|
- Step 3: There is a method named updateStaticData where given the name of the platform the prediction results for this platform are loaded into the page. If the user wants to show the results for an additional platform, an additional condition is needed to be added in the method that loads these results, including the name of the platform, which must be the same as it is defined in the back-end.
|
|
|
- **Step 3:** There is a method named updateStaticData where given the name of the platform the prediction results for this platform are loaded into the page. If the user wants to show the results for an additional platform, an additional condition is needed to be added in the method that loads these results, including the name of the platform, which must be the same as it is defined in the back-end.
|
|
|
|
|
|
**Guidelines for adding a new device in Acceleration component**
|
|
|
|
|
|
The Acceleration sub-component calculates a number of Acceleration Specific indicators based on which, a classification model is used to estimate the potential Energy Consumption gains of using a specific acceleration unit. For deomnstration purposes Nvidia Jetson TX1, which incorporates a CPU-GPU SoC is already added. The step-by-step guidelines provided below show how to provide predictions for GPU architectures other than Tegra-X1. A prerequisite for being able to achieve this is again that the new device must include an integrated energy sensor:
|
|
|
|
|
|
- Step 1: Download the dataset benchmarks from the git repo in the new device/system that will be added to the Toolbox:
|
|
|
- **Step 1:** Download the dataset benchmarks from the git repo in the new device/system that will be added to the Toolbox:
|
|
|
`git clone `
|
|
|
|
|
|
- Step 2: Compile the dataset in the new device:
|
|
|
- **Step 2:** Compile the dataset in the new device:
|
|
|
`make`
|
|
|
|
|
|
- Step 3: Run the dataset in the new device:
|
|
|
- Step 3a: The developer has to update the script `get-power.py` providing the files (/dev) that monitor the power sensors of the new device. For example, we provide also the `get-power-nano.sh` which is used for the Nvidia Jetson Nano, that also includes a Tegra X1 SoC with less GPU-cores. If needed (if the new device follows a completely different strategy on monitoring power the user can also make any additional changes needed on `measure_time_energy.sh`)
|
|
|
- Step 3b: Generate the dataset
|
|
|
- **Step 3:** Run the dataset in the new device:
|
|
|
- *Step 3a:* The developer has to update the script `get-power.py` providing the files (/dev) that monitor the power sensors of the new device. For example, we provide also the `get-power-nano.sh` which is used for the Nvidia Jetson Nano, that also includes a Tegra X1 SoC with less GPU-cores. If needed (if the new device follows a completely different strategy on monitoring power the user can also make any additional changes needed on `measure_time_energy.sh`)
|
|
|
- *Step 3b:* Generate the dataset
|
|
|
`cd real-life-dataset && python generate_dataset_script.py energy`
|
|
|
Notes: The script `generate_dataset_script.py` runs all the benchmarks automatically. If the user wants to run a specific benchmark the `run_rataset.py` can be used `python run_dataset.py <app_hotspot_name> <energy|time>` The app_hotspot_name is retrieved from the config.txt, while the second argument is energy for measuring energy and time for measuring time.
|
|
|
|
|
|
- Step 4: Step 3 generates a file `final_dataset.csv`. This file has to be added in the toolbox backend and more precisely in the `src/predict_acceleration_class.py` file line 33. This procedure will replace Tegra X1. If the user needs to keep both accelerating devices, two `src/predict_acceleration_class.py` files can be added one for each device replacing the 'Acceleration' word in lines 93 and 95 with 'Acceleration on device name'. Then in `src/sdk4ed_energy.py` in lines 655 and 687 an additional call to the new predict_acceleration_class python file must be added. |
|
|
\ No newline at end of file |
|
|
- **Step 4:** Step 3 generates a file `final_dataset.csv`. This file has to be added in the toolbox backend and more precisely in the `src/predict_acceleration_class.py` file line 33. This procedure will replace Tegra X1. If the user needs to keep both accelerating devices, two `src/predict_acceleration_class.py` files can be added one for each device replacing the 'Acceleration' word in lines 93 and 95 with 'Acceleration on device name'. Then in `src/sdk4ed_energy.py` in lines 655 and 687 an additional call to the new predict_acceleration_class python file must be added. |
|
|
\ No newline at end of file |