-
Notifications
You must be signed in to change notification settings - Fork 13
Quick Start
You can learn the following topics from this page:
- How to install the LegoSim.
- How to execute benchmarks provided in the LegoSim.
1. Clone the repository from GitHub and enter the downloaded repository.
git clone https://github.com/FCAS-SCUT/Chiplet_Heterogeneous_newVersion.git
cd Chiplet_Heterogeneous_newVersion
The following commands are executed under the root folder of the repository. Crossing this wiki, the root of the repository is referenced as $SIMULATOR_ROOT.
2. Initialize and update submodules. third-parity repositories such as SniperSim and GPGPUSim will be downloaded and updated.
git submodule init
git submodule update
3. Setup environment.
source setup_env.sh
If the operation succeeds, setup_environment succeeded is printed to the terminal.
4. Apply modifications to SniperSim and GPGPUSim. Skipping Step 4, the simulator can still execute benchmarks, but no interactions between chiplets are performed.
./apply_path.sh
5. Compile SniperSim.
cd snipersim
make -j4
6. Compile GPGPUSim. Installation of GPGPUSim requires below conditions:
- CUDA environment is correctly installed and configured. Imported GPGPUSim supports CUDA versions from 4.0 to 11.0. See README within gpgpu-sim for details.
- GPGPUSim has a limitation on the compiler version. According to our experiment, GCC7 is recommended.
cd gpgpu-sim
make -j4
7. Compile Popnet.
cd popnet
mkdir build
cd build
cmake ..
make -j4
8. Compile the LegoSim. The LegoSim is managed by CMake.
cd interchiplet
mkdir build
cd build
cmake ..
make
If the operation succeeds, interchiplet can be found under interchiplet/bin, while libinterchiplet_c.a and libinterchiplet_cu.a can be found under interchiplet/lib.
To check whether the LegoSim is installed and configured correctly, you can execute the demo benchmark matmul.
1. Setup environment.
source setup_env.sh
If the operation succeeds, setup_environment succeeded is printed to the terminal.
2. Compile execution files for benchmark.
cd benchmark/matmul
make
If operation successes, matmul_c and matmul_cu can be found under benchmark/matmul/bin.
3. Execute simulation.
$SIMULATOR_ROOT/interchiplet/bin/interchiplet ./matmul.yml
The matmul benchmark starts 4 processes, which are 1 CPU process and 3 GPGPU processes.
If the benchmark executes correctly, you will find it experiences two rounds of simulation. Also Following information can be found on your terminal.
[INTERCMD] Load benchmark configuration from ./matmul.yml.
[COMMBRIDGE] *** Round 1 Phase 1 ***
...
[COMMBRIDGE] Benchmark elapses 5772038 cycle.
[COMMBRIDGE] *** Round 1 Phase 2 ***
...
[COMMBRIDGE] Round 1 elapses 0d 0h 0m 20s.
[COMMBRIDGE] *** Round 2 Phase 1 ***
...
[COMMBRIDGE] Benchmark elapses 5772195 cycle.
[COMMBRIDGE] Difference related to pervious round is 0.00271994%.
[COMMBRIDGE] Quit simulation because simulation cycle has converged.
[COMMBRIDGE] *** End of Simulation ***
[COMMBRIDGE] Benchmark elapses 5772195 cycle.
[COMMBRIDGE] Simulation elapsed 0d 0h 0m 38s.
The cycle elapsed by benchmark is about 5.77M cycle with a minor error on different platforms. The time elapsed by the simulator depends on the performance of the host machines, so it varies across different platforms. 4. Clear executable files and output files.
make clean
The user interface of the LegoSim is interchiplet that is provided in $SIMULATOR_ROOT/interchiplet/bin. The command line format of interchiplet is as below:
interchiplet <bench>.yml [--cwd <string>] [-t|--timeout <int>] [-e|--error <float>] [-h]
Command line options:
-
<bench>.ymlspecifies the configuration file of the benchmark. This option is mandatory. -
--cwd <string>specifies the execution directory of the simulation. This option is optional. If not provided, the simulation is executed in the current working directory. -
-t <int>or--timeout <int>specifies the time-out threshold of simulation, in units of simulation rounds. No matter whether the cycle elapsed by the benchmark has converged, the simulation will quit after a certain account of simulation rounds specified by this option. This option is optional. A default value of 5 is used if not provided. -
e <float>or--error <float>specifies the convergence condition of the cycle elapsed by the benchmark. If the error of cycle elapsed by the benchmark between simulation rounds is lower than the specified value, the simulation will stop. This option is optional. A default value of 0.05 is used if not provided.
For example,
$SIMULATOR_ROOT/interchiplet/bin/interchiplet $SIMULATOR_ROOT/benchmark/matmul/matmul.yml
The above command starts the simulation of matmul in the current directory. The simulation will last at most 5 iterations and quit if the error of cycle elapsed by benchmark is lower than 0.5%.