The artifact zip file is available for download
here.
We have installed the LITMUSRT kernel on Ubuntu 16.04.
All our code are assumed to be kept at a location /home/common_shared/.
The directory structure is the following:
/home/common_shared/litmus/litmus-rt /home/common_shared/litmus/liblitmus /home/common_shared/PAStime/PMU/pmu-tools /home/common_shared/PAStime/pastime /home/common_shared/PAStime/darknet /home/common_shared/PAStime/video
In case this location is not accessible in your machine, then grep for common_shared and change those locations accordingly, because we had to use the absolute paths at some points in the code.
mkdir litmuscd litmusgit clone https://github.com/sohamm17/litmus-rt-amc-pastimemv litmus-rt-amc-pastime litmus-rt.config file.
Issues: The mouse and keyboard may not work in the newly installed kernel. Therefore, it is better to have an ethernet connection to
machine and connect over ssh.
git clone https://github.com/sohamm17/liblitmus-amc-pastime (i.e after cd litmus)mv liblitmus-amc-pastime liblitmuscd PAStimemkdir PMU && cd PMUgit clone https://github.com/andikleen/pmu-tools.gitcd pmu-toolscd jeventsmakesudo make installcd PAStimegit clone https://github.com/sohamm17/pastimecd pastimemakecd PAStimegit clone git@github.com:sohamm17/darknet-master.gitcd darknet-mastermake
Wherever you can, change it (/home/common_shared/) with the full path
that you are using. You have to change it in line number 635, 662 of the
darknet/examples/classifier.c to get the experiments to run.
Otherwise, segmentation fault will happen.
coco/ directory like converted, converted1, etc.
The benchmarking video of big buck bunny can be downloaded from:
http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_60fps_normal.mp4
It should be renamed to bunny_1080p_60fps.mp4
The video file md5sum: 7a7bc8ae38ccbd700e07977a9deb8cb7
There are some package dependencies for this video decoder to be compiled. Please install the following packages on Ubuntu:
sudo apt-get install ffmpeg libavcodec-dev libavformat-dev libswscale-ffmpeg3 libswscale-dev
cd PAStimemkdir videocd videounzip [location_of_the_file]/video_app.zipcd appwget http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_60fps_normal.mp4mv bbb_sunflower_1080p_60fps_normal.mp4 bunny_1080p_60fps.mp4makeAs per our paper, experiments have two phases in PAStime: Profiling phase and Execution phase. First, we will note the time to reach a checkpoint in the Profiling phase. Then we will use the data from the Profiling phase in the Execution phase.
This phase does not need the LITMUSRT kernel at all.
By default, the darknet application which is considered to be a
high-criticality application, is set up for the Profiling phase.
A checkpoint is placed at 0.4x location in the src/network.c file
and forward_network function. To get a checkpoint timing,
we run the code on multiple inputs and get an average of the
checkpoint timing. From our provided artifact zip file,
go inside the scripts folder and run the profiler.sh
file inside PAStime/darknet directory. Run the following commands:
cd PAStime/darknetsudo ./profiler.sh
You will file a file called timeinfo.h.
This file notes the checkpoint timing for different individual image inputs
which the darknet application classify.
You can use our script the following way to get a median of the checkpoint timing. Our script can be run the following way:
python profile.py -timefile timeinfo.h
The file mean_timeinfo.h will contain the resultant average
checkpoint timing. We will use this data in Execution phase.
For the Execution phase, we need to edit two files in darknet.
src/network.c:
Here, we need to comment the writeTime function call because it is for the Profiling phase. The call is made at line number 231. We need to uncomment the ANNOUNCE_TIME macro at line number 232. In addition, we
need to get the checkpoint timing from the Profiling phase (the average value that we just got above), and place it at line number 200, where the line current has something like:
#define CP_1_11 <some number>. This
Basically, the CP_1_11 macro is saying that it is a checkpoint at some function 1 and at some position identified by 11, which are random. In our automated LLVM compiler, these function numbers, and exact point where the macro call
is made, is decided by
the LLVM compiler infrastructure. As we are doing this manually, we can choose our own function call number, etc. We just need to be consistent with the Profiling phase and Execution phase.
examples/classifier.c: Here we need to uncomment the profiling bookkeeping code and enable the litmus-rt code. Go to line number 724. You will find comments there which tells which part of the code is for the Profiling phase
and which part is for the Execution phase. You need to comment the Profiling phase code and uncomment the Execution phase code. This part of the code is between 724 and 822 line numbers.
After this, recompile darknet with make.
We have automated the Execution phase with a script named amc_8_tasks_60_util.sh .
The script runs 4 HC tasks of darknet and 4 LC tasks of the video decoder, totalling a 60% utilization.
Look at the Results and Graphs section to know how to run the Execution phase in details.
Running the AMC scheduler:
To run only with AMC scheduling and not AMC-PAStime, you need to comment out the ANNOUNCE_TIME macro in the src/network.c file. Our kernel changes incorporate PAStime on top of AMC. Therefore, if we do not announce any time, then the
vanilla
AMC scheduler runs by default.
Download all our scripts by git clone git@github.com:sohamm17/pastime_scripts.git
and keep them in /home/common_shared/PAStime/
Results of different runs are taken with LITMUSRT feather-trace-tools.
We use the st-jobs-stats tool to collect how much utilization was achieved for
the HC and LC tasks.
We have modified the feather-trace-tools to show the average utilization of a
run for a particular task. It can be downloaded by:
git clone git@github.com:sohamm17/feather-trace-tools.git
You should clone it at /home/common_shared/litmus/
How to run the Execution phase:
/home/common_shared/PAStime/darknet/)./home/common_shared/litmus/feather-trace-tools st-trace-schedule my-trace ./amc_8_tasks_60_util.sh <LEN> or ./amc.sh <LEN>
LEN*8) is the number of seconds that the experiments will run (except two tasks).
LEN should be 25, to run the experiments for 180 seconds.
For 8 tasks, try with 15, the length of the run is around 90-120 seconds.
<enter> in T1 to finish tracing schedule by LITMUSRT./home/common_shared/litmus/feather-trace-tools/.
It should be named something like schedule_host=<your_computer_name>_scheduler=P-FP-Dyn_trace=my-trace_cpu=0.bincpu=1.bin in the formerly mentioned scheduling trace file.
How to get the utilization: You need to run the following script (which we have modified in our modified feather-trace-tools repo):
st-job-stats schedule_host=<YOUR_COMPUTER_NAME>_scheduler=P-FP-Dyn_trace=my-trace_cpu=*.bin
The above script will give the utilization of each tasks which were run with the execution script. We need to
take these numbers and place in a text file to be parsed by some python scripts to generate the graph.
Instructions to generate graphs are given below.
How to generate graphs:
From our script folder, the below scripts can be used to generate graphs.
The data CSV files are also included in the scripts repository:
python avg_util_two_amc.py
python util_amc_avg_lc_util.py
python task_amc_avg_util.py
Contact: For any help, please contact Soham at soham1 <at> bu DOT edu