diff --git a/ipynb/tests/Frequency_Invariance_Test.ipynb b/ipynb/tests/Frequency_Invariance_Test.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..9e6bab24dd06042bfa41c77d26530ca320966a71 --- /dev/null +++ b/ipynb/tests/Frequency_Invariance_Test.ipynb @@ -0,0 +1,799 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Frequency Invariant Load Tracking Test\n", + "\n", + "FreqInvarianceTest is a LisaTest class for automated testing of frequency invariant load tracking. This notebook uses the methods it provides to perform the same analysis as the automated test and plot some results.\n", + "\n", + "The test class runs the same workload at a selection of frequencies, each entry in `t.experiments` represents a run at a different frequency." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Setup" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "%matplotlib inline" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import json\n", + "\n", + "from tests.eas.load_tracking import FreqInvarianceTest\n", + "from trace import Trace\n", + "from trappy.plotter import plot_trace\n", + "from trappy.stats.grammar import Parser\n", + "from trappy import ILinePlot" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2016-12-13 18:42:57,482 INFO : root : Using LISA logging configuration:\n", + "2016-12-13 18:42:57,483 INFO : root : /home/brejac01/sources/lisa/logging.conf\n" + ] + } + ], + "source": [ + "import logging\n", + "from conf import LisaLogging\n", + "LisaLogging.setup()\n", + "logging.getLogger('Analysis').setLevel(logging.ERROR)\n", + "logging.getLogger('Trace').setLevel(logging.ERROR)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Run test workload\n", + "\n", + "There's currently no way to pass a `TestEnv` or configuration to automated test classes. Instead the target information comes from the `target.config` file (in the root of the LISA source tree), so you'll need to edit that to configure LISA to connect to your target." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Frequency invariance test for util_avg signal\n", + "\n", + " Run workloads providing a known utilization and test that the PELT\n", + " (Per-entity load tracking) util_avg and load_avg signals reflects that\n", + " utilization at various CPU frequencies.\n", + " \n" + ] + } + ], + "source": [ + "t = FreqInvarianceTest()\n", + "print t.__doc__" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To run automated tests from within a notebook we instantiate the test class and call `setUpClass` on it. This is what `nosetests` does internally when running tests from the command line." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2016-12-13 18:42:57,497 INFO : LisaTest : Setup tests execution engine...\n", + "2016-12-13 18:42:57,498 INFO : TestEnv : Using base path: /home/brejac01/sources/lisa\n", + "2016-12-13 18:42:57,499 INFO : TestEnv : Loading default (file) target configuration\n", + "2016-12-13 18:42:57,499 INFO : TestEnv : Loading target configuration [/home/brejac01/sources/lisa/target.config]...\n", + "2016-12-13 18:42:57,501 INFO : TestEnv : Loading custom (inline) test configuration\n", + "2016-12-13 18:42:57,502 INFO : TestEnv : Devlib modules to load: ['bl', u'cpuidle', 'cgroups', 'cpufreq']\n", + "2016-12-13 18:42:57,502 INFO : TestEnv : Connecting linux target:\n", + "2016-12-13 18:42:57,503 INFO : TestEnv : username : brendan\n", + "2016-12-13 18:42:57,503 INFO : TestEnv : host : 192.168.2.2\n", + "2016-12-13 18:42:57,504 INFO : TestEnv : password : password\n", + "2016-12-13 18:42:57,505 INFO : TestEnv : Connection settings:\n", + "2016-12-13 18:42:57,505 INFO : TestEnv : {'username': u'brendan', 'host': u'192.168.2.2', 'password': u'password'}\n", + "2016-12-13 18:43:05,098 INFO : TestEnv : Initializing target workdir:\n", + "2016-12-13 18:43:05,100 INFO : TestEnv : /home/brendan/devlib-target\n", + "2016-12-13 18:43:17,576 INFO : TestEnv : Topology:\n", + "2016-12-13 18:43:17,578 INFO : TestEnv : [[0, 3, 4, 5], [1, 2]]\n", + "2016-12-13 18:43:20,202 INFO : TestEnv : Loading default EM:\n", + "2016-12-13 18:43:20,203 INFO : TestEnv : /home/brejac01/sources/lisa/libs/utils/platforms/juno.json\n", + "2016-12-13 18:43:21,872 WARNING : LinuxTarget : Event [sched_load_avg_task] not available for tracing\n", + "2016-12-13 18:43:21,875 WARNING : LinuxTarget : Event [sched_load_avg_cpu] not available for tracing\n", + "2016-12-13 18:43:21,877 INFO : TestEnv : Enabled tracepoints:\n", + "2016-12-13 18:43:21,878 INFO : TestEnv : sched_switch\n", + "2016-12-13 18:43:21,879 INFO : TestEnv : sched_load_avg_task\n", + "2016-12-13 18:43:21,880 INFO : TestEnv : sched_load_avg_cpu\n", + "2016-12-13 18:43:21,881 INFO : TestEnv : sched_pelt_se\n", + "2016-12-13 18:43:21,883 WARNING : TestEnv : Using configuration provided RTApp calibration\n", + "2016-12-13 18:43:21,884 INFO : TestEnv : Using RT-App calibration values:\n", + "2016-12-13 18:43:21,885 INFO : TestEnv : {\"0\": 354, \"1\": 138, \"2\": 138, \"3\": 363, \"4\": 355, \"5\": 357}\n", + "2016-12-13 18:43:21,887 INFO : EnergyMeter : HWMON module not enabled\n", + "2016-12-13 18:43:21,888 WARNING : EnergyMeter : Energy sampling disabled by configuration\n", + "2016-12-13 18:43:21,889 INFO : TestEnv : Set results folder to:\n", + "2016-12-13 18:43:21,890 INFO : TestEnv : /home/brejac01/sources/lisa/results/20161213_184321\n", + "2016-12-13 18:43:21,891 INFO : TestEnv : Experiment results available also in:\n", + "2016-12-13 18:43:21,893 INFO : TestEnv : /home/brejac01/sources/lisa/results_latest\n", + "2016-12-13 18:43:21,894 INFO : Executor : Loading custom (inline) test configuration\n", + "2016-12-13 18:43:21,895 INFO : Executor : \n", + "2016-12-13 18:43:21,896 INFO : Executor : ################################################################################\n", + "2016-12-13 18:43:21,897 INFO : Executor : Experiments configuration\n", + "2016-12-13 18:43:21,898 INFO : Executor : ################################################################################\n", + "2016-12-13 18:43:21,899 INFO : Executor : Configured to run:\n", + "2016-12-13 18:43:21,900 INFO : Executor : 5 target configurations:\n", + "2016-12-13 18:43:21,901 INFO : Executor : freq_450000, freq_625000, freq_800000, freq_950000, freq_1100000\n", + "2016-12-13 18:43:21,902 INFO : Executor : 1 workloads (1 iterations each)\n", + "2016-12-13 18:43:21,904 INFO : Executor : fie_10pct\n", + "2016-12-13 18:43:21,905 INFO : Executor : Total: 5 experiments\n", + "2016-12-13 18:43:21,906 INFO : Executor : Results will be collected under:\n", + "2016-12-13 18:43:21,907 INFO : Executor : /home/brejac01/sources/lisa/results/20161213_184321\n", + "2016-12-13 18:43:21,908 INFO : Executor : rt-app workloads found, installing tool on target\n", + "2016-12-13 18:43:21,909 INFO : LisaTest : Experiments execution...\n", + "2016-12-13 18:43:21,909 INFO : Executor : \n", + "2016-12-13 18:43:21,910 INFO : Executor : ################################################################################\n", + "2016-12-13 18:43:21,911 INFO : Executor : Experiments execution\n", + "2016-12-13 18:43:21,912 INFO : Executor : ################################################################################\n", + "2016-12-13 18:43:21,913 INFO : Executor : \n", + "2016-12-13 18:43:21,914 INFO : Executor : ================================================================================\n", + "2016-12-13 18:43:21,915 INFO : Executor : configuring target for [freq_450000] experiments\n", + "2016-12-13 18:43:23,632 INFO : Executor : Configuring all CPUs to use [userspace] cpufreq governor\n", + "2016-12-13 18:43:24,538 INFO : Executor : CPUFreq - CPU frequencies: {1: 450000}\n", + "2016-12-13 18:43:26,552 INFO : Workload : Setup new workload fie_10pct\n", + "2016-12-13 18:43:26,553 INFO : Workload : Workload duration defined by longest task\n", + "2016-12-13 18:43:26,554 INFO : Workload : Default policy: SCHED_OTHER\n", + "2016-12-13 18:43:26,556 INFO : Workload : ------------------------\n", + "2016-12-13 18:43:26,557 INFO : Workload : task [fie_test0], sched: using default policy\n", + "2016-12-13 18:43:26,558 INFO : Workload : | calibration CPU: 1\n", + "2016-12-13 18:43:26,559 INFO : Workload : | loops count: 1\n", + "2016-12-13 18:43:26,560 INFO : Workload : + phase_000001: duration 5.000000 [s] (500 loops)\n", + "2016-12-13 18:43:26,561 INFO : Workload : | period 10000 [us], duty_cycle 10 %\n", + "2016-12-13 18:43:26,563 INFO : Workload : | run_time 1000 [us], sleep_time 9000 [us]\n", + "2016-12-13 18:43:27,716 INFO : Executor : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "2016-12-13 18:43:27,718 INFO : Executor : Experiment 0/5, [freq_450000:fie_10pct] 1/1\n", + "2016-12-13 18:43:28,137 INFO : Executor : Freezing all tasks except: init,systemd,sh,ssh\n", + "2016-12-13 18:43:32,461 WARNING : Executor : FTrace events collection enabled\n", + "2016-12-13 18:43:39,129 INFO : Workload : Workload execution START:\n", + "2016-12-13 18:43:39,131 INFO : Workload : /home/brendan/devlib-target/bin/taskset 0x2 /home/brendan/devlib-target/bin/rt-app /home/brendan/devlib-target/run_dir/fie_10pct_00.json 2>&1\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2016-12-13 18:43:50,424 INFO : Executor : Collected FTrace binary trace:\n", + "2016-12-13 18:43:50,426 INFO : Executor : /rtapp:freq_450000:fie_10pct/1/trace.dat\n", + "2016-12-13 18:43:50,427 INFO : Executor : Collected FTrace function profiling:\n", + "2016-12-13 18:43:50,429 INFO : Executor : /rtapp:freq_450000:fie_10pct/1/trace_stat.json\n", + "2016-12-13 18:43:50,430 INFO : Executor : Un-freezing userspace tasks\n", + "2016-12-13 18:43:53,237 INFO : Executor : --------------------------------------------------------------------------------\n", + "2016-12-13 18:43:53,239 INFO : Executor : \n", + "2016-12-13 18:43:53,240 INFO : Executor : ================================================================================\n", + "2016-12-13 18:43:53,242 INFO : Executor : configuring target for [freq_625000] experiments\n", + "2016-12-13 18:43:54,961 INFO : Executor : Configuring all CPUs to use [userspace] cpufreq governor\n", + "2016-12-13 18:43:55,867 INFO : Executor : CPUFreq - CPU frequencies: {1: 625000}\n", + "2016-12-13 18:43:57,884 INFO : Workload : Setup new workload fie_10pct\n", + "2016-12-13 18:43:57,885 INFO : Workload : Workload duration defined by longest task\n", + "2016-12-13 18:43:57,886 INFO : Workload : Default policy: SCHED_OTHER\n", + "2016-12-13 18:43:57,887 INFO : Workload : ------------------------\n", + "2016-12-13 18:43:57,889 INFO : Workload : task [fie_test0], sched: using default policy\n", + "2016-12-13 18:43:57,890 INFO : Workload : | calibration CPU: 1\n", + "2016-12-13 18:43:57,891 INFO : Workload : | loops count: 1\n", + "2016-12-13 18:43:57,892 INFO : Workload : + phase_000001: duration 5.000000 [s] (500 loops)\n", + "2016-12-13 18:43:57,893 INFO : Workload : | period 10000 [us], duty_cycle 10 %\n", + "2016-12-13 18:43:57,894 INFO : Workload : | run_time 1000 [us], sleep_time 9000 [us]\n", + "2016-12-13 18:43:58,533 INFO : Executor : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "2016-12-13 18:43:58,535 INFO : Executor : Experiment 1/5, [freq_625000:fie_10pct] 1/1\n", + "2016-12-13 18:43:58,953 INFO : Executor : Freezing all tasks except: init,systemd,sh,ssh\n", + "2016-12-13 18:44:02,372 WARNING : Executor : FTrace events collection enabled\n", + "2016-12-13 18:44:08,978 INFO : Workload : Workload execution START:\n", + "2016-12-13 18:44:08,980 INFO : Workload : /home/brendan/devlib-target/bin/taskset 0x2 /home/brendan/devlib-target/bin/rt-app /home/brendan/devlib-target/run_dir/fie_10pct_00.json 2>&1\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2016-12-13 18:44:19,940 INFO : Executor : Collected FTrace binary trace:\n", + "2016-12-13 18:44:19,942 INFO : Executor : /rtapp:freq_625000:fie_10pct/1/trace.dat\n", + "2016-12-13 18:44:19,943 INFO : Executor : Collected FTrace function profiling:\n", + "2016-12-13 18:44:19,944 INFO : Executor : /rtapp:freq_625000:fie_10pct/1/trace_stat.json\n", + "2016-12-13 18:44:19,946 INFO : Executor : Un-freezing userspace tasks\n", + "2016-12-13 18:44:22,458 INFO : Executor : --------------------------------------------------------------------------------\n", + "2016-12-13 18:44:22,460 INFO : Executor : \n", + "2016-12-13 18:44:22,461 INFO : Executor : ================================================================================\n", + "2016-12-13 18:44:22,462 INFO : Executor : configuring target for [freq_800000] experiments\n", + "2016-12-13 18:44:24,181 INFO : Executor : Configuring all CPUs to use [userspace] cpufreq governor\n", + "2016-12-13 18:44:25,087 INFO : Executor : CPUFreq - CPU frequencies: {1: 800000}\n", + "2016-12-13 18:44:27,102 INFO : Workload : Setup new workload fie_10pct\n", + "2016-12-13 18:44:27,104 INFO : Workload : Workload duration defined by longest task\n", + "2016-12-13 18:44:27,105 INFO : Workload : Default policy: SCHED_OTHER\n", + "2016-12-13 18:44:27,106 INFO : Workload : ------------------------\n", + "2016-12-13 18:44:27,107 INFO : Workload : task [fie_test0], sched: using default policy\n", + "2016-12-13 18:44:27,108 INFO : Workload : | calibration CPU: 1\n", + "2016-12-13 18:44:27,109 INFO : Workload : | loops count: 1\n", + "2016-12-13 18:44:27,110 INFO : Workload : + phase_000001: duration 5.000000 [s] (500 loops)\n", + "2016-12-13 18:44:27,111 INFO : Workload : | period 10000 [us], duty_cycle 10 %\n", + "2016-12-13 18:44:27,112 INFO : Workload : | run_time 1000 [us], sleep_time 9000 [us]\n", + "2016-12-13 18:44:27,726 INFO : Executor : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "2016-12-13 18:44:27,728 INFO : Executor : Experiment 2/5, [freq_800000:fie_10pct] 1/1\n", + "2016-12-13 18:44:28,143 INFO : Executor : Freezing all tasks except: init,systemd,sh,ssh\n", + "2016-12-13 18:44:31,562 WARNING : Executor : FTrace events collection enabled\n", + "2016-12-13 18:44:38,158 INFO : Workload : Workload execution START:\n", + "2016-12-13 18:44:38,159 INFO : Workload : /home/brendan/devlib-target/bin/taskset 0x2 /home/brendan/devlib-target/bin/rt-app /home/brendan/devlib-target/run_dir/fie_10pct_00.json 2>&1\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2016-12-13 18:44:48,888 INFO : Executor : Collected FTrace binary trace:\n", + "2016-12-13 18:44:48,890 INFO : Executor : /rtapp:freq_800000:fie_10pct/1/trace.dat\n", + "2016-12-13 18:44:48,891 INFO : Executor : Collected FTrace function profiling:\n", + "2016-12-13 18:44:48,892 INFO : Executor : /rtapp:freq_800000:fie_10pct/1/trace_stat.json\n", + "2016-12-13 18:44:48,893 INFO : Executor : Un-freezing userspace tasks\n", + "2016-12-13 18:44:51,405 INFO : Executor : --------------------------------------------------------------------------------\n", + "2016-12-13 18:44:51,406 INFO : Executor : \n", + "2016-12-13 18:44:51,408 INFO : Executor : ================================================================================\n", + "2016-12-13 18:44:51,409 INFO : Executor : configuring target for [freq_950000] experiments\n", + "2016-12-13 18:44:53,127 INFO : Executor : Configuring all CPUs to use [userspace] cpufreq governor\n", + "2016-12-13 18:44:54,033 INFO : Executor : CPUFreq - CPU frequencies: {1: 950000}\n", + "2016-12-13 18:44:56,048 INFO : Workload : Setup new workload fie_10pct\n", + "2016-12-13 18:44:56,049 INFO : Workload : Workload duration defined by longest task\n", + "2016-12-13 18:44:56,050 INFO : Workload : Default policy: SCHED_OTHER\n", + "2016-12-13 18:44:56,052 INFO : Workload : ------------------------\n", + "2016-12-13 18:44:56,053 INFO : Workload : task [fie_test0], sched: using default policy\n", + "2016-12-13 18:44:56,054 INFO : Workload : | calibration CPU: 1\n", + "2016-12-13 18:44:56,055 INFO : Workload : | loops count: 1\n", + "2016-12-13 18:44:56,056 INFO : Workload : + phase_000001: duration 5.000000 [s] (500 loops)\n", + "2016-12-13 18:44:56,057 INFO : Workload : | period 10000 [us], duty_cycle 10 %\n", + "2016-12-13 18:44:56,058 INFO : Workload : | run_time 1000 [us], sleep_time 9000 [us]\n", + "2016-12-13 18:44:56,655 INFO : Executor : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "2016-12-13 18:44:56,657 INFO : Executor : Experiment 3/5, [freq_950000:fie_10pct] 1/1\n", + "2016-12-13 18:44:57,072 INFO : Executor : Freezing all tasks except: init,systemd,sh,ssh\n", + "2016-12-13 18:45:00,491 WARNING : Executor : FTrace events collection enabled\n", + "2016-12-13 18:45:07,085 INFO : Workload : Workload execution START:\n", + "2016-12-13 18:45:07,086 INFO : Workload : /home/brendan/devlib-target/bin/taskset 0x2 /home/brendan/devlib-target/bin/rt-app /home/brendan/devlib-target/run_dir/fie_10pct_00.json 2>&1\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2016-12-13 18:45:17,664 INFO : Executor : Collected FTrace binary trace:\n", + "2016-12-13 18:45:17,666 INFO : Executor : /rtapp:freq_950000:fie_10pct/1/trace.dat\n", + "2016-12-13 18:45:17,667 INFO : Executor : Collected FTrace function profiling:\n", + "2016-12-13 18:45:17,669 INFO : Executor : /rtapp:freq_950000:fie_10pct/1/trace_stat.json\n", + "2016-12-13 18:45:17,670 INFO : Executor : Un-freezing userspace tasks\n", + "2016-12-13 18:45:20,182 INFO : Executor : --------------------------------------------------------------------------------\n", + "2016-12-13 18:45:20,183 INFO : Executor : \n", + "2016-12-13 18:45:20,184 INFO : Executor : ================================================================================\n", + "2016-12-13 18:45:20,186 INFO : Executor : configuring target for [freq_1100000] experiments\n", + "2016-12-13 18:45:21,904 INFO : Executor : Configuring all CPUs to use [userspace] cpufreq governor\n", + "2016-12-13 18:45:22,810 INFO : Executor : CPUFreq - CPU frequencies: {1: 1100000}\n", + "2016-12-13 18:45:24,825 INFO : Workload : Setup new workload fie_10pct\n", + "2016-12-13 18:45:24,827 INFO : Workload : Workload duration defined by longest task\n", + "2016-12-13 18:45:24,828 INFO : Workload : Default policy: SCHED_OTHER\n", + "2016-12-13 18:45:24,829 INFO : Workload : ------------------------\n", + "2016-12-13 18:45:24,831 INFO : Workload : task [fie_test0], sched: using default policy\n", + "2016-12-13 18:45:24,832 INFO : Workload : | calibration CPU: 1\n", + "2016-12-13 18:45:24,833 INFO : Workload : | loops count: 1\n", + "2016-12-13 18:45:24,834 INFO : Workload : + phase_000001: duration 5.000000 [s] (500 loops)\n", + "2016-12-13 18:45:24,835 INFO : Workload : | period 10000 [us], duty_cycle 10 %\n", + "2016-12-13 18:45:24,836 INFO : Workload : | run_time 1000 [us], sleep_time 9000 [us]\n", + "2016-12-13 18:45:25,425 INFO : Executor : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "2016-12-13 18:45:25,427 INFO : Executor : Experiment 4/5, [freq_1100000:fie_10pct] 1/1\n", + "2016-12-13 18:45:25,842 INFO : Executor : Freezing all tasks except: init,systemd,sh,ssh\n", + "2016-12-13 18:45:29,260 WARNING : Executor : FTrace events collection enabled\n", + "2016-12-13 18:45:35,878 INFO : Workload : Workload execution START:\n", + "2016-12-13 18:45:35,879 INFO : Workload : /home/brendan/devlib-target/bin/taskset 0x2 /home/brendan/devlib-target/bin/rt-app /home/brendan/devlib-target/run_dir/fie_10pct_00.json 2>&1\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2016-12-13 18:45:46,348 INFO : Executor : Collected FTrace binary trace:\n", + "2016-12-13 18:45:46,350 INFO : Executor : /rtapp:freq_1100000:fie_10pct/1/trace.dat\n", + "2016-12-13 18:45:46,351 INFO : Executor : Collected FTrace function profiling:\n", + "2016-12-13 18:45:46,352 INFO : Executor : /rtapp:freq_1100000:fie_10pct/1/trace_stat.json\n", + "2016-12-13 18:45:46,353 INFO : Executor : Un-freezing userspace tasks\n", + "2016-12-13 18:45:48,864 INFO : Executor : --------------------------------------------------------------------------------\n", + "2016-12-13 18:45:48,866 INFO : Executor : \n", + "2016-12-13 18:45:48,867 INFO : Executor : ################################################################################\n", + "2016-12-13 18:45:48,868 INFO : Executor : Experiments execution completed\n", + "2016-12-13 18:45:48,869 INFO : Executor : ################################################################################\n", + "2016-12-13 18:45:48,870 INFO : Executor : Results available in:\n", + "2016-12-13 18:45:48,872 INFO : Executor : /home/brejac01/sources/lisa/results/20161213_184321\n" + ] + } + ], + "source": [ + "t.setUpClass()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Show variance in util_avg and load_avg\n", + "We want to see the same util_avg and load_avg values regardless of frequencies - the bar charts below should have bars all with roughly the same height." + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [], + "source": [ + "# Get the frequency an experiment was run at\n", + "def experiment_freq(exp):\n", + " [cpu] = exp.wload.cpus\n", + " freq = exp.conf['cpufreq']['freqs'][cpu]\n", + " return freq\n", + "freqs = [experiment_freq(e) for e in t.executor.experiments]" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def plot_signal_against_freq(signal):\n", + " means = [t.get_signal_mean(e, signal) for e in t.executor.experiments]\n", + " limits = (min(means) * 0.99, max(means) * 1.01)\n", + " pd.DataFrame(means, index=freqs, columns=['Mean ' + signal]).plot(kind='bar', ylim=limits)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Plot of variation of util_avg value with frequency:" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEhCAYAAAB89xvjAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAG7JJREFUeJzt3XuYVPWd5/F34QUJAk2HEXpAQdao6+I9GS8RqfHuxihm\nFxJUBOMTJ/FJVs1kRmRHbJ1MoowymdmsJMEbjoKiibfNoDBooauZOI8aRAlhUFwU5aKAgKAY6f3j\nd+hT3VR39f101+/9ep566tSpOqe//ePw6V/9zq9OgSRJkiRJkiRJkiRJkiRJkrrAXcA6YGnRumpg\nIbACWABUJev3A+YCrwLLgClN7LMWeAd4Jbmd09FFS5JabzRwLA0Dfzrw18nytcDNyfJkQuAD9AFW\nAQeV2OcNwPc7ulBJUvN6lXn+OWBTo3XnA7OT5dnA2GT5PaAvsFdyvxPY0sR+c62uVJLULuUCv5TB\nhGEekvvByfJThIB/D3gL+HtgcxP7+B6wBLiTdEhIkpSxETQc0mnc49+Y3F8C/JLQw/8TYDlwcIn9\nHUDo4eeAHxJCX5LUyfZuwzbrgCHAWqAGWJ+sPxl4BPgM2AA8D3yRMJZfbH3R8h3AE6V+yJgxY+oW\nL17chvIkKWqLgXypJ9oypPM4MClZngQ8miwvB05LlvsCJwK/L7F9TdHyhTR891Bv8eLF1NXVZX67\n4YYbMq+hu9xsC9vBtuj+bQGMaSq8ywX+XOAF4DDgbeAywqycMwnTMk8jnaXzc2DfJMBfJEzpfC15\nbhZwXLJ8C2Hq5pKksGvK1CBJ6gDlhnQmNLH+jBLrPiGM45fyraLlS8sVJUnqeG0Z0olKPp/PuoRu\nw7YIbIeUbZHqCW3RnefD1yXjUZKkFsrlctBEtrdllo6kbqS6uppNmxrPllalGzhwIBs3biz/wiL2\n8KUeLpfL4f+V+DT1795cD98xfEmKhIEv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8L9Jv74sVgMI01O/SDhRF6MRhA9cAfwnwsydmP7oFRsF/HfCxfVi9jrh3W4psWdG\nj3UecV0wTVLLjKPpP3pju7IQSVJ2vln+JZKkStCth3ScpSNJrdPclNxufaFFA1+SWucAwpeYbyrx\n3AtdXEurGPiS1Dq/JnzqutSVYxeXWCdJkiRJkiRJkiRJkiQpGv8fKtPNeJgAZjoAAAAASUVORK5C\nYII=\n", + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "plot_signal_against_freq('util_avg')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### And the same thing for load_avg:" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEcCAYAAADEEw+QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHhRJREFUeJzt3XuUFNW96PFvK8EMhoEZSQBFGI3BmKgBNdG49NIniQbv\n8kHildcxmpdJzIqJeuINrkQy3sREPFFychLNiQEveoRclzEazEUxYANLzxEPEnmp5CGIisiFQTAg\nz7p/7GKqZ+im50nNTH0/a/Xq6ureNb/5Tc+vq/feVQWSJEmSJEmSJEmSJEmSJEnqALm0Ayhn1KhR\n0YIFC9IOQ5K6mwVAvtQThx3aOFpuwYIFRFGU+u373/9+6jF0lZu5MA/mouvnAhhVrq522YIvSepY\nFnxJyggLfgX5fD7tELoMcxGYh4S5SHSHXHTZQVsgivujJEktlMvloExt73VoQ5HUFrW1tTQ0NKQd\nhrqQmpoaNm/e3Ko27uFL3UAul8P/BxUr95442B6+ffiSlBGVCv50YAOwvGhdLfAEsBqYC/SP1/cG\n7gGWAX+i/FzQeuBVYGl8G92GuCVJrVSp4N/DgQV5EqHgDwfmxY8BrgL2AacC5wG3U/prRQTcAYyM\nb4+1JXBJUutUKviLgOYjRRcDM+LlGcCYePkk4Ml4eSOwBTijzHa78tiBpG6uUChw7LHHdsq26+rq\nmDdvXqdsu7O1pQ9/IKGbh/h+YLz8POHD4HDgOOB0YEiZbVwTv34aSZeQpFaorq4ll8t12q26urbF\nsdTV1XHEEUewadOmJutHjhzJYYcdxiuvvNLRv35q9uenO2rvoG0U3yD0978K/BcwFXga2FuizV2E\nD4QRwHpC14+kVtq2rYHkX7Djb2H7LZPL5Tj++OOZNWtW47rly5ezY8eOblsce6K2FPwNwKB4eTDw\nZry8F7ie0C8/hrDnvrpE+zdJ3lW/Bj5W7gfV19c33gqFQhtClXSoXH755dx7772Nj2fMmMEVV1zR\nZOrgzp07+fa3v82wYcMYNGgQV199Ne+88w4AW7Zs4cILL+R973sftbW1XHTRRbz22muNbfP5PJMn\nT+acc86hurqaT3/60wd8oyjnhRdeIJ/PU1NTw8knn8zs2bMbn/vDH/7AyJEj6devH0OHDuXmm29u\n0va+++5j2LBhDBgwgB/96Ect+nmLFy/m4x//ODU1NRx99NFcc8017N69G4Crr76aG264ocnrL7nk\nEqZOnQrAc889x8iRI6murmbs2LGMGzeOm266qezPKhQKTWple9XRdJbObcB34uVJwK3xchVwZLx8\nHlAos73BRcvXATPLvC6SFJT6fwAiiDrx1vL/wbq6uuiPf/xjdOKJJ0YvvPBCtGfPnmjIkCHR2rVr\no1wuF61duzaKoii69tpro0suuSRqaGiItm3bFl100UXRjTfeGEVRFG3atCl66KGHoh07dkTbtm2L\nLrvssmjMmDGNP2PUqFHRCSecEP35z3+OduzYEeXz+WjSpEkl43nyySejIUOGRFEURbt27Yre//73\nRz/+8Y+j3bt3R/Pnz4/69u0bvfTSS1EURVGhUIhWrFgRRVEULVu2LBo4cGD08MMPR1EURStXroze\n8573RIsWLYp27twZXX/99VGvXr2iefPmHTQfS5YsiZ555plo79690Zo1a6KTTjop+ulPfxpFURQt\nXLgwOvbYYxtfu3nz5qiqqipav359tHPnzmjo0KHRz372s2jPnj3RQw89FPXu3Tu66aabDvgZ5f4+\nJL0urTYLeB3YBawDvkCYlvlHDpyWWQe8CKyK1xePmNwNnBYv30uYuvk88DDJGIAFXyqjuxT8H/7w\nh9GNN94YzZkzJzr//POjPXv2NBb8ffv2RUceeWT017/+tbHd008/HR133HElt7l06dKopqam8XE+\nn49uueWWxsd33nlnNHr06JJtiwv+woULo0GDBjV5fsKECVF9fX3Jtt/61rei6667LoqiKLr55puj\nCRMmND7397//Perdu3fFgt/c1KlTo8985jNRFEXRvn37oqFDh0YLFy6MoiiKfvWrX0Wf/OQnoyiK\nogULFkTHHHNMk7bnnHNOhxX8SqdWmFBm/adKrFsDfLDM668qWr6iws+U1A3lcjk+97nPce655/Ly\nyy8f0J2zceNGtm/fzumnn964Looi9u3bB8D27du57rrrePzxxxtPI/H2228TRVHjOMCgQYMa21ZV\nVfH2229XjOv1118/YMbOsGHDGruLnnnmGSZNmsTKlSvZtWsXO3fuZOzYsY1thwxJ5p706dOHo446\nquLPXL16Nddffz1Llixh+/bt7NmzhzPOOKMxT+PHj2fWrFmce+65zJw5kyuuuKLx5x1zzDFNtnXs\nscd22FHWHmkrqcMMHTqU448/njlz5vDZz362yXMDBgygqqqKVatW0dDQQENDA1u2bGHr1q0A3H77\n7axevZrFixfz1ltvNbkIUnscffTRrFu3rsl21q5d21jIJ06cyJgxY3j11VfZsmULX/va1xpfu7/t\nftu3b2/RuMHVV1/Nhz70If7yl7/w1ltvccsttzR+sAFMmDCBBx98kLVr17J48WIuvfRSAAYPHtxk\n3ALglVde6bCBbwu+pA41bdo05s+fT1VVVZP1hx12GFdddRXXXnstGzduBOC1115j7ty5QNibr6qq\nol+/fmzevPmAwVOgTcX/zDPPpE+fPtx2223s3r2bQqHAo48+yvjx4xt/bk1NDb1792bx4sXMnJkM\nK1566aU8+uijPPXUU+zatYvJkyc3KdzlvP322/Tt25c+ffrw4osvctdddzV5fsSIEQwYMIAvf/nL\njB49murqagDOPvtsDj/8cH7+85+zZ88eHnnkEZ599tlW/87lWPAldajjjz+e0047rfFx8d7plClT\nOOGEEzjrrLPo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d0GeU/9MYcykAk\nSen5YtoBSJIOjS7dpZPVQUlJaquDTcnt0mcOteBLUuu8j3AR84YSzz19iGNpFQu+JLXOHwhHXZc6\nc2wWj9uRJEmSJEmSJEmSJEmS1Oj/A45+GIr5IOmSAAAAAElFTkSuQmCC\n", + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "plot_signal_against_freq('load_avg')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Examine trace from workload execution" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Plot task residency and `sched_util` and `sched_load` for the workload task, along with the expected mean value for util_avg. Note that assuming the system was under little load, so that the task was RUNNING whenever it was RUNNABLE, `load_avg` and `util_avg` should be the same. \n", + "\n", + "Call `examine_experiment` with different experiment indexes to get plots for runs at different frequencies." + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "signals = ['util_avg', 'load_avg']\n", + "def examine_experiment(idx):\n", + " experiment = t.executor.experiments[idx]\n", + " \n", + " [freq] = experiment.conf['cpufreq']['freqs'].values()\n", + " print \"Experiment ran at frequency {}\".format(freq)\n", + " events = t.te.test_conf[\"ftrace\"][\"events\"]\n", + " \n", + " # todo add get_trace method\n", + " tasks = experiment.wload.tasks.keys()\n", + " #trace = Trace(t.te.platform, experiment.out_dir, events, tasks)\n", + " print \"Trace plot:\"\n", + " plot_trace(t.get_trace(experiment).ftrace)\n", + " \n", + " # Get observed signal\n", + " signal_df = t.get_sched_signals(experiment, signals)\n", + " # Get expected average value for util_avg signal\n", + " expected_util_avg_mean = t.get_expected_util_avg(experiment)\n", + " \n", + " print \"Scheduler signals:\"\n", + " # Plot util avg signal with expected mean value\n", + " util_avg_mean = pd.Series([expected_util_avg_mean], name=\"expected_util_avg\", index=[signal_df.index[0]])\n", + " df = pd.concat([signal_df, util_avg_mean], axis=1).fillna(method=\"ffill\")\n", + " ILinePlot(df, column=signals + [\"expected_util_avg\"], drawstyle=\"steps-post\").view()" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Experiment 0: 450000Hz\n", + "Experiment 1: 625000Hz\n", + "Experiment 2: 800000Hz\n", + "Experiment 3: 950000Hz\n", + "Experiment 4: 1100000Hz\n" + ] + } + ], + "source": [ + "for i , f in enumerate(freqs):\n", + " print \"Experiment {}:{:10d}Hz\".format(i, f)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Experiment ran at frequency 450000\n", + "Trace plot:\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "
\n", + "\n", + "\n", + "\n", + " \n", + "
" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Scheduler signals:\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
\n", + "\n", + "\n", + "\n", + "\n", + "\n", + " \n", + " " + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "examine_experiment(0)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/ipynb/tests/Generic_EAS_Tests.ipynb b/ipynb/tests/Generic_EAS_Tests.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..0c8571ba47453eedf2ab93aa41f5e8c11585e966 --- /dev/null +++ b/ipynb/tests/Generic_EAS_Tests.ipynb @@ -0,0 +1,533 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Run Generic Automated EAS tests\n", + "This is a starting-point notebook for running tests from the generic EAS suite in `tests/eas/generic.py`. The test classes that are imported here provide helper methods to aid analysis of the cause of failure. You can use Python's `help` built-in to find those methods (or you can just read the docstrings in the code).\n", + "\n", + "These tests make estimation of the energy efficiency of task placements, without directly examining the behaviour of cpufreq or cpuidle. Several test classes are provided, the only difference between them being the workload that is used." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Setup" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2016-12-21 15:44:32,999 INFO : root : Using LISA logging configuration:\n", + "2016-12-21 15:44:33,000 INFO : root : /home/brejac01/sources/lisa/logging.conf\n" + ] + } + ], + "source": [ + "%load_ext autoreload\n", + "%autoreload 2\n", + "%matplotlib inline\n", + "\n", + "import logging\n", + "from conf import LisaLogging\n", + "LisaLogging.setup()\n", + "logging.getLogger().setLevel(logging.ERROR) # ixnay on the ogginglay\n", + "\n", + "import pandas as pd\n", + "\n", + "from perf_analysis import PerfAnalysis\n", + "\n", + "import trappy\n", + "from trappy import ILinePlot\n", + "from trappy.stats.grammar import Parser" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Run test workload\n", + "\n", + "See `tests/eas/generic.py` for details of the available tests. To run different tests, simply change the constructor call that assigns to `t` and then run the remaining cells below. \n", + "\n", + "If you simply want to run all the tests and get pass/fail results, use this command in the LISA shell: `lisa-test tests/eas/generic.py`. This notebook is intended as a starting point for analysing what scheduler behaviour caused a failure.\n", + "\n", + "Target configuration is taken from `$LISA_HOME/target.config` - you'll need to edit that file to provide connection details for the target you want to test." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "from tests.eas.generic import TwoBigTasks, TwoBigThreeSmall, RampUp, RampDown, EnergyModelWakeMigration, OneSmallTask" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Test EAS for tasks alternating beetween 10% and 50%\n", + " \n" + ] + } + ], + "source": [ + "t = EnergyModelWakeMigration(methodName=\"test_task_placement\")\n", + "print t.__doc__" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + } + ], + "source": [ + "t.setUpClass()" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "experiment = t.executor.experiments[0]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Examine trace\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "utils = t.get_task_utils_df(experiment)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false, + "scrolled": false + }, + "outputs": [], + "source": [ + "cpus = t.get_task_cpu_df(experiment)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [], + "source": [ + "estimated_power = t.get_power_df(experiment)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [], + "source": [ + "expected_power = t.get_expected_power_df(experiment)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Plot Schedule" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "trace = t.get_trace(experiment)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false, + "scrolled": false + }, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "
\n", + "\n", + "\n", + "\n", + " \n", + "
" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "trappy.plotter.plot_trace(trace.ftrace)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Plot estimated ideal and estimated power usage" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
\n", + "\n", + "\n", + "\n", + "\n", + "\n", + " \n", + " " + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "df = pd.concat([expected_power, estimated_power], axis=1).fillna(method='ffill')\n", + "df = df['power']\n", + "\n", + "df.columns = ['ideal_power', 'observed_power']\n", + "\n", + "ILinePlot(df, column=df.columns.tolist(), drawstyle='steps-post').view()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Plot CPU frequency" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "(0.74615494571027741, 0.8140613253196135)" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAA7UAAAISCAYAAAATN+jXAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3X+cXGV96PHP8iMpuOKCKYFJgJTgRlEh3QpqrrF75cel\nFiFaWqylNZUW7qW91tvbW6HeaK6pXEivtfYHvaZGja5g6Q+5iqKAt6uhW9cLSRAFdmFIJMmQhQ0M\nZAVDDHv/eM5sZs6Z2Z3ZzK8z+3m/XvOaec4858wzzznfOfOdc54zIEmSJEmSJEmSJEmSJEmSJEmS\nJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmqgzcDtwK7gf3AOHAn8JvA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AAAAOtJREFUf7iSJGXDTq0kSfnyJuA3gFuB48A3gD3ABeA3gdcCnwH+NXAdcBT4b5lEKklSF2xe\nvYokSeoRC0RXZC8B/0D0z+m/iz97AtgNDAO/Djwav78JqHY1SkmSushOrSRJ+fL/4udXgZfr3n+V\n6Lg+APwQ2NfluCRJyoS3H0uSlB8Dq1ehDPwy8I64/Frg2nWLSJKkjNmplSSpNy3UPTd6zbLXtfLL\nwAHgEDBF9LNAN65fmJIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIk\nSZIkSZIkSdIG9P8BY3FMYP1/QX4AAAAASUVORK5CYII=\n", + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "trace.analysis.frequency.plotClusterFrequencies()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Assertions\n", + "These are the assertions used to generate pass/fail results s. They aren't very useful in this interactive context - it's much more interesting to examine plots like the one above and see whether the behaviour was desirable or not." + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "ename": "AssertionError", + "evalue": "task task_wmig0 missed 25.0% of activations\n\tCheck trace file: /home/brejac01/sources/lisa/results/20161221_154451/rtapp:energy_aware:wake_migration/1/trace.dat", + "output_type": "error", + "traceback": [ + "\u001b[1;31m\u001b[0m", + "\u001b[1;31mAssertionError\u001b[0mTraceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mt\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtest_slack\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;32m/home/brejac01/sources/lisa/libs/utils/test.pyc\u001b[0m in \u001b[0;36mexperiment_test\u001b[1;34m(wrapped_test, instance, args, kwargs)\u001b[0m\n\u001b[0;32m 204\u001b[0m \u001b[0mtasks\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mexperiment\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mwload\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtasks\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mkeys\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 205\u001b[0m \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 206\u001b[1;33m \u001b[0mwrapped_test\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mexperiment\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtasks\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m*\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 207\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mAssertionError\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 208\u001b[0m \u001b[0mtrace_relpath\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mos\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mexperiment\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mout_dir\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m\"trace.dat\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m/home/brejac01/sources/lisa/tests/eas/generic.pyc\u001b[0m in \u001b[0;36mtest_slack\u001b[1;34m(self, experiment, tasks)\u001b[0m\n\u001b[0;32m 428\u001b[0m \u001b[1;33m@\u001b[0m\u001b[0mexperiment_test\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 429\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mtest_slack\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mexperiment\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtasks\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 430\u001b[1;33m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_test_slack\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mexperiment\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtasks\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 431\u001b[0m \u001b[1;33m@\u001b[0m\u001b[0mexperiment_test\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 432\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mtest_task_placement\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mexperiment\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtasks\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m/home/brejac01/sources/lisa/tests/eas/generic.pyc\u001b[0m in \u001b[0;36m_test_slack\u001b[1;34m(self, experiment, tasks)\u001b[0m\n\u001b[0;32m 199\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mbad_activations_pct\u001b[0m \u001b[1;33m>\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mnegative_slack_allowed_pct\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 200\u001b[0m raise AssertionError(\"task {} missed {}% of activations\".format(\n\u001b[1;32m--> 201\u001b[1;33m task, bad_activations_pct))\n\u001b[0m\u001b[0;32m 202\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 203\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0m_test_task_placement\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mexperiment\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtasks\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;31mAssertionError\u001b[0m: task task_wmig0 missed 25.0% of activations\n\tCheck trace file: /home/brejac01/sources/lisa/results/20161221_154451/rtapp:energy_aware:wake_migration/1/trace.dat" + ] + } + ], + "source": [ + "t.test_slack()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "t.test_task_placement()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 1 +} diff --git a/libs/utils/energy_model.py b/libs/utils/energy_model.py new file mode 100644 index 0000000000000000000000000000000000000000..4d27662df9c1789e2abf3634fc8a3d8bc71a3f19 --- /dev/null +++ b/libs/utils/energy_model.py @@ -0,0 +1,601 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (C) 2016, ARM Limited and contributors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from collections import namedtuple +from itertools import product +import logging + +import pandas as pd +import numpy as np + +from devlib.utils.misc import memoized + +"""Classes for modeling and estimating energy usage of CPU systems +""" + +class EnergyModelCapacityError(Exception): + """Used by :meth:`EnergyModel.get_optimal_placements`""" + pass + +class ActiveState(namedtuple('ActiveState', ['capacity', 'power'])): + """Represents power and compute capacity at a given frequency + + :param capacity: Relative compute capacity at frequency + :param power: Power usage at frequency + """ + def __new__(cls, capacity=None, power=None): + return super(ActiveState, cls).__new__(cls, capacity, power) + +class _CpuTree(object): + """Internal class. Abstract representation of a CPU topology. + + Each node contains either a single CPU or a set of child nodes. + """ + def __init__(self, cpu, children): + if (cpu is None) == (children is None): + raise ValueError('Provide exactly one of: cpus or children') + + self.parent = None + + if cpu is not None: + self.cpu = cpu + self.cpus = [cpu] + self.children = [] + else: + if len(children) == 0: + raise ValueError('children cannot be empty') + self.cpu = None + self.cpus = sorted(set().union(*[n.cpus for n in children])) + self.children = children + for child in children: + child.parent = self + + self.name = None + + def __repr__(self): + name_bit = '' + if self.name: + name_bit = 'name="{}", '.format(self.name) + + if self.children: + return '{}({}children={})'.format( + self.__class__.__name__, name_bit, self.children) + else: + return '{}({}cpus={})'.format( + self.__class__.__name__, name_bit, self.cpus) + + def _iter(self, include_non_leaves): + for child in self.children: + for child_i in child._iter(include_non_leaves): + yield child_i + if include_non_leaves or not self.children: + yield self + + def iter_nodes(self): + return self._iter(True) + + def iter_leaves(self): + return self._iter(False) + +class EnergyModelNode(_CpuTree): + """Describes topology and energy data for an EnergyModel. + + Represents a CPU topology with energy data. The active and idle state data + represents the power usage of just the hardware resources of this topology + level, not its children. e.g. If the node represents a cluster, the power + numbers should not include power used by the CPU - that power should be + included the data of the child nodes. + + Exactly one of ``cpu`` and ``children`` must be given. + + :param active_states: Dict mapping frequencies to :class:`ActiveState` + values. Compute capacity data is optional for + non-leaf nodes. + :param idle_states: Dict mapping idle state names to power usage values + :param cpu: The CPU this node represents. If provided, this is a leaf node. + :param children: Non-empty list of child :class:`EnergyModelNode` objects + :param name: Optional human-readable name for this node. Leaf (CPU) nodes + have a default name of "cpuN" where N is the cpu number. + + :ivar cpus: CPUs contained in this node. Includes those of child nodes. + :ivar cpu: For convenience, this holds the single CPU contained by leaf + nodes. ``None`` for non-leaf nodes. + """ + def __init__(self, active_states, idle_states, + cpu=None, children=None, name=None): + super(EnergyModelNode, self).__init__(cpu, children) + + if cpu and not name: + name = 'cpu' + str(cpu) + + self.name = name + self.active_states = active_states + self.idle_states = idle_states + + @property + def max_capacity(self): + """Compute capacity at highest frequency""" + return max(s.capacity for s in self.active_states.values()) + +class EnergyModelRoot(EnergyModelNode): + """ + Convenience class for root of an EnergyModelNode tree. + + Just like EnergyModelNode except that ``active_states`` and ``idle_states`` + aren't required. + """ + def __init__(self, active_states=None, idle_states=None, *args, **kwargs): + return super(EnergyModelRoot, self).__init__( + active_states, idle_states, *args, **kwargs) + +class PowerDomain(_CpuTree): + """Describes the power domain hierarchy for an EnergyModel. + + Power domains are a description of the topological dependencies in hardware + for entering idle states. "Composite" states such as cluster-sleep states + require a set of CPUs to all be idle before that state can be entered. In + that case those CPUs can be grouped into a power domain, and that composite + state attached to the power domain. Note that cpuidle is not aware of these + dependencies; they are typically handled by the platform firmware. + + Exactly one of ``cpu`` and ``children`` must be given. That is, leaves of + the PowerDomain tree always contain exactly one CPU - each CPU is + represented as being in a power domain of its own. This represents the + assumption that all CPUs have at least one idle state (such as ARM WFI) that + they can enter independently of other CPUs. + + :param idle_states: List of names of idle states for this power domain. Does + not store power data - these names are used as keys into + the ``idle_states`` field of :class:`EnergyModelNode` + objects. + :param cpu: The CPU this node represents. If provided, this is a leaf node. + :param children: Non-empty list of child :class:`PowerDomain` objects + + :ivar cpus: CPUs contained in this node. Includes those of child nodes. + """ + def __init__(self, idle_states, cpu=None, children=None): + super(PowerDomain, self).__init__(cpu, children) + self.idle_states = idle_states + +class EnergyModel(object): + """Represents hierarchical CPU topology with power and capacity data + + An energy model consists of + + - A CPU topology, representing the physical (cache/interconnect) topology of + the CPUs. Each node stores the energy usage of that node's hardware when + it is in each active or idle state. They also store a compute capacity eat + each frequency, but this is only meaningful for leaf nodes (CPUs) and may + be None at higher levels. These capacity values are relative; the maximum + capacity would usually be 1024, the value of SCHED_CAPACITY_SCALE in the + Linux kernel scheduler. Use EnergyModelNodes to describe this. + + - A power domain topology, representing the hierarchy of areas that can be + powered down (idled). + The power domains are a single tree. Leaf nodes must contain exactly one + CPU and the root node must indirectly contain every CPU. Each power domain + has a list (maybe empty) of names of idle states that that domain can + enter. + Use PowerDomains to describe this. + + - A set of frequency domains, representing groups of CPUs whose clock + frequencies must be equal (probably because they share a clock). The + frequency domains must be a partition of the CPUs. + + :ivar cpu_nodes: List of leaf (CPU) :class:`EnergyModelNode` + :ivar cpus: List of logical CPU numbers in the system + + :param root_node: Root of :class:`EnergyModelNode` tree + :param root_power_domain: Root of :class:`PowerDomain` tree + :param freq_domains: Collection of collections of logical CPU numbers + representing frequency (clock) domains. + + .. note:: + The most signficant shortcomings of the model are: + + 1. Voltage domains are assumed to be congruent to frequency domains + + 2. Idle state power is assumed to be independent of voltage + + 3. Temperature is ignored entirely + + .. _util-distrib: + + .. admonition:: Utilization Distributions + + Used throughout this module: A ``util_distrib`` is a list ``u`` where + ``u[N]`` is the sum of the frequency-invariant, capacity-invariant + utilization of tasks placed on CPU N. That is, the quantity represented + by a CPU runqueue's util_avg in the Linux kernel scheduler's + load-tracking system with EAS features enabled. + + The range of utilization values is 0 - + :attr:`EnergyModel.capacity_scale`. + + This represents a static utilization, assuming that tasks don't change + in size (for example representing a set of fixed periodic RT-App + workloads). For workloads that change over time, a series of + ``util_distrib`` s would be needed to describe the utilization. + """ + + capacity_scale = 1024 + """The relative computational capacity of the most powerful CPU at its + highest available frequency. + """ + + def __init__(self, root_node, root_power_domain, freq_domains): + self.cpus = root_node.cpus + if self.cpus != range(len(self.cpus)): + raise ValueError('CPU IDs [{}] are sparse'.format(self.cpus)) + + fd_intersection = set().intersection(*freq_domains) + if fd_intersection: + raise ValueError('CPUs {} exist in multiple freq domains'.format( + fd_intersection)) + fd_difference = set(self.cpus) - set().union(*freq_domains) + if fd_difference: + raise ValueError('CPUs {} not in any frequency domain'.format( + fd_difference)) + self.freq_domains = freq_domains + + def sorted_leaves(root): + # Get a list of the leaf (cpu) nodes of a _CpuTree in order of the + # CPU ID + ret = sorted(list(root.iter_leaves()), key=lambda n: n.cpus[0]) + assert all(len(n.cpus) == 1 for n in ret) + return ret + + self.root = root_node + self.cpu_nodes = sorted_leaves(root_node) + self.cpu_pds = sorted_leaves(root_power_domain) + assert len(self.cpu_pds) == len(self.cpu_nodes) + + self._log = logging.getLogger('EnergyModel') + + max_cap = max(n.max_capacity for n in self.cpu_nodes) + if max_cap != self.capacity_scale: + self._log.warning( + 'Unusual max capacity (%s), overriding capacity_scale', max_cap) + self.capacity_scale = max_cap + + def _cpus_with_capacity(self, cap): + """ + Helper method to find the CPUs whose max capacity equals cap + """ + return [c for c in self.cpus + if self.cpu_nodes[c].max_capacity == cap] + + @property + @memoized + def biggest_cpus(self): + """ + The CPUs with the highest compute capacity at their highest frequency + """ + return self._cpus_with_capacity(self.capacity_scale) + + @property + @memoized + def littlest_cpus(self): + """ + The CPUs with the lowest compute capacity at their highest frequency + """ + min_cap = min(n.max_capacity for n in self.cpu_nodes) + return self._cpus_with_capacity(min_cap) + + @property + @memoized + def is_heterogeneous(self): + """ + True iff CPUs do not all have the same efficiency and OPP range + """ + states = self.cpu_nodes[0].active_states + return any(c.active_states != states for c in self.cpu_nodes[1:]) + + @property + @memoized + def cpu_groups(self): + """ + List of lists of CPUs who share the same active state values + """ + groups = [] + for node in self.cpu_nodes: + for group in groups: + group_states = self.cpu_nodes[group[0]].active_states + if node.active_states == group_states: + group.append(node.cpu) + break + else: + groups.append([node.cpu]) + return groups + + def _guess_idle_states(self, cpus_active): + def find_deepest(pd): + if not any(cpus_active[c] for c in pd.cpus): + if pd.parent: + parent_state = find_deepest(pd.parent) + if parent_state: + return parent_state + return pd.idle_states[-1] if len(pd.idle_states) else None + return None + + return [find_deepest(pd) for pd in self.cpu_pds] + + def get_cpu_capacity(self, cpu, freq=None): + """Convenience method to get the capacity of a CPU at a given frequency + + :param cpu: CPU to get capacity for + :param freq: Frequency to get the CPU capacity at. Default is max + capacity. + """ + if freq is None: + return self.cpu_nodes[cpu].max_capacity + else: + return self.cpu_nodes[cpu].active_states[freq].capacity + + def guess_idle_states(self, cpus_active): + """Pessimistically guess the idle states that each CPU may enter + + If a CPU has any tasks it is estimated that it may only enter its + shallowest idle state in between task activations. If all the CPUs + within a power domain have no tasks, they will all be judged able to + enter that domain's deepest idle state. If any CPU in a domain has work, + no CPUs in that domain are assumed to enter any domain shared state. + + e.g. Consider a system with + + - two power domains PD0 and PD1 + + - 4 CPUs, with CPUs [0, 1] in PD0 and CPUs [2, 3] in PD1 + + - 4 idle states: "WFI", "cpu-sleep", "cluster-sleep-0" and "cluster-sleep-1" + + Then here are some example inputs and outputs: + + :: + + # All CPUs idle: + [0, 0, 0, 0] -> ["cluster-sleep-0", "cluster-sleep-0", + "cluster-sleep-0", "cluster-sleep-0"] + + # All CPUs have work + [1, 1, 1, 1] -> ["WFI","WFI","WFI", "WFI"] + + # One power domain active, the other idle + [0, 0, 1, 1] -> ["cluster-sleep-1", "cluster-sleep-1", "WFI","WFI"] + + # One CPU active. + # Note that CPU 2 has no work but is assumed to never be able to enter + # any "cluster" state. + [0, 0, 0, 1] -> ["cluster-sleep-1", "cluster-sleep-1", + "cpu-sleep","WFI"] + + :param cpus_active: list where bool(cpus_active[N]) is False iff no + tasks will run on CPU N. + :returns: List ``ret`` where ``ret[N]`` is the name of the estimated + idle state that CPU N can enter during idle periods. + + """ + states = self._guess_idle_states(cpus_active) + return [s or c.idle_states.keys()[0] + for s, c in zip(states, self.cpu_nodes)] + + def _guess_freqs(self, util_distrib): + overutilized = False + # Find what frequency each CPU would need if it was alone in its + # frequency domain + ideal_freqs = [0 for _ in self.cpus] + for node in self.cpu_nodes: + [cpu] = node.cpus + required_cap = util_distrib[cpu] + + possible_freqs = [f for f, s in node.active_states.iteritems() + if s.capacity >= required_cap] + + if possible_freqs: + ideal_freqs[cpu] = min(possible_freqs) + else: + # CPU cannot provide required capacity, use max freq + ideal_freqs[cpu] = max(node.active_states.keys()) + overutilized = True + + # Rectify the frequencies among domains + freqs = [0 for _ in ideal_freqs] + for domain in self.freq_domains: + domain_freq = max(ideal_freqs[c] for c in domain) + for cpu in domain: + freqs[cpu] = domain_freq + + return freqs, overutilized + + def guess_freqs(self, util_distrib): + """Work out CPU frequencies required to execute a workload + + Find the lowest possible frequency for each CPU that provides enough + capacity to satisfy the utilization, taking into account frequency + domains. + + :param util_distrib: Utilization distribution, see + :ref:`util_distribs ` + :returns: List ``ret`` where ``ret[N]`` is the frequency that CPU N must + run at + """ + freqs, _ = self._guess_freqs(util_distrib) + return freqs + + def _estimate_from_active_time(self, cpu_active_time, freqs, idle_states, + combine): + """Helper for estimate_from_cpu_util + + Like estimate_from_cpu_util but uses active time i.e. proportion of time + spent not-idle in the range 0.0 - 1.0. + + If combine=False, return idle and active power as separate components. + """ + power = 0 + ret = {} + + assert all(0.0 <= a <= 1.0 for a in cpu_active_time) + + for node in self.root.iter_nodes(): + if not node.active_states or not node.idle_states: + continue + + cpus = tuple(node.cpus) + # For now we assume topology nodes with energy models do not overlap + # with frequency domains + freq = freqs[cpus[0]] + assert all(freqs[c] == freq for c in cpus[1:]) + + # The active time of a node is estimated as the max of the active + # times of its children. + # This works great for the synthetic periodic workloads we use in + # LISA (where all threads wake up at the same time) but is probably + # no good for real workloads. + active_time = max(cpu_active_time[c] for c in cpus) + active_power = node.active_states[freq].power * active_time + + _idle_power = max(node.idle_states[idle_states[c]] for c in cpus) + idle_power = _idle_power * (1 - active_time) + + if combine: + ret[cpus] = active_power + idle_power + else: + ret[cpus] = {} + ret[cpus]["active"] = active_power + ret[cpus]["idle"] = idle_power + + power += active_power + idle_power + + ret["power"] = power + return ret + + def estimate_from_cpu_util(self, util_distrib, freqs=None, idle_states=None): + """ + Estimate the energy usage of the system under a utilization distribution + + Optionally also take freqs; a list of frequencies at which each CPU is + assumed to run, and idle_states, the idle states that each CPU can enter + between activations. If not provided, they will be estimated assuming an + ideal selection system (i.e. perfect cpufreq & cpuidle governors). + + :param util_distrib: Utilization distribution, see + :ref:`util_distribs ` + :param freqs: List of CPU frequencies. Got from :meth:`guess_freqs` by + default. + :param idle_states: List of CPU frequencies. Got from + :meth:`guess_idle_states` by default. + + :returns: Dict with power in bogo-Watts (bW), with contributions from + each system component keyed with a tuple of the CPUs + comprising that component, and the sum of those components + keyed with 'power'. e.g: + + :: + + { + (0,) : 10, + (1,) : 10, + (1, 2) : 5, + 'power' : 25 + } + + This represents CPUs 0 and 1 each using 10bW and their shared + resources using 5bW for a total of 25bW. + """ + if freqs is None: + freqs = self.guess_freqs(util_distrib) + if idle_states is None: + idle_states = self.guess_idle_states(util_distrib) + + cpu_active_time = [] + for cpu, node in enumerate(self.cpu_nodes): + assert [cpu] == node.cpus + cap = node.active_states[freqs[cpu]].capacity + cpu_active_time.append(min(float(util_distrib[cpu]) / cap, 1.0)) + + return self._estimate_from_active_time(cpu_active_time, + freqs, idle_states, combine=True) + + def get_optimal_placements(self, capacities): + """Find the optimal distribution of work for a set of tasks + + Find a list of candidates which are estimated to be optimal in terms of + power consumption, but that do not result in any CPU becoming + over-utilized. + + If no such candidates exist, i.e. the system being modeled cannot + satisfy the workload's throughput requirements, an + :class:`EnergyModelCapacityError` is raised. For example, if e was an + EnergyModel modeling two CPUs with capacity 1024, this error would be + raised by: + + :: + + e.get_optimal_placements({"t1": 800, "t2": 800, "t3: "800"}) + + This estimation assumes an ideal system of selecting OPPs and idle + states for CPUs. + + .. note:: + This is a brute force search taking time exponential wrt. the number + of tasks. + + :param capacities: Dict mapping tasks to expected utilization + values. These tasks are assumed not to change; they + have a single static utilization value. A set of + single-phase periodic RT-App tasks is an example of a + suitable workload for this model. + :returns: List of ``util_distrib`` s representing distribution of work + under optimal task placments see + :ref:`util_distribs `. Multiple task placements + that result in the same CPU utilizations are considered + equivalent. + """ + tasks = capacities.keys() + + num_candidates = len(self.cpus) ** len(tasks) + self._log.info( + '%14s - Searching %d configurations for optimal task placement...', + 'EnergyModel', num_candidates) + + candidates = {} + for cpus in product(self.cpus, repeat=len(tasks)): + placement = {task: cpu for task, cpu in zip(tasks, cpus)} + + util = [0 for _ in self.cpus] + for task, cpu in placement.items(): + util[cpu] += capacities[task] + util = tuple(util) + + if util not in candidates: + freqs, overutilized = self._guess_freqs(util) + if not overutilized: + power = self.estimate_from_cpu_util(util, freqs=freqs) + candidates[util] = power + + if not candidates: + # The system can't provide full throughput to this workload. + raise EnergyModelCapacityError( + "Can't handle workload - total cap = {}".format( + sum(capacities.values()))) + + # Whittle down to those that give the lowest energy estimate + min_power = min(e['power'] for e in candidates.itervalues()) + ret = [u for u, e in candidates.iteritems() if e['power'] == min_power] + + self._log.info('%14s - Done', 'EnergyModel') + return ret diff --git a/libs/utils/env.py b/libs/utils/env.py index bed90ee7db99558208091a6b76162684209cf932..ea20c0d87882051abfe1d7392e0f248c9b8bee42 100644 --- a/libs/utils/env.py +++ b/libs/utils/env.py @@ -26,15 +26,16 @@ import time import unittest import devlib +from devlib.utils.misc import memoized +from devlib import Platform +from trappy.stats.Topology import Topology from wlgen import RTA from energy import EnergyMeter from conf import JsonConf - -from devlib.utils.misc import memoized -from trappy.stats.Topology import Topology - -from devlib import Platform +from platforms.juno_energy import juno_energy +from platforms.hikey_energy import hikey_energy +from platforms.pixel_energy import pixel_energy USERNAME_DEFAULT = 'root' PASSWORD_DEFAULT = '' @@ -372,6 +373,7 @@ class TestEnv(ShareState): # Initialize JUNO board elif self.conf['board'].upper() in ('JUNO', 'JUNO2'): platform = devlib.platform.arm.Juno() + self.nrg_model = juno_energy self.__modules = ['bl', 'hwmon', 'cpufreq'] # Initialize OAK board @@ -379,6 +381,18 @@ class TestEnv(ShareState): platform = Platform(model='MT8173') self.__modules = ['bl', 'cpufreq'] + + elif self.conf['board'].upper() == 'HIKEY': + self.nrg_model = hikey_energy + self.__modules = [ "cpufreq", "cpuidle" ] + platform = Platform(model='hikey') + + # Initialize Pixel phone + elif self.conf['board'].upper() == 'PIXEL': + self.nrg_model = pixel_energy + self.__modules = ['bl', 'hwmon', 'cpufreq'] + platform = Platform(model='pixel') + elif self.conf['board'] != 'UNKNOWN': # Initilize from platform descriptor (if available) board = self._load_board(self.conf['board']) diff --git a/libs/utils/platforms/__init__.py b/libs/utils/platforms/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/libs/utils/platforms/hikey_energy.py b/libs/utils/platforms/hikey_energy.py new file mode 100644 index 0000000000000000000000000000000000000000..64cb13d01de0d39a477f4f05e7a65c0c423581ec --- /dev/null +++ b/libs/utils/platforms/hikey_energy.py @@ -0,0 +1,68 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (C) 2016, ARM Limited and contributors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from energy_model import (ActiveState, EnergyModelNode, EnergyModelRoot, + PowerDomain, EnergyModel) + +from collections import OrderedDict + +cluster_active_states = OrderedDict([ + (208000, ActiveState(capacity=178, power=16)), + (432000, ActiveState(capacity=369, power=29)), + (729000, ActiveState(capacity=622, power=47)), + (960000, ActiveState(capacity=819, power=75)), + (1200000, ActiveState(capacity=1024, power=112)) +]) + +cluster_idle_states = OrderedDict([ + ('WFI', 107), + ('cpu-sleep', 47), + ('cluster-sleep', 0) +]) + +cpu_active_states = OrderedDict([ + (208000, ActiveState(capacity=178, power=69)), + (432000, ActiveState(capacity=369, power=125)), + (729000, ActiveState(capacity=622, power=224)), + (960000, ActiveState(capacity=819, power=367)), + (1200000, ActiveState(capacity=1024, power=670)) +]) + +cpu_idle_states = OrderedDict([('WFI', 15), ('cpu-sleep', 0), ('cluster-sleep', 0)]) + +def cpu_pd(cpu): + return PowerDomain(cpu=cpu, idle_states=['WFI', 'cpu-sleep']) + +def cpu_node(cpu): + return EnergyModelNode(cpu=cpu, + active_states=cpu_active_states, + idle_states=cpu_idle_states) +hikey_energy = EnergyModel( + root_node=EnergyModelRoot(children=[ + EnergyModelNode(name='cluster0', + children=[cpu_node(c) for c in [0, 1, 2, 3]], + active_states=cluster_active_states, + idle_states=cluster_idle_states), + EnergyModelNode(name='cluster1', + children=[cpu_node(c) for c in [4, 5, 6, 7]], + active_states=cluster_active_states, + idle_states=cluster_idle_states)]), + root_power_domain=PowerDomain(idle_states=[], children=[ + PowerDomain(idle_states=["cluster-sleep"], children=[ + cpu_pd(c) for c in [0, 1, 2, 3]]), + PowerDomain(idle_states=["cluster-sleep"], children=[ + cpu_pd(c) for c in [4, 5, 6, 7]])]), + freq_domains=[[0, 1, 2, 3, 4, 5, 6, 7]]) diff --git a/libs/utils/platforms/juno_energy.py b/libs/utils/platforms/juno_energy.py new file mode 100644 index 0000000000000000000000000000000000000000..9bdd43d7758e25368cf943337b3e7ef3d74799c9 --- /dev/null +++ b/libs/utils/platforms/juno_energy.py @@ -0,0 +1,115 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (C) 2016, ARM Limited and contributors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from collections import OrderedDict + +from energy_model import (ActiveState, EnergyModelNode, EnergyModelRoot, + PowerDomain, EnergyModel) + +a53_cluster_active_states = OrderedDict([ + (450000, ActiveState(power=26)), + (575000, ActiveState(power=30)), + (700000, ActiveState(power=39)), + (775000, ActiveState(power=47)), + (850000, ActiveState(power=57)), +]) + +# TODO warn if any of the idle states aren't represented by power domains +a53_cluster_idle_states = OrderedDict([ + ("WFI", 56), + ("cpu-sleep-0", 56), + ("cluster-sleep-0", 17), +]) + +a53_cpu_active_states = OrderedDict([ + (450000, ActiveState(capacity=235, power=33)), + (575000, ActiveState(capacity=302, power=46)), + (700000, ActiveState(capacity=368, power=61)), + (775000, ActiveState(capacity=406, power=76)), + (850000, ActiveState(capacity=447, power=93)), +]) + +a53_cpu_idle_states = OrderedDict([ + ("WFI", 6), + ("cpu-sleep-0", 0), + ("cluster-sleep-0", 0), +]) + +a53s = [0, 3, 4, 5] + +def a53_cpu_node(cpu): + return EnergyModelNode(cpu=cpu, + active_states=a53_cpu_active_states, + idle_states=a53_cpu_idle_states) + +a57_cluster_active_states = OrderedDict([ + (450000, ActiveState(power=24)), + (625000, ActiveState(power=32)), + (800000, ActiveState(power=43)), + (950000, ActiveState(power=49)), + (1100000, ActiveState(power=64)), +]) + +a57_cluster_idle_states = OrderedDict([ + ("WFI", 65), + ("cpu-sleep-0", 65), + ("cluster-sleep-0", 24), +]) + +a57_cpu_active_states = OrderedDict([ + (450000, ActiveState(capacity=417, power=168)), + (625000, ActiveState(capacity=579, power=251)), + (800000, ActiveState(capacity=744, power=359)), + (950000, ActiveState(capacity=883, power=479)), + (1100000, ActiveState(capacity=1024, power=616)), +]) + +a57_cpu_idle_states = OrderedDict([ + ("WFI", 15), + ("cpu-sleep-0", 0), + ("cluster-sleep-0", 0), +]) + +a57s = [1, 2] + +def a57_cpu_node(cpu): + return EnergyModelNode(cpu=cpu, + active_states=a57_cpu_active_states, + idle_states=a57_cpu_idle_states) + +juno_energy = EnergyModel( + root_node=EnergyModelRoot( + children=[ + EnergyModelNode( + name="cluster_a57", + active_states=a57_cluster_active_states, + idle_states=a57_cluster_idle_states, + children=[a57_cpu_node(c) for c in a57s]), + EnergyModelNode( + name="cluster_a53", + active_states=a53_cluster_active_states, + idle_states=a53_cluster_idle_states, + children=[a53_cpu_node(c) for c in a53s])]), + root_power_domain=PowerDomain(idle_states=[], children=[ + PowerDomain( + idle_states=["cluster-sleep-0"], + children=[PowerDomain(idle_states=["WFI", "cpu-sleep-0"], cpu=c) + for c in a57s]), + PowerDomain( + idle_states=["cluster-sleep-0"], + children=[PowerDomain(idle_states=["WFI", "cpu-sleep-0"], cpu=c) + for c in a53s])]), + freq_domains=[a53s, a57s]) diff --git a/libs/utils/platforms/pixel_energy.py b/libs/utils/platforms/pixel_energy.py new file mode 100644 index 0000000000000000000000000000000000000000..cf63aa0a6eb75e2afcd3019ad443734ed4ebfecf --- /dev/null +++ b/libs/utils/platforms/pixel_energy.py @@ -0,0 +1,164 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (C) 2016, ARM Limited and contributors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from energy_model import (ActiveState, EnergyModelNode, EnergyModelRoot, + PowerDomain, EnergyModel) + +from collections import OrderedDict + +silver_cpu_active_states = OrderedDict([ + (307200, ActiveState(capacity=149, power=90)), + (384000, ActiveState(capacity=188, power=111)), + (460800, ActiveState(capacity=225, power=133)), + (537600, ActiveState(capacity=257, power=160)), + (614400, ActiveState(capacity=281, power=182)), + (691200, ActiveState(capacity=315, power=210)), + (768000, ActiveState(capacity=368, power=251)), + (844800, ActiveState(capacity=406, power=306)), + (902400, ActiveState(capacity=428, power=332)), + (979200, ActiveState(capacity=469, power=379)), + (1056000, ActiveState(capacity=502, power=438)), + (1132800, ActiveState(capacity=538, power=494)), + (1209600, ActiveState(capacity=581, power=550)), + (1286400, ActiveState(capacity=611, power=613)), + (1363200, ActiveState(capacity=648, power=670)), + (1440000, ActiveState(capacity=684, power=752)), + (1516800, ActiveState(capacity=729, power=848)), + (1593600, ActiveState(capacity=763, power=925)), +]) + +silver_cluster_active_states = OrderedDict([ + (307200, ActiveState(power=4)), + (384000, ActiveState(power=4)), + (460800, ActiveState(power=4)), + (537600, ActiveState(power=4)), + (614400, ActiveState(power=4)), + (691200, ActiveState(power=4)), + (768000, ActiveState(power=8)), + (844800, ActiveState(power=9)), + (902400, ActiveState(power=15)), + (979200, ActiveState(power=16)), + (1056000, ActiveState(power=21)), + (1132800, ActiveState(power=22)), + (1209600, ActiveState(power=29)), + (1286400, ActiveState(power=32)), + (1363200, ActiveState(power=42)), + (1440000, ActiveState(power=49)), + (1516800, ActiveState(power=41)), + (1593600, ActiveState(power=52)), +]) + +gold_cpu_active_states = OrderedDict([ + (307200, ActiveState(capacity=149, power=93)), + (384000, ActiveState(capacity=188, power=111)), + (460800, ActiveState(capacity=225, power=133)), + (537600, ActiveState(capacity=257, power=160)), + (614400, ActiveState(capacity=281, power=182)), + (691200, ActiveState(capacity=315, power=210)), + (748800, ActiveState(capacity=348, power=252)), + (825600, ActiveState(capacity=374, power=290)), + (902400, ActiveState(capacity=428, power=332)), + (979200, ActiveState(capacity=469, power=379)), + (1056000, ActiveState(capacity=502, power=438)), + (1132800, ActiveState(capacity=538, power=494)), + (1209600, ActiveState(capacity=581, power=550)), + (1286400, ActiveState(capacity=611, power=613)), + (1363200, ActiveState(capacity=648, power=670)), + (1440000, ActiveState(capacity=684, power=752)), + (1516800, ActiveState(capacity=729, power=848)), + (1593600, ActiveState(capacity=763, power=925)), + (1670400, ActiveState(capacity=795, power=1018)), + (1747200, ActiveState(capacity=832, power=1073)), + (1824000, ActiveState(capacity=868, power=1209)), + (1900800, ActiveState(capacity=905, power=1298)), + (1977600, ActiveState(capacity=952, power=1428)), + (2054400, ActiveState(capacity=979, power=1521)), + (2150400, ActiveState(capacity=1024, power=1715)), +]) + +gold_cluster_active_states = OrderedDict([ + (307200, ActiveState(power=4)), + (384000, ActiveState(power=4)), + (460800, ActiveState(power=4)), + (537600, ActiveState(power=4)), + (614400, ActiveState(power=4)), + (691200, ActiveState(power=4)), + (748800, ActiveState(power=7)), + (825600, ActiveState(power=10)), + (902400, ActiveState(power=15)), + (979200, ActiveState(power=16)), + (1056000, ActiveState(power=21)), + (1132800, ActiveState(power=22)), + (1209600, ActiveState(power=29)), + (1286400, ActiveState(power=32)), + (1363200, ActiveState(power=42)), + (1440000, ActiveState(power=49)), + (1516800, ActiveState(power=41)), + (1593600, ActiveState(power=52)), + (1670400, ActiveState(power=62)), + (1747200, ActiveState(power=69)), + (1824000, ActiveState(power=75)), + (1900800, ActiveState(power=81)), + (1977600, ActiveState(power=90)), + (2054400, ActiveState(power=93)), + (2150400, ActiveState(power=96)), +]) + +# TODO warn if any of the idle states aren't represented by power domains +cpu_idle_states = OrderedDict([ + ("WFI", 2), + ("cpu-sleep-0", 0), + ("cluster-sleep-0", 0), +]) + +cluster_idle_states = OrderedDict([ + ("WFI", 0), + ("cpu-sleep-0", 0), + ("cluster-sleep-0", 0), +]) + +silvers = [0, 1] +golds = [2, 3] + +def silver_cpu_node(cpu): + return EnergyModelNode(cpu=cpu, + active_states=silver_cpu_active_states, + idle_states=cpu_idle_states) + +def gold_cpu_node(cpu): + return EnergyModelNode(cpu=cpu, + active_states=gold_cpu_active_states, + idle_states=cpu_idle_states) + +def cpu_pd(cpu): + return PowerDomain(cpu=cpu, idle_states=["WFI", "cpu-sleep-0"]) + +pixel_energy = EnergyModel( + root_node=EnergyModelRoot(children=[ + EnergyModelNode(name='cluster_silver', + children=[silver_cpu_node(c) for c in silvers], + active_states=silver_cluster_active_states, + idle_states=cluster_idle_states), + EnergyModelNode(name='cluster_gold', + children=[gold_cpu_node(c) for c in golds], + active_states=gold_cluster_active_states, + idle_states=cluster_idle_states)]), + root_power_domain=PowerDomain(idle_states=[], children=[ + PowerDomain(idle_states=['cluster-sleep-0'], children=[ + cpu_pd(c) for c in silvers]), + PowerDomain(idle_states=['cluster-sleep-0'], children=[ + cpu_pd(c) for c in golds])]), + freq_domains=[silvers, golds]) diff --git a/libs/utils/test.py b/libs/utils/test.py index 3cc338352f78368ca0c98d149f1a17b13a809364..099fa27ee24b2eafd9faf700500612b8b5e2fba7 100644 --- a/libs/utils/test.py +++ b/libs/utils/test.py @@ -191,6 +191,12 @@ class LisaTest(unittest.TestCase): return end_times + # Defining a default, empty runTest allows test classes to be conveniently + # instantiated. Since we run tests via nose, runTest isn't used. Instead all + # the public methods with 'test' in the name are treated as test methods. + def runTest(self, *args, **kwargs): + pass + @wrapt.decorator def experiment_test(wrapped_test, instance, args, kwargs): diff --git a/src/shell/lisa_shell b/src/shell/lisa_shell index 222a3f035d590ff464a09f0fddf29d40f79c3758..d993502684c349dac279647d03d679d91a16a16c 100755 --- a/src/shell/lisa_shell +++ b/src/shell/lisa_shell @@ -30,6 +30,7 @@ export LISA_HOME="$(pwd)" export PYTHONPATH='' export PYTHONPATH=$LISA_HOME/libs/utils:$PYTHONPATH export PYTHONPATH=$LISA_HOME/libs/wlgen:$PYTHONPATH +export PYTHONPATH=$LISA_HOME:$PYTHONPATH if [ "x$DEVMODE" == "x1" ]; then export PYTHONPATH=$LISA_HOME/libs/devlib:$PYTHONPATH diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/eas/__init__.py b/tests/eas/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..551982ca0608f30ad9640fceb6a19eb6caa1f515 --- /dev/null +++ b/tests/eas/__init__.py @@ -0,0 +1,104 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (C) 2016, ARM Limited and contributors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from unittest import SkipTest + +from bart.sched.SchedMultiAssert import SchedMultiAssert +from devlib.target import TargetError +from test import LisaTest + +WORKLOAD_DURATION_S = 5 +WORKLOAD_PERIOD_MS = 10 +SWITCH_WINDOW_HALF = 0.5 +SMALL_DCYCLE = 10 +BIG_DCYCLE = 100 +STEP_HIGH_DCYCLE = 50 +STEP_LOW_DCYCLE = 10 +EXPECTED_RESIDENCY_PCT = 85 +OFFLOAD_EXPECTED_BUSY_TIME_PCT = 97 +SET_IS_BIG_LITTLE = True +SET_INITIAL_TASK_UTIL = True +OFFLOAD_MIGRATION_MIGRATOR_DELAY = 1 + +energy_aware_conf = { + 'tag' : 'energy_aware', + 'flags' : 'ftrace', + 'sched_features' : 'ENERGY_AWARE', +} + +class EasTest(LisaTest): + """ + Base class for EAS tests + """ + + test_conf = { + "ftrace" : { + "events" : [ + "sched_overutilized", + "sched_energy_diff", + "sched_load_avg_task", + "sched_load_avg_cpu", + "sched_migrate_task", + "sched_switch", + "cpu_frequency" + ], + }, + "modules": ["cgroups"], + "cpufreq" : { + "governor" : "sched", + }, + } + + # Set to true to run a test only on heterogeneous systems + skip_on_smp = False + + @classmethod + def setUpClass(cls, *args, **kwargs): + super(EasTest, cls)._init(*args, **kwargs) + + @classmethod + def _getExperimentsConf(cls, test_env): + if cls.skip_on_smp and not test_env.nrg_model.is_heterogeneous: + raise SkipTest('Test not required on symmetric systems') + return super(EasTest, cls)._getExperimentsConf(test_env) + + @classmethod + def _experimentsInit(cls, *args, **kwargs): + super(EasTest, cls)._experimentsInit(*args, **kwargs) + + if SET_IS_BIG_LITTLE: + # This flag doesn't exist on mainline-integration kernels, so + # don't worry if the file isn't present (hence verify=False) + cls.target.write_value( + "/proc/sys/kernel/sched_is_big_little", 1, verify=False) + + if SET_INITIAL_TASK_UTIL: + # This flag doesn't exist on all kernels, so don't worry if the file + # isn't present (hence verify=False) + cls.target.write_value( + "/proc/sys/kernel/sched_initial_task_util", 1024, verify=False) + + def _do_test_first_cpu(self, experiment, tasks): + """Test that all tasks start on a big CPU""" + + sched_assert = self.get_multi_assert(experiment) + + self.assertTrue( + sched_assert.assertFirstCpu( + self.te.nrg_model.biggest_cpus, + rank=len(tasks)), + msg="Not all the new generated tasks started on a big CPU") diff --git a/tests/eas/acceptance.py b/tests/eas/acceptance.py index c6dbbf291247a6cbca04d6597410a8744ace2aad..76a6740fdd1d0ea443d71b757cc06fd8eeb5a720 100644 --- a/tests/eas/acceptance.py +++ b/tests/eas/acceptance.py @@ -20,83 +20,22 @@ import operator import os import trappy import unittest +from unittest import SkipTest from bart.sched.SchedAssert import SchedAssert from devlib.target import TargetError -from env import TestEnv -from test import LisaTest, experiment_test - -# Global test configuration parameters -WORKLOAD_DURATION_S = 5 -WORKLOAD_PERIOD_MS = 10 -SWITCH_WINDOW_HALF = 0.5 -SMALL_DCYCLE = 10 -BIG_DCYCLE = 100 -STEP_HIGH_DCYCLE = 50 -STEP_LOW_DCYCLE = 10 -EXPECTED_RESIDENCY_PCT = 85 -OFFLOAD_EXPECTED_BUSY_TIME_PCT = 97 -SET_IS_BIG_LITTLE = True -SET_INITIAL_TASK_UTIL = True -OFFLOAD_MIGRATION_MIGRATOR_DELAY = 1 - -energy_aware_conf = { - "tag" : "energy_aware", - "flags" : ["ftrace", "freeze_userspace"], - "sched_features" : "ENERGY_AWARE", -} - -class EasTest(LisaTest): - """ - Base class for EAS tests - """ - - test_conf = { - "ftrace" : { - "events" : [ - "sched_overutilized", - "sched_energy_diff", - "sched_load_avg_task", - "sched_load_avg_cpu", - "sched_migrate_task", - "sched_switch" - ], - }, - "modules": ["cgroups"], - } - - @classmethod - def setUpClass(cls, *args, **kwargs): - super(EasTest, cls)._init(*args, **kwargs) - - @classmethod - def _experimentsInit(cls, *args, **kwargs): - super(EasTest, cls)._experimentsInit(*args, **kwargs) - - if SET_IS_BIG_LITTLE: - # This flag doesn't exist on mainline-integration kernels, so - # don't worry if the file isn't present (hence verify=False) - cls.target.write_value( - "/proc/sys/kernel/sched_is_big_little", 1, verify=False) - - if SET_INITIAL_TASK_UTIL: - # This flag doesn't exist on all kernels, so don't worry if the file - # isn't present (hence verify=False) - cls.target.write_value( - "/proc/sys/kernel/sched_initial_task_util", 1024, verify=False) - - def _do_test_first_cpu(self, experiment, tasks): - """Test that all tasks start on a big CPU""" - - sched_assert = self.get_multi_assert(experiment) - - self.assertTrue( - sched_assert.assertFirstCpu( - self.target.bl.bigs, - rank=len(tasks)), - msg="Not all the new generated tasks started on a big CPU") +from test import experiment_test +from . import (EasTest, energy_aware_conf, + WORKLOAD_DURATION_S, + WORKLOAD_PERIOD_MS, + SWITCH_WINDOW_HALF, + SMALL_DCYCLE, + BIG_DCYCLE, + EXPECTED_RESIDENCY_PCT, + OFFLOAD_EXPECTED_BUSY_TIME_PCT, + OFFLOAD_MIGRATION_MIGRATOR_DELAY) class ForkMigration(EasTest): """ @@ -153,7 +92,7 @@ class SmallTaskPacking(EasTest): Goal ==== - Many small tasks are packed in little cpus + Many small tasks are packed on a single cluster with the lowest capacity Detailed Description ==================== @@ -187,6 +126,8 @@ class SmallTaskPacking(EasTest): "confs" : [energy_aware_conf] } + skip_on_smp = False + @experiment_test def test_first_cpu(self, experiment, tasks): """Small Task Packing: test first CPU""" @@ -194,20 +135,23 @@ class SmallTaskPacking(EasTest): @experiment_test def test_small_task_residency(self, experiment, tasks): - "Small Task Packing: Test Residency (Little Cluster)" + "Small Task Packing: Test Residency" sched_assert = self.get_multi_assert(experiment) - self.assertTrue( - sched_assert.assertResidency( - "cluster", - self.target.bl.littles, - EXPECTED_RESIDENCY_PCT, - operator.ge, - percent=True, - rank=len(tasks)), - msg="Not all tasks are running on LITTLE cores for at least {}% of their execution time"\ - .format(EXPECTED_RESIDENCY_PCT)) + littlest_cpus = self.te.nrg_model.littlest_cpus + + for cpus in self.te.topology.get_level("cluster"): + if all(c in littlest_cpus for c in cpus): + if sched_assert.assertResidency( + "cluster", cpus, + EXPECTED_RESIDENCY_PCT, operator.ge, + percent=True, rank=len(tasks)): + return + + msg = "Not all tasks ran on low-capacity cluster for {}% of their time"\ + .format(EXPECTED_RESIDENCY_PCT) + raise AssertionError(msg) class OffloadMigrationAndIdlePull(EasTest): """ @@ -296,12 +240,13 @@ class OffloadMigrationAndIdlePull(EasTest): @experiment_test def test_first_cpu(self, experiment, tasks): """Offload Migration and Idle Pull: Test First CPU""" - self._do_test_first_cpu(experiment, tasks) + self._do_test_first_cpu(experiment, [t for t in tasks if "early" in t]) @experiment_test def test_big_cpus_fully_loaded(self, experiment, tasks): """Offload Migration and Idle Pull: Big cpus are fully loaded as long as there are tasks left to run in the system""" - num_big_cpus = len(self.target.bl.bigs) + bigs = self.te.nrg_model.biggest_cpus + num_big_cpus = len(bigs) sched_assert = self.get_multi_assert(experiment) @@ -309,9 +254,8 @@ class OffloadMigrationAndIdlePull(EasTest): # Window of time until the first migrator finishes window = (self.get_start_time(experiment), end_times[-num_big_cpus]) - busy_time = sched_assert.getCPUBusyTime("cluster", - self.target.bl.bigs, - window=window, percent=True) + busy_time = sched_assert.getCPUBusyTime("cluster", bigs, + window=window, percent=True) msg = "Big cpus were not fully loaded while there were enough big tasks to fill them" self.assertGreater(busy_time, OFFLOAD_EXPECTED_BUSY_TIME_PCT, msg=msg) @@ -321,8 +265,7 @@ class OffloadMigrationAndIdlePull(EasTest): for i in range(num_big_cpus-1): big_cpus_left = num_big_cpus - i - 1 window = (end_times[-num_big_cpus+i], end_times[-num_big_cpus+i+1]) - busy_time = sched_assert.getCPUBusyTime("cluster", - self.target.bl.bigs, + busy_time = sched_assert.getCPUBusyTime("cluster", bigs, window=window, percent=True) expected_busy_time = OFFLOAD_EXPECTED_BUSY_TIME_PCT * \ @@ -335,6 +278,7 @@ class OffloadMigrationAndIdlePull(EasTest): @experiment_test def test_little_cpus_run_tasks(self, experiment, tasks): """Offload Migration and Idle Pull: Little cpus run tasks while bigs are busy""" + littles = self.te.nrg_model.littlest_cpus num_offloaded_tasks = len(tasks) / 2 @@ -350,8 +294,7 @@ class OffloadMigrationAndIdlePull(EasTest): all_tasks_assert = self.get_multi_assert(experiment) - busy_time = all_tasks_assert.getCPUBusyTime("cluster", - self.target.bl.littles, + busy_time = all_tasks_assert.getCPUBusyTime("cluster", littles, window=window) window_len = window[1] - window[0] @@ -373,7 +316,8 @@ class OffloadMigrationAndIdlePull(EasTest): sa = SchedAssert(experiment.out_dir, self.te.topology, execname=task) end_times = self.get_end_times(experiment) window = (0, end_times[task]) - big_residency = sa.getResidency("cluster", self.target.bl.bigs, + big_residency = sa.getResidency("cluster", + self.te.nrg_model.biggest_cpus, window=window, percent=True) msg = "Task {} didn't run on a big cpu.".format(task) @@ -393,7 +337,10 @@ class OffloadMigrationAndIdlePull(EasTest): sa = SchedAssert(experiment.out_dir, self.te.topology, execname=task) msg = "Task {} did not finish on a big cpu".format(task) - self.assertIn(sa.getLastCpu(), self.target.bl.bigs, msg=msg) + + self.assertIn(sa.getLastCpu(), + self.te.nrg_model.biggest_cpus, + msg=msg) class WakeMigration(EasTest): diff --git a/tests/eas/generic.py b/tests/eas/generic.py new file mode 100644 index 0000000000000000000000000000000000000000..d520ff4c7f105e1847f94cce5370e42a8abb36f1 --- /dev/null +++ b/tests/eas/generic.py @@ -0,0 +1,433 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (C) 2016, ARM Limited and contributors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from bisect import bisect +from math import isnan + +import numpy as np +import pandas as pd + +from bart.common.Utils import area_under_curve, select_window +from energy_model import EnergyModelCapacityError +from perf_analysis import PerfAnalysis +from test import experiment_test +from trace import Trace +from . import (EasTest, energy_aware_conf, + WORKLOAD_DURATION_S, + WORKLOAD_PERIOD_MS) + +class EnergyModelTest(EasTest): + """ + "Abstract" base class for generic EAS tests using the EnergyModel class + + Subclasses should provide a .workloads member to populate the 'wloads' field + of the experiments_conf for the Executor. A set of helper methods are + provided for making assertions about behaviour, most importantly the _test* + methods which make assertions in a generic way. + """ + + negative_slack_allowed_pct = 5 + """Percentage of RT-App task activations with negative slack allowed""" + + @classmethod + def _getExperimentsConf(cls, *args, **kwargs): + return { + 'wloads' : cls.workloads, + 'confs' : [energy_aware_conf] + } + + def get_task_utils_df(self, experiment): + """ + Get a DataFrame with the *expected* utilization of each task over time + + :param experiment: The :class:Experiment to examine + :returns: A Pandas DataFrame with a column for each task, showing how + the utilization of that task varies over time + """ + util_scale = self.te.nrg_model.capacity_scale + + transitions = {} + def add_transition(time, task, util): + if time not in transitions: + transitions[time] = {task: util} + else: + transitions[time][task] = util + + # First we'll build a dict D {time: {task_name: util}} where D[t][n] is + # the expected utilization of task n from time t. + for task, params in experiment.wload.params['profile'].iteritems(): + time = self.get_start_time(experiment) + params['delay'] + add_transition(time, task, 0) + for _ in range(params.get('loops', 1)): + for phase in params['phases']: + util = (phase.duty_cycle_pct * util_scale / 100.) + add_transition(time, task, util) + time += phase.duration_s + add_transition(time, task, 0) + + index = sorted(transitions.keys()) + df = pd.DataFrame([transitions[k] for k in index], index=index) + return df.fillna(method='ffill') + + def get_task_cpu_df(self, experiment): + """ + Get a DataFrame mapping task names to the CPU they ran on + + Use the sched_switch trace event to find which CPU each task ran + on. Does not reflect idleness - tasks not running are shown as running + on the last CPU they woke ran on. + + :param experiment: The :class:Experiment to examine + :returns: A Pandas DataFrame with a column for each task, showing the + CPU that the task was "on" at each moment in time + """ + tasks = experiment.wload.tasks.keys() + trace = self.get_trace(experiment) + + df = trace.ftrace.sched_switch.data_frame[['next_comm', '__cpu']] + df = df[df['next_comm'].isin(tasks)] + df = df.pivot(index=df.index, columns='next_comm').fillna(method='ffill') + cpu_df = df['__cpu'] + # Drop consecutive duplicates + cpu_df = cpu_df[(cpu_df.shift(+1) != cpu_df).any(axis=1)] + return cpu_df + + def get_power_df(self, experiment): + """ + Considering only the task placement, estimate power usage over time + + Examine a trace and use :meth:EnergyModel.estimate_from_cpu_util to get + a DataFrame showing the estimated power usage over time. This assumes + perfect cpuidle and cpufreq behaviour. + + :param experiment: The :class:Experiment to examine + :returns: A Pandas DataFrame with a column each node in the energy model + (keyed with a tuple of the CPUs contained by that node) and a + "power" column with the sum of other columns. Shows the + estimated power over time. + """ + task_cpu_df = self.get_task_cpu_df(experiment) + task_utils_df = self.get_task_utils_df(experiment) + + tasks = experiment.wload.tasks.keys() + + # Create a combined DataFrame with the utilization of a task and the CPU + # it was running on at each moment. Looks like: + # utils cpus + # task_wmig0 task_wmig1 task_wmig0 task_wmig1 + # 2.375056 102.4 102.4 NaN NaN + # 2.375105 102.4 102.4 2.0 NaN + + df = pd.concat([task_utils_df, task_cpu_df], + axis=1, keys=['utils', 'cpus']) + df = df.sort_index().fillna(method='ffill') + nrg_model = self.executor.te.nrg_model + + # Now make a DataFrame with the estimated power at each moment. + def est_power(row): + cpu_utils = [0 for cpu in nrg_model.cpus] + for task in tasks: + cpu = row['cpus'][task] + util = row['utils'][task] + if not isnan(cpu): + cpu_utils[int(cpu)] += util + power = nrg_model.estimate_from_cpu_util(cpu_utils) + columns = power.keys() + return pd.Series([power[c] for c in columns], index=columns) + return df.apply(est_power, axis=1) + + def get_expected_power_df(self, experiment): + """ + Estimate *optimal* power usage over time + + Examine a trace and use :meth:get_optimal_placements and + :meth:EnergyModel.estimate_from_cpu_util to get a DataFrame showing the + estimated power usage over time under ideal EAS behaviour. + + :param experiment: The :class:Experiment to examine + :returns: A Pandas DataFrame with a column each node in the energy model + (keyed with a tuple of the CPUs contained by that node) and a + "power" column with the sum of other columns. Shows the + estimated *optimal* power over time. + """ + task_utils_df = self.get_task_utils_df(experiment) + + nrg_model = self.te.nrg_model + + def exp_power(row): + task_utils = row.to_dict() + expected_utils = nrg_model.get_optimal_placements(task_utils) + power = nrg_model.estimate_from_cpu_util(expected_utils[0]) + columns = power.keys() + return pd.Series([power[c] for c in columns], index=columns) + return task_utils_df.apply(exp_power, axis=1) + + def _test_slack(self, experiment, tasks): + """ + Assert that the RTApp workload was given enough performance + + Use :class:PerfAnalysis to find instances where the experiment's RT-App + workload wasn't able to complete its activations (i.e. its reported + "slack" was negative). Assert that this happened less that + ``negative_slack_allowed_pct`` percent of the time. + + :meth:_test_task_placement asserts that estimated energy usage was + low. That will pass for runs where too *little* energy was used, + compromising performance. This method provides a separate test to + counteract that problem. + """ + + pa = PerfAnalysis(experiment.out_dir) + for task in tasks: + slack = pa.df(task)["Slack"] + + bad_activations_pct = len(slack[slack < 0]) * 100. / len(slack) + if bad_activations_pct > self.negative_slack_allowed_pct: + raise AssertionError("task {} missed {}% of activations".format( + task, bad_activations_pct)) + + def _test_task_placement(self, experiment, tasks): + """ + Test that task placement was energy-efficient + + Use :meth:get_expected_power_df and :meth:get_power_df to estimate + optimal and observed power usage for task placements of the experiment's + workload. Assert that the observed power does not exceed the optimal + power by more than 20%. + """ + exp_power = self.get_expected_power_df(experiment) + est_power = self.get_power_df(experiment) + + exp_energy = area_under_curve(exp_power['power']) + est_energy = area_under_curve(est_power['power']) + + msg = 'Estimated {} bogo-Joules to run workload, expected {}'.format( + est_energy, exp_energy) + self.assertLess(est_energy, exp_energy * 1.2, msg=msg) + +class OneSmallTask(EnergyModelTest): + """ + Test EAS for a single 20% task + """ + workloads = { + 'one_small' : { + 'type' : 'rt-app', + 'conf' : { + 'class' : 'periodic', + 'params' : { + 'duty_cycle_pct': 20, + 'duration_s': 5, + 'period_ms': 10, + }, + 'tasks' : 1, + 'prefix' : 'many', + }, + }, + } + @experiment_test + def test_slack(self, experiment, tasks): + self._test_slack(experiment, tasks) + @experiment_test + def test_task_placement(self, experiment, tasks): + self._test_task_placement(experiment, tasks) + +class ThreeSmallTasks(EnergyModelTest): + """ + Test EAS for 3 20% tasks + """ + workloads = { + 'three_small' : { + 'type' : 'rt-app', + 'conf' : { + 'class' : 'periodic', + 'params' : { + 'duty_cycle_pct': 20, + 'duration_s': 5, + 'period_ms': 10, + }, + 'tasks' : 3, + 'prefix' : 'many', + }, + }, + } + @experiment_test + def test_slack(self, experiment, tasks): + self._test_slack(experiment, tasks) + @experiment_test + def test_task_placement(self, experiment, tasks): + self._test_task_placement(experiment, tasks) + +class TwoBigTasks(EnergyModelTest): + """ + Test EAS for 2 80% tasks + """ + workloads = { + 'two_big' : { + 'type' : 'rt-app', + 'conf' : { + 'class' : 'periodic', + 'params' : { + 'duty_cycle_pct': 80, + 'duration_s': 5, + 'period_ms': 10, + }, + 'tasks' : 2, + 'prefix' : 'many', + }, + }, + } + @experiment_test + def test_slack(self, experiment, tasks): + self._test_slack(experiment, tasks) + @experiment_test + def test_task_placement(self, experiment, tasks): + self._test_task_placement(experiment, tasks) + +class TwoBigThreeSmall(EnergyModelTest): + """ + Test EAS for 2 70% tasks and 3 10% tasks + """ + workloads = { + 'two_big_three_small' : { + 'type' : 'rt-app', + 'conf' : { + 'class' : 'profile', + 'params' : { + 'large' : { + 'kind' : 'Periodic', + 'params' : { + 'duty_cycle_pct': 70, + 'duration_s': WORKLOAD_DURATION_S, + 'period_ms': WORKLOAD_PERIOD_MS, + }, + 'tasks' : 2, + }, + 'small' : { + 'kind' : 'Periodic', + 'params' : { + 'duty_cycle_pct': 10, + 'duration_s': WORKLOAD_DURATION_S, + 'period_ms': WORKLOAD_PERIOD_MS, + }, + 'tasks' : 3, + }, + }, + }, + }, + } + @experiment_test + def test_slack(self, experiment, tasks): + self._test_slack(experiment, tasks) + @experiment_test + def test_task_placement(self, experiment, tasks): + self._test_task_placement(experiment, tasks) + +class RampUp(EnergyModelTest): + """ + Test EAS for a task ramping from 5% up to 70% over 2 seconds + """ + workloads = { + "ramp_up" : { + "type": "rt-app", + "conf" : { + "class" : "profile", + "params" : { + "r5_10-60" : { + "kind" : "Ramp", + "params" : { + "period_ms" : 16, + "start_pct" : 5, + "end_pct" : 70, + "delta_pct" : 5, + "time_s" : 2, + }, + }, + }, + }, + }, + } + + @experiment_test + def test_slack(self, experiment, tasks): + self._test_slack(experiment, tasks) + @experiment_test + def test_task_placement(self, experiment, tasks): + self._test_task_placement(experiment, tasks) + +class RampDown(EnergyModelTest): + """ + Test EAS for a task ramping from 70% down to 5% over 2 seconds + """ + workloads = { + "ramp_down" : { + "type": "rt-app", + "conf" : { + "class" : "profile", + "params" : { + "r5_10-60" : { + "kind" : "Ramp", + "params" : { + "period_ms" : 16, + "start_pct" : 70, + "end_pct" : 5, + "delta_pct" : 5, + "time_s" : 2, + }, + }, + }, + }, + }, + } + + @experiment_test + def test_slack(self, experiment, tasks): + self._test_slack(experiment, tasks) + @experiment_test + def test_task_placement(self, experiment, tasks): + self._test_task_placement(experiment, tasks) + +class EnergyModelWakeMigration(EnergyModelTest): + """ + Test EAS for tasks alternating beetween 10% and 50% + """ + workloads = { + 'wake_migration' : { + 'type' : 'rt-app', + 'conf' : { + 'class' : 'profile', + 'params' : { + 'wmig' : { + 'kind' : 'Step', + 'params' : { + 'start_pct': 10, + 'end_pct': 50, + 'time_s': 1, + 'loops': 2 + }, + # Create one task for each big cpu + 'tasks' : 'big', + }, + }, + }, + }, + } + @experiment_test + def test_slack(self, experiment, tasks): + self._test_slack(experiment, tasks) + @experiment_test + def test_task_placement(self, experiment, tasks): + self._test_task_placement(experiment, tasks) diff --git a/tests/eas/load_tracking.py b/tests/eas/load_tracking.py new file mode 100644 index 0000000000000000000000000000000000000000..ea1a458810dcdc7d86df0848845ef1d23eefbdcb --- /dev/null +++ b/tests/eas/load_tracking.py @@ -0,0 +1,315 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (C) 2016, ARM Limited and contributors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import logging + +from bart.common.Utils import select_window, area_under_curve +from devlib.utils.misc import memoized +from trappy.stats.grammar import Parser +import pandas as pd + +from test import LisaTest, experiment_test +from trace import Trace + +UTIL_SCALE = 1024 +# Time in seconds to allow for util_avg to converge (i.e. ignored time) +UTIL_AVG_CONVERGENCE_TIME = 0.3 +# Allowed margin between expected and observed util_avg value +ERROR_MARGIN_PCT = 15 + +class LoadTrackingTest(LisaTest): + __test__ = False # This is a base class, don't try to run it as a test + + test_conf = { + 'tools' : [ 'rt-app' ], + 'ftrace' : { + 'events' : [ + 'sched_switch', + 'sched_load_avg_task', + 'sched_load_avg_cpu', + 'sched_pelt_se', + ], + }, + 'modules': ['cpufreq', 'cgroups'], + } + + @classmethod + def setUpClass(cls, *args, **kwargs): + super(LoadTrackingTest, cls)._init(*args, **kwargs) + + @classmethod + def get_wload(cls, cpu): + """ + get a specification for a 10% rt-app workload, pinned to the given cpu + """ + return { + 'type' : 'rt-app', + 'conf' : { + 'class' : 'periodic', + 'params' : { + 'duty_cycle_pct': 10, + 'duration_s': 5, + 'period_ms': 10, + }, + 'tasks' : 1, + 'prefix' : 'lt_test', + 'cpus' : [cpu] + }, + } + + def get_task_activations(self, experiment): + """ + Get a data frame with activation times of the experiment task + + Column 'length' contains the length of each task activation + """ + [task] = experiment.wload.tasks.keys() + sw = self.get_trace(experiment).ftrace.sched_switch.data_frame + start_times = sw[sw['next_comm'] == task].index + end_times = sw[(sw['prev_comm'] == task) + & (sw.index > start_times[0])].index + lengths = (end_times - start_times).tolist() + return pd.DataFrame(lengths, index=start_times, columns=['length']) + + def get_expected_util_avg(self, experiment): + """ + Examine workload and trace to figure out an expected mean for util_avg + + Assumes an RT-App workload with a single task with a single phase + """ + # Examine workload to find period + [task] = experiment.wload.tasks.keys() + [phase] = experiment.wload.params['profile'][task]['phases'] + task_period = phase.period_ms / 1000. + + # Examine trace to find observed duty cycle + mean_runtime = self.get_task_activations(experiment).mean()['length'] + duty_cycle = min(mean_runtime / task_period, 1.0) + + # Find the capacity of the CPU the workload was run on + [cpu] = experiment.wload.cpus + cpufreq = experiment.conf['cpufreq'] + if cpufreq['governor'] == 'userspace': + freq = cpufreq['freqs'][cpu] + cpu_capacity = self.te.nrg_model.get_cpu_capacity(cpu, freq) + else: + assert cpufreq['governor'] == 'performance' + cpu_capacity = self.te.nrg_model.get_cpu_capacity(cpu) + + scaling_factor = float(cpu_capacity) / self.te.nrg_model.capacity_scale + + return UTIL_SCALE * duty_cycle * scaling_factor + + def get_sched_signals(self, experiment, signals): + """ + Get a pandas.DataFrame with the sched signals for the workload task + + This examines scheduler load tracking trace events, supporting either + sched_load_avg_task or sched_pelt_se. You will need a target kernel that + includes these events. + """ + [task] = experiment.wload.tasks.keys() + trace = self.get_trace(experiment) + + # There are two different scheduler trace events that expose the + # util_avg signal. Neither of them is in mainline. Eventually they + # should be unified but for now we'll just check for both types of + # event. + if 'sched_load_avg_task' in trace.available_events: + event = 'sched_load_avg_task' + elif 'sched_pelt_se' in trace.available_events: + event = 'sched_pelt_se' + else: + raise ValueError('No sched_load_avg_task or sched_pelt_se events. ' + 'Does the kernel support them?') + + df = getattr(trace.ftrace, event).data_frame + signals = df[df['comm'] == task][signals] + return select_window(signals, self.get_window(experiment)) + + def get_signal_mean(self, experiment, signal, + ignore_first_s=UTIL_AVG_CONVERGENCE_TIME): + """ + Get the mean of a scheduler signal for the experiment's task + + Ignore the first `ignore_first_s` seconds of the signal. + """ + (wload_start, wload_end) = self.get_window(experiment) + window = (wload_start + ignore_first_s, wload_end) + + signal = self.get_sched_signals(experiment, [signal])[signal] + signal = select_window(signal, window) + return area_under_curve(signal) / (window[1] - window[0]) + +class FreqInvarianceTest(LoadTrackingTest): + """ + Goal + ==== + Basic check for frequency invariant load tracking + + Detailed Description + ==================== + This test runs the same workload on the most capable CPU on the system at a + cross section of available frequencies. The trace is then examined to find + the average activation length of the workload, which is combined with the + known period to estimate an expected mean value for util_avg for each + frequency. The util_avg value is extracted from scheduler trace events and + its mean is compared with the expected value (ignoring the first 300ms so + that the signal can stabilize). The test fails if the observed mean is + beyond a certain error margin from the expected one. load_avg is then + similarly compared with the expected util_avg mean, under the assumption + that load_avg should equal util_avg when system load is light. + + Expected Behaviour + ================== + Load tracking signals are scaled so that the workload results in roughly the + same util & load values regardless of frequency. + """ + + @classmethod + def _getExperimentsConf(cls, test_env): + # Run on one of the CPUs with highest capacity + cpu = test_env.nrg_model.biggest_cpus[0] + + wloads = { + 'fie_10pct' : cls.get_wload(cpu) + } + + # Create a set of confs with different frequencies + # We'll run the 10% workload under each conf (i.e. at each frequency) + confs = [] + + all_freqs = test_env.target.cpufreq.list_frequencies(cpu) + # If we have loads of frequencies just test a cross-section so it + # doesn't take all day + cls.freqs = all_freqs[::len(all_freqs)/8 + 1] + for freq in cls.freqs: + confs.append({ + 'tag' : 'freq_{}'.format(freq), + 'flags' : ['ftrace', 'freeze_userspace'], + 'cpufreq' : { + 'freqs' : {cpu: freq}, + 'governor' : 'userspace', + }, + }) + + return { + 'wloads': wloads, + 'confs': confs, + } + + def _test_signal(self, experiment, tasks, signal_name): + [task] = tasks + exp_util = self.get_expected_util_avg(experiment) + signal_mean = self.get_signal_mean(experiment, signal_name) + + error_margin = exp_util * (ERROR_MARGIN_PCT / 100.) + [freq] = experiment.conf['cpufreq']['freqs'].values() + + msg = 'Saw {} around {}, expected {} at freq {}'.format( + signal_name, signal_mean, exp_util, freq) + self.assertAlmostEqual(signal_mean, exp_util, delta=error_margin, + msg=msg) + + @experiment_test + def test_task_util_avg(self, experiment, tasks): + """ + Test that the mean of the util_avg signal matched the expected value + """ + return self._test_signal(experiment, tasks, 'util_avg') + + @experiment_test + def test_task_load_avg(self, experiment, tasks): + """ + Test that the mean of the load_avg signal matched the expected value + + Assuming that the system was under little stress (so the task was + RUNNING whenever it was RUNNABLE) and that the task was run with a + 'nice' value of 0, the load_avg should be similar to the util_avg. So, + this test does the same as test_task_util_avg but for load_avg. + """ + return self._test_signal(experiment, tasks, 'load_avg') + +class CpuInvarianceTest(LoadTrackingTest): + """ + Goal + ==== + Basic check for CPU invariant load tracking + + Detailed Description + ==================== + This test runs the same workload on each CPU in the system. The trace is + then examined to find the average activation length of the workload, which + is combined with the known period to estimate an expected mean value for + util_avg for each CPU. The util_avg value is extracted from scheduler trace + events and its mean is compared with the expected value (ignoring the first + 300ms so that the signal can stabilize). The test fails if the observed mean + is beyond a certain error margin from the expected one. load_avg is then + similarly compared with the expected util_avg mean, under the assumption + that load_avg should equal util_avg when system load is light. + + Expected Behaviour + ================== + Load tracking signals are scaled so that the workload results in roughly the + same util & load values regardless of compute power of the CPU used. + """ + + @classmethod + def _getExperimentsConf(cls, test_env): + # Run the 10% workload on one CPU in each capacity group + wloads = {} + for group in test_env.nrg_model.cpu_groups: + cpu = group[0] + wloads['cie_cpu{}'.format(cpu)] = cls.get_wload(cpu) + + conf = { + 'tag' : 'cie_conf', + 'flags' : ['ftrace', 'freeze_userspace'], + 'cpufreq' : {'governor' : 'performance'}, + } + + return { + 'wloads': wloads, + 'confs': [conf], + } + + def _test_signal(self, experiment, tasks, signal_name): + [task] = tasks + exp_util = self.get_expected_util_avg(experiment) + signal_mean = self.get_signal_mean(experiment, signal_name) + + error_margin = exp_util * (ERROR_MARGIN_PCT / 100.) + [cpu] = experiment.wload.cpus + + msg = 'Saw {} around {}, expected {} on cpu {}'.format( + signal_name, signal_mean, exp_util, cpu) + self.assertAlmostEqual(signal_mean, exp_util, delta=error_margin, + msg=msg) + + @experiment_test + def test_task_util_avg(self, experiment, tasks): + """ + Test that the mean of the util_avg signal matched the expected value + """ + return self._test_signal(experiment, tasks, 'util_avg') + +# nosetests sometimes tries to set up base test classes directly even though +# they don't have any test_* methods. That means it tries to call setUpClass on +# LoadTrackingTest, which doesn't work. To prevent that, we set __test__ = False +# in the base class and then override it in subclasses. Sorry. +for cls in LoadTrackingTest.__subclasses__(): + cls.__test__ = True diff --git a/tests/lisa/test_energy_model.py b/tests/lisa/test_energy_model.py new file mode 100644 index 0000000000000000000000000000000000000000..c61edc57400763e5004e7e892ef70b9304aef117 --- /dev/null +++ b/tests/lisa/test_energy_model.py @@ -0,0 +1,235 @@ +from collections import OrderedDict +import unittest +from unittest import TestCase + +from energy_model import (EnergyModel, ActiveState, EnergyModelCapacityError, + EnergyModelNode, EnergyModelRoot, PowerDomain) + +""" +A very basic test for the EnergyModel class. + +Just creates a simple instance of EnergyModel describing a hypothetical +big.LITTLE system and smoke-tests the methods and properties. +""" + +little_cluster_active_states = OrderedDict([ + (1000, ActiveState(power=10)), + (2000, ActiveState(power=20)), +]) + +little_cluster_idle_states = OrderedDict([ + ('WFI', 5), + ('cpu-sleep-0', 5), + ('cluster-sleep-0', 1), +]) + +little_cpu_active_states = OrderedDict([ + (1000, ActiveState(capacity=100, power=100)), + (1500, ActiveState(capacity=150, power=150)), + (2000, ActiveState(capacity=200, power=200)), +]) + +little_cpu_idle_states = OrderedDict([ + ('WFI', 5), + ('cpu-sleep-0', 0), + ('cluster-sleep-0', 0), +]) + +littles=[0, 1] +def little_cpu_node(cpu): + return EnergyModelNode(cpu=cpu, + active_states=little_cpu_active_states, + idle_states=little_cpu_idle_states) + +big_cluster_active_states = OrderedDict([ + (3000, ActiveState(power=30)), + (4000, ActiveState(power=40)), +]) + +big_cluster_idle_states = OrderedDict([ + ('WFI', 8), + ('cpu-sleep-0', 8), + ('cluster-sleep-0', 2), +]) + +big_cpu_active_states = OrderedDict([ + (3000, ActiveState(capacity=300, power=300)), + (4000, ActiveState(capacity=400, power=400)), +]) + +big_cpu_idle_states = OrderedDict([ + ('WFI', 9), + ('cpu-sleep-0', 0), + ('cluster-sleep-0', 0), +]) + +bigs=[2, 3] + +def big_cpu_node(cpu): + return EnergyModelNode(cpu=cpu, + active_states=big_cpu_active_states, + idle_states=big_cpu_idle_states) + +em = EnergyModel( + root_node=EnergyModelRoot(children=[ + EnergyModelNode(name='cluster_little', + active_states=little_cluster_active_states, + idle_states=little_cluster_idle_states, + children=[little_cpu_node(0), + little_cpu_node(1)]), + EnergyModelNode(name='cluster_big', + active_states=big_cluster_active_states, + idle_states=big_cluster_idle_states, + children=[big_cpu_node(2), + big_cpu_node(3)]) + ]), + root_power_domain=PowerDomain(idle_states=[], children=[ + PowerDomain( + idle_states=['cluster-sleep-0'], + children=[PowerDomain(idle_states=['WFI', 'cpu-sleep-0'], cpu=c) + for c in littles]), + PowerDomain( + idle_states=['cluster-sleep-0'], + children=[PowerDomain(idle_states=['WFI', 'cpu-sleep-0'], cpu=c) + for c in bigs]), + ]), + freq_domains=[littles, bigs] +) + +def set_of_tuples(lists): + """ + Helper to turn a list of lists into a set of tuples i.e. [[]] -> {()} + """ + +class TestOptimalPlacement(TestCase): + def assertPlacementListEqual(self, l1, l2): + """ + Assert that a pair of lists of lists contain the same lists in any order + """ + s1 = set([tuple(l) for l in l1]) + s2 = set([tuple(l) for l in l2]) + self.assertSetEqual(s1, s2) + + def test_single_small(self): + placements = em.get_optimal_placements({'task0': 1}) + self.assertPlacementListEqual(placements, [[1, 0, 0, 0], + [0, 1, 0, 0]]) + + def test_single_big(self): + placements = em.get_optimal_placements({'task0': 350}) + self.assertPlacementListEqual(placements, [[0, 0, 350, 0], + [0, 0, 0, 350]]) + + def test_packing(self): + tasks = {'task' + str(i) : 10 for i in range(5)} + placements = em.get_optimal_placements(tasks) + total_util = sum(tasks.values()) + self.assertPlacementListEqual(placements, [[total_util, 0, 0, 0], + [0, total_util, 0, 0]]) + + def test_overutilized_single(self): + self.assertRaises(EnergyModelCapacityError, + em.get_optimal_placements, {'task0' : 401}) + + def test_overutilized_many(self): + total_cap = 400 * 2 + 200 * 2 + task_size = 200 + tasks = {'task' + str(i): task_size + for i in range((total_cap / task_size) + 1)} + self.assertRaises(EnergyModelCapacityError, + em.get_optimal_placements, tasks) + +class TestBiggestCpus(TestCase): + def test_biggest_cpus(self): + self.assertEqual(em.biggest_cpus, [2, 3]) + +class TestLittlestCpus(TestCase): + def test_littlest_cpus(self): + self.assertEqual(em.littlest_cpus, [0, 1]) + +class TestMaxCap(TestCase): + def test_max_cap(self): + max_caps = [n.max_capacity for n in em.cpu_nodes] + self.assertEqual(max_caps, [200, 200, 400, 400]) + +class TestEnergyEst(TestCase): + def test_all_overutilized(self): + big_cpu = 400 * 2 + little_cpu = 200 * 2 + big_cluster = 40 + little_cluster = 20 + + total = big_cpu + little_cpu + big_cluster + little_cluster + + power = em.estimate_from_cpu_util([10000] * 4) + exp = { + 'power' : total, + (0): { 'active': little_cpu, 'idle': 0}, + (1): { 'active': little_cpu, 'idle': 0}, + (2): { 'active': big_cpu, 'idle': 0}, + (3): { 'active': big_cpu, 'idle': 0}, + (0, 1): { 'active': little_cluster, 'idle': 0}, + (2, 3): { 'active': big_cluster, 'idle': 0} + } + for k, v in power.iteritems(): + self.assertAlmostEqual(v, power[k]) + + def test_all_idle(self): + self.assertEqual(em.estimate_from_cpu_util([0, 0, 0, 0])['power'], + 0 * 4 # CPU power = 0 + + 2 # big cluster power + + 1) # LITTLE cluster power + + def test_one_little_half_lowest(self): + cpu0_util = 100 * 0.5 + self.assertEqual(em.estimate_from_cpu_util([cpu0_util, 0, 0, 0])['power'], + (0.5 * 100) # CPU0 active power + + (0.5 * 5) # CPU0 idle power + + (0.5 * 5) # LITTLE cluster idle power + + (0.5 * 10) # LITTLE cluster active power + + 2) # big cluster power + +class TestIdleStates(TestCase): + def test_zero_util_deepest(self): + self.assertEqual(em.guess_idle_states([0] * 4), ['cluster-sleep-0'] * 4) + + def test_single_cpu_used(self): + states = em.guess_idle_states([0, 0, 0, 1]) + self.assertEqual(states, ['cluster-sleep-0', 'cluster-sleep-0', + 'cpu-sleep-0', 'WFI']) + + states = em.guess_idle_states([0, 1, 0, 0]) + self.assertEqual(states, ['cpu-sleep-0', 'WFI', + 'cluster-sleep-0', 'cluster-sleep-0',]) + + def test_all_cpus_used(self): + states = em.guess_idle_states([1, 1, 1, 1]) + self.assertEqual(states, ['WFI'] * 4) + + def test_one_cpu_per_cluster(self): + states = em.guess_idle_states([0, 1, 0, 1]) + self.assertEqual(states, ['cpu-sleep-0', 'WFI'] * 2) + +class TestFreqs(TestCase): + + def test_zero_util_slowest(self): + self.assertEqual(em.guess_freqs([0] * 4), + [1000, 1000, 3000, 3000]) + + def test_high_util_fastest(self): + self.assertEqual(em.guess_freqs([100000] * 4), + [2000, 2000, 4000, 4000]) + + def test_freq_domains(self): + self.assertEqual(em.guess_freqs([0, 0, 0, 10000]), + [1000, 1000, 4000, 4000]) + + self.assertEqual(em.guess_freqs([0, 10000, 0, 10000]), + [2000, 2000, 4000, 4000]) + + self.assertEqual(em.guess_freqs([0, 10000, 0, 0]), + [2000, 2000, 3000, 3000]) + + def test_middle_freq(self): + self.assertEqual(em.guess_freqs([0, 110, 0, 0]), + [1500, 1500, 3000, 3000]) diff --git a/tests/sfreq/__init__.py b/tests/sfreq/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/stune/__init__.py b/tests/stune/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391