Difference between revisions of "Simpoints"

From gem5
Jump to: navigation, search
m (Replacement of fastmem as of patch https://gem5-review.googlesource.com/c/public/gem5/+/12419)
 
(6 intermediate revisions by one other user not shown)
Line 1: Line 1:
<To be updated>
 
 
 
Steps to profile, generate, and use SimPoints with gem5:
 
Steps to profile, generate, and use SimPoints with gem5:
  
1. To profile workload and generate SimPoint BBV file, use the following option:
+
== Profiling and Generating BBV ==
  
--simpoint-profile [--simpoint-interval <interval length>]
+
To profile a workload and generate a SimPoint BBV file, use the following command:
  
 +
<pre>
 +
% build/ARM/gem5.opt <base options> configs/example/fs.py --simpoint-profile [--simpoint-interval <interval length>] <rest of fs.py options>
 +
</pre>
  
Requires single Atomic CPU and fastmem.
+
This will generate a SimPoint Basic Block Vector file (named simpoint.bb.gz)  in the gem5 run folder.
 +
SimPoint profiling should be run with a single AtomicSimpleCPU configuration. Multicore simulation is not supported.
 
<interval length> is in number of instructions. Default interval length is 10M instructions.
 
<interval length> is in number of instructions. Default interval length is 10M instructions.
  
2. Generate SimPoint analysis using SimPoint 3.2 from UCSD.
+
== SimPoint Analysis ==
(SimPoint 3.2 not included with this flow.)
+
 
 +
Generate SimPoint analysis using SimPoint 3.2 from UCSD. See http://cseweb.ucsd.edu/~calder/simpoint/index.htm for details.
 +
(SimPoint 3.2 not included in gem5 repository.)
 +
 
 +
A sample command to generate the SimPoint analysis based on the BBV file is as follows:
 +
 
 +
<pre>
 +
% simpoint -loadFVFile simpoint.bb.gz -maxK 30 -saveSimpoints <simpoint_file> -saveSimpointWeights <weight_file> -inputVectorsGzipped
 +
</pre>
 +
 
 +
The gem5 flow currently does not support variable-length intervals.
 +
 
 +
== Taking SimPoint Checkpoints in gem5 ==
  
3. To take gem5 checkpoints based on SimPoint analysis, use the following option:
+
To take gem5 checkpoints based on SimPoint analysis, use the following command:
  
--take-simpoint-checkpoint=<simpoint file path>,<weight file path>,<interval length>,<warmup length>
+
<pre>
 +
% build/ARM/gem5.opt <base options> configs/example/fs.py --take-simpoint-checkpoint=<simpoint file path>,<weight file path>,<interval length>,<warmup length> <rest of fs.py options>
 +
</pre>
  
<simpoint file> and <weight file> is generated by SimPoint analysis tool from UCSD. SimPoint 3.2 format expected. <interval length> and <warmup length> are in number of instructions.
+
<simpoint file> and <weight file> is generated by the SimPoint analysis step above. <interval length> and <warmup length> are in number of instructions.
 +
gem5 checkpoints will be generated <warmup length> instructions before the designated SimPoint starting points.
  
4. To resume from gem5 SimPoint checkpoints, use the following option:
+
== Resuming from gem5 SimPoint Checkpoints ==
  
--restore-simpoint-checkpoint -r <N> --checkpoint-dir <simpoint checkpoint path>
+
To resume from gem5 SimPoint checkpoints, use the following command:
 +
 
 +
<pre>
 +
% build/ARM/gem5.opt <base options> configs/example/fs.py --restore-simpoint-checkpoint -r <N> --checkpoint-dir <simpoint checkpoint path> <rest of fs.py options>
 +
</pre>
  
 
<N> is (SimPoint index + 1). E.g., "-r 1" will resume from SimPoint #0.
 
<N> is (SimPoint index + 1). E.g., "-r 1" will resume from SimPoint #0.
 +
 +
This command will resume from a single specified SimPoint checkpoint. After simulating the warmup period (automatically recognized from the checkpoint folder name), gem5 statistics will be dumped and reset. Subsequently, after simulating the actual SimPoint, gem5 will automatically terminate. The simulations for all other SimPoints should be run individually. To project the full execution, the gem5 statistics from individual SimPoints must be weighted accordingly. Remember to use the second gem5 statistics window (not the one from the warmup period).
 +
 +
== Questions / Feedback ==
 +
 +
For questions or feedback on this flow, please contact Dam Sunwoo (dam.sunwoo@arm.com)

Latest revision as of 08:15, 24 September 2018

Steps to profile, generate, and use SimPoints with gem5:

Profiling and Generating BBV

To profile a workload and generate a SimPoint BBV file, use the following command:

% build/ARM/gem5.opt <base options> configs/example/fs.py --simpoint-profile [--simpoint-interval <interval length>] <rest of fs.py options>

This will generate a SimPoint Basic Block Vector file (named simpoint.bb.gz) in the gem5 run folder. SimPoint profiling should be run with a single AtomicSimpleCPU configuration. Multicore simulation is not supported. <interval length> is in number of instructions. Default interval length is 10M instructions.

SimPoint Analysis

Generate SimPoint analysis using SimPoint 3.2 from UCSD. See http://cseweb.ucsd.edu/~calder/simpoint/index.htm for details. (SimPoint 3.2 not included in gem5 repository.)

A sample command to generate the SimPoint analysis based on the BBV file is as follows:

% simpoint -loadFVFile simpoint.bb.gz -maxK 30 -saveSimpoints <simpoint_file> -saveSimpointWeights <weight_file> -inputVectorsGzipped

The gem5 flow currently does not support variable-length intervals.

Taking SimPoint Checkpoints in gem5

To take gem5 checkpoints based on SimPoint analysis, use the following command:

% build/ARM/gem5.opt <base options> configs/example/fs.py --take-simpoint-checkpoint=<simpoint file path>,<weight file path>,<interval length>,<warmup length> <rest of fs.py options>

<simpoint file> and <weight file> is generated by the SimPoint analysis step above. <interval length> and <warmup length> are in number of instructions. gem5 checkpoints will be generated <warmup length> instructions before the designated SimPoint starting points.

Resuming from gem5 SimPoint Checkpoints

To resume from gem5 SimPoint checkpoints, use the following command:

% build/ARM/gem5.opt <base options> configs/example/fs.py --restore-simpoint-checkpoint -r <N> --checkpoint-dir <simpoint checkpoint path> <rest of fs.py options>

<N> is (SimPoint index + 1). E.g., "-r 1" will resume from SimPoint #0.

This command will resume from a single specified SimPoint checkpoint. After simulating the warmup period (automatically recognized from the checkpoint folder name), gem5 statistics will be dumped and reset. Subsequently, after simulating the actual SimPoint, gem5 will automatically terminate. The simulations for all other SimPoints should be run individually. To project the full execution, the gem5 statistics from individual SimPoints must be weighted accordingly. Remember to use the second gem5 statistics window (not the one from the warmup period).

Questions / Feedback

For questions or feedback on this flow, please contact Dam Sunwoo (dam.sunwoo@arm.com)