Skip to content

Commit

Permalink
corrected inconsistencies and added parsing and plotting script for a…
Browse files Browse the repository at this point in the history
…ll figures except figure 10
  • Loading branch information
Anish-Saxena committed Aug 5, 2022
1 parent 5f3872f commit 686fc4e
Show file tree
Hide file tree
Showing 45 changed files with 1,961 additions and 5,863 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Here you will recreate results in Figure 3, 6, 7, 9, 10, and 11, by executing th
- Please source the paths as: `source scripts/env.sh` after modifying the file.
- **Test Creating and Running Checkpoints:** For each program the we need to create a checkpoint of the program state after the initialization phase of the program is complete, which will be used to run the simulations with different Rowhammer defense configurations.
- To test the checkpointing process, run `cd scripts; ./ckptscript_test.sh perlbench 4 2017;`: this will create a checkpoint after 1Mn instructions (should complete in a couple of minutes).
* In case the `ckptscript_test.sh` fails with the error `$SPEC_PATH/SPEC2017_inst/benchspec/CPU/500.perlbench_r/run/run_base_refrate_<config-name>-m64.<run-number>/perlbench_r_base.<config-name>-m64: No such file or directory` (or similar error message), it indicates the script is unable to find the run-directory for perlbench. Please follow the steps outlined in [README_SPEC_INSTALLATION.md](./README_SPEC_INSTALLATION.md) to ensure the run-directories are properly set up for all the SPEC-benchmarks.
* In case the `ckptscript_test.sh` fails with the error `$SPEC17_PATH/SPEC2017_inst/benchspec/CPU/500.perlbench_r/run/run_base_refrate_<config-name>-m64.<run-number>/perlbench_r_base.<config-name>-m64: No such file or directory` (or similar error message), it indicates the script is unable to find the run-directory for perlbench. Please follow the steps outlined in [README_SPEC_INSTALLATION.md](./README_SPEC_INSTALLATION.md) to ensure the run-directories are properly set up for all the SPEC-benchmarks.
- **Run All Experiments:** for all the benchmarks, run `cd scripts; ./run_all.sh`. This will run the following scripts:
- `create_checkpoints.sh` - This creates checkpoints for single-core and multi-core benchmarks.
* **Create Checkpoint:** For each benchmark, the checkpoints will be created using `./ckptscript.sh <BENCHMARK> <NUM-CORES> <SPEC-VERSION>`.
Expand All @@ -43,7 +43,9 @@ Here you will recreate results in Figure 3, 6, 7, 9, 10, and 11, by executing th
- `SPEC-VERSION`: Fixed to be 2017.
- `RH-DEFENSE-PARAMETERS`: `--rh_defense` enables the defense, `--rh_mitigation=RQ` selects AQUA as the defense (RRS in place of RQ selects RRS defense), and `--rh_actual_threshold=1000` specifies 1K as the rowhammer threshold. Additional runtime parameters like FPT-cache size, quarantine region size, etc. are present in `run_<aqua-or-rrs>_experiments.sh` scripts. In absence of `--rh_defense` parameter, the baseline configuration is run.
- Each configuration is simulated for 250Mn instructions. This takes 8-24 hours per benchmark, per configuration. Benchmarks in 2-3 configurations are run in parallel for a total of up to `MAX_GEM5_PARALLEL_RUNS` (defined in `scripts.env.sh`) parallel Gem5 runs at a time.
- **Parse the results:** **TODO**
- **Parse the results:** for Figures 3, 6, 7, 9, and 11 (Figure 10 remains **TODO**). Run the following script:
- `cd stats_scripts; ./collect_all_data.sh` This will parse the gem5 stat files and collect the relevant stats for all figures mentioned above. The data is stored in `data/` directory inside `stats_scripts` and will be used by plotting scripts. The script in turn calls `Figure_*.sh` which collect data required to plot that particular figure.
- Note that we will supply the script to collect data for Figure 10 by end of this week. We seem to have lost that script during refactoring the code. All other scripts will work as intended.
<!-- -`cd stats_scripts; ./data_perf.sh`. This will compare the normalized performance (using weighted speedup metric) vs baseline.
- The normalized peformance results will be stored in `stats_scripts/data/perf.stat`.
- Script to collect the LLC misses-per-thousand-instructions (MPKI) for each of the schemes is also available in `stats_scripts/data_mpki.sh`.
Expand All @@ -55,7 +57,8 @@ Here you will recreate results in Figure 3, 6, 7, 9, 10, and 11, by executing th
* Experiments are run using the script `./runscript.sh`
* Results for normalized Perf vs. EncrLat can be generated using `cd stats_scripts; ./data_EncrLat.sh`.
* Results are stored in `stats_scripts/data/perf.EncLat.stat`. -->
- **Visualize the results:** **TODO**
- **Visualize the results:** `cd graph_scripts; jupyter-notebook aqua_MICRO22_plots.ipynb` This will open a Jupyter Notebook session in the browser and will enable you to plot all the graphs. Remember to run the stats script command above before plotting the results.
- In the notebook, select the code for a given figure and click on Run either from the menu or within the top left corner of the selected cell.
- **Note on Simulation Time:** Running all experiments takes almost 3-4 days on a system with 72 cores. Here is the order in which to reduce the simulation costs, if required:
- To shorten experiment run time, you may reduce instruction count (`MAX_INSTS`) in `runscript.sh`to 100Mn. This reduces the simulation time to 3.5 days with 72 cores.
- You may skip the scalability configuration for RRS (Figure 3) by commenting out the configurations in `RRS scalability configs` section in `run_rrs_experiments.sh`. This further reduces the simulation time to 3 days at the expense of Figure 3.
Expand Down
2 changes: 1 addition & 1 deletion README_SPEC_INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ After installing SPEC-2017 on the disk, for running the SPECint-CPU2017 benchmar
- We **strongly recommend** changing the compiler optimization for microarchitecture and setting it to `athlon64` to ensure gem5 doesn't encounter unknown instructions. Specifically, we used `OPTIMIZE = -g -O3 -march=athlon64 -fno-unsafe-math-optimizations -fno-tree-loop-vectorize`.
- Run the following command: `runcpu --config=gem5_se_test --action=build 500.perlbench_r`. This command should build a benchmark (if it does not exist), create run directories and copy the executable & inputs to run folder and then run the benchmark.
- A helpful resource for understanding this process can be the [SPEC2017 installation page](https://www.spec.org/cpu2017/Docs/install-guide-unix.html), which outlines the steps to install and test SPEC benchmarks.
- Check `$SPEC_PATH//SPEC2017_inst/benchspec/CPU/500.perlbench_r/run/`: there should be a run folder (like `run_base_refrate_gem5_se-m64.0000`) containing the executable and input files (e.g. `checkspam.pl`) for the benchmark.
- Check `$SPEC17_PATH//SPEC2017_inst/benchspec/CPU/500.perlbench_r/run/`: there should be a run folder (like `run_base_refrate_gem5_se-m64.0000`) containing the executable and input files (e.g. `checkspam.pl`) for the benchmark.
- The exact name of the run-folder might be different based on your OS/CPU/compiler. If so, please follow the steps:
* Open `spec17_benchmarks.py` file in `gem5/configs/example` directory.
* Update the `RUN_DIR_postfix` variable as with run-folder (like `run_base_refrate_gem5_se-m64.0000`) and `x86_suffix` variable with executable binary postfix (like `_r_base.gem5_se-m64`).
Expand Down
12 changes: 6 additions & 6 deletions gem5/scripts/ckptscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ then
else
echo "GEM5_PATH is set to '$GEM5_PATH'";
fi
#Need to export SPEC_PATH
if [ -z ${SPEC_PATH+x} ];
#Need to export SPEC17_PATH
if [ -z ${SPEC17_PATH+x} ];
then
echo "SPEC_PATH is unset";
echo "SPEC17_PATH is unset";
exit
else
echo "SPEC_PATH is set to '$SPEC_PATH'";
echo "SPEC17_PATH is set to '$SPEC17_PATH'";
fi
#Need to export CKPT_PATH
if [ -z ${CKPT_PATH+x} ];
Expand Down Expand Up @@ -70,7 +70,7 @@ echo "Command line:" | tee $SCRIPT_OUT
echo "$0 $*" | tee -a $SCRIPT_OUT
echo "================= Hardcoded directories ==================" | tee -a $SCRIPT_OUT
echo "GEM5_PATH: $GEM5_PATH" | tee -a $SCRIPT_OUT
echo "SPEC_PATH: $SPEC_PATH" | tee -a $SCRIPT_OUT
echo "SPEC17_PATH: $SPEC17_PATH" | tee -a $SCRIPT_OUT
echo "==================== Script inputs =======================" | tee -a $SCRIPT_OUT
echo "BENCHMARK: $BENCHMARK" | tee -a $SCRIPT_OUT
echo "OUTPUT_DIR: $OUTPUT_DIR" | tee -a $SCRIPT_OUT
Expand All @@ -88,7 +88,7 @@ echo "" | tee -a $SCRIPT_OUT
echo "" | tee -a $SCRIPT_OUT

# Launch Gem5:
$GEM5_PATH/build/X86/gem5_checkpoint.opt \
$GEM5_PATH/build/X86/gem5.opt \
--outdir=$OUTPUT_DIR \
$GEM5_PATH/configs/example/se_rq_spec_config_multicore.py \
--redirects /lib64=/home/gattaca4/gururaj/LOCAL_LIB/python/anaconda3/lib \
Expand Down
12 changes: 6 additions & 6 deletions gem5/scripts/ckptscript_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ then
else
echo "GEM5_PATH is set to '$GEM5_PATH'";
fi
#Need to export SPEC_PATH
if [ -z ${SPEC_PATH+x} ];
#Need to export SPEC17_PATH
if [ -z ${SPEC17_PATH+x} ];
then
echo "SPEC_PATH is unset";
echo "SPEC17_PATH is unset";
exit
else
echo "SPEC_PATH is set to '$SPEC_PATH'";
echo "SPEC17_PATH is set to '$SPEC17_PATH'";
fi
#Need to export CKPT_PATH
if [ -z ${CKPT_PATH+x} ];
Expand Down Expand Up @@ -70,7 +70,7 @@ echo "Command line:" | tee $SCRIPT_OUT
echo "$0 $*" | tee -a $SCRIPT_OUT
echo "================= Hardcoded directories ==================" | tee -a $SCRIPT_OUT
echo "GEM5_PATH: $GEM5_PATH" | tee -a $SCRIPT_OUT
echo "SPEC_PATH: $SPEC_PATH" | tee -a $SCRIPT_OUT
echo "SPEC17_PATH: $SPEC17_PATH" | tee -a $SCRIPT_OUT
echo "==================== Script inputs =======================" | tee -a $SCRIPT_OUT
echo "BENCHMARK: $BENCHMARK" | tee -a $SCRIPT_OUT
echo "OUTPUT_DIR: $OUTPUT_DIR" | tee -a $SCRIPT_OUT
Expand All @@ -88,7 +88,7 @@ echo "" | tee -a $SCRIPT_OUT
echo "" | tee -a $SCRIPT_OUT

# Launch Gem5:
$GEM5_PATH/build/X86/gem5_checkpoint.opt \
$GEM5_PATH/build/X86/gem5.opt \
--outdir=$OUTPUT_DIR \
$GEM5_PATH/configs/example/se_rq_spec_config_multicore.py \
--redirects /lib64=/home/gattaca4/gururaj/LOCAL_LIB/python/anaconda3/lib \
Expand Down
1,192 changes: 1,192 additions & 0 deletions gem5/scripts/graph_scripts/aqua_MICRO22_plots.ipynb

Large diffs are not rendered by default.

Binary file added gem5/scripts/graph_scripts/hitloc_aqua_dram.pdf
Binary file not shown.
Binary file added gem5/scripts/graph_scripts/migrations_aqua.pdf
Binary file not shown.
Binary file added gem5/scripts/graph_scripts/mitigations_aqua.pdf
Binary file not shown.
Binary file added gem5/scripts/graph_scripts/perf_aqua.pdf
Binary file not shown.
Binary file added gem5/scripts/graph_scripts/perf_aqua_dram.pdf
Binary file not shown.
Binary file added gem5/scripts/graph_scripts/rrs_scalability.pdf
Binary file not shown.
Binary file added gem5/scripts/graph_scripts/sensitivity_rth.pdf
Binary file not shown.
Loading

0 comments on commit 686fc4e

Please sign in to comment.