Cycle-oriented Dynamic Approximation: Architectural Framework to Meet Performance Requirements

Citation Author(s):
Yuya
Degawa
The University of Tokyo
Shota
Suzuki
The University of Tokyo
Junichiro
Kadomoto
The University of Tokyo
Hidetsugu
Irie
The University of Tokyo
Shuichi
Sakai
The University of Tokyo
Submitted by:
Yuya Degawa
Last updated:
Fri, 08/02/2024 - 23:08
DOI:
10.21227/e0rr-xq72
License:
0
0 ratings - Please login to submit your rating.

Abstract 

This is the artifact of the paper entitled "Cycle-oriented Dynamic Approximation: Architectural Framework to Meet Performance Requirements" in Computer Architecture Letters. The artifact contains the assembler compatible with dedicated instructions to approximation, the source code of each workload, the source code of the simulator "Onikiri 2'' with simulation configuration files, scripts to run Onikiri 2, and MATLAB scripts for generating the charts in Fig. 5 and Fig. 6. Fig. 5 in the paper shows the relationship between the expected number of executed cycles (x-axis) and the actual number (y-axis). Fig. 6. in the paper shows the relationship between the actual number of executed cycles and the normalized root-mean-square error.

Instructions: 

We have checked our artifact on the following environments:
* Step 1 to 2: Ubuntu 22.04
* Step 3 to 5: CentOS 7
* Step 6: MATLAB 2023b version 8 on Windows 10

# Step 1: Building RISC-V GNU Toolchain (including an assmebler compatible with CODAX and SIA)

```
$ sudo apt install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev
$ cd toolchain
$ git clone https://github.com/riscv-collab/riscv-gnu-toolchain.git
$ cd riscv-gnu-toolchain
$ git pull --tags
$ git checkout refs/tags/2021.09.21
$ git submodule set-url riscv-binutils "$(pwd)/../../repositories/riscv-binutils.git"
$ git config --global protocol.file.allow always
$ git submodule update --init --recursive -f
$ cd riscv-binutils
$ git checkout cal-artifact
$ cd ..
$ CFLAGS="-O2 -static" ./configure --prefix=$(pwd)/../install/ --with-arch=rv64g
$ make
$ cd ../..
```

# Step 2: Building workloads

```
$ cd workloads/raytracing-build-env/raytracing.github.io/build_cal_artifact
$ make # build raytracing
$ cd ../../../perfect-build-env/build/pa1/2d_convolution_rv64g
$ make # build 2dconv
$ cd ../../wami/debayer_rv64
$ make # build debayer
$ cd ../../../../../scripts
$ ./copy_workload_dirs.sh # copy binaries to an Onikiri2 directory
$ cd ..
```

Step 3: Building Onikiri2

```
$ cd simulator
$ git clone ../repositories/onikiri2.git/
$ cd onikiri2
$ git submodule update --init --recursive -f
$ cd project/gcc
$ make
$ cd ../..
```

Step 4: Running simulation

If you can use slurm, please execute the following commands.

```
$ mkdir result
$ cd tool/AutoRunTools/raytracing
$ sed -i -e 's@/Absolute/Path/to/the/Artifact/simulator/onikiri2/@/Foo/Bar/Baz/simulator/onikiri2/@' *xml # /Foo/Bar/Baz/simulator/ is the absoulute path to the artifact on your environment
$ ./enqueue.sh
$ cd ../2dconv
$ sed -i -e 's@/Absolute/Path/to/the/Artifact/simulator/onikiri2/@/Foo/Bar/Baz/simulator/onikiri2/@' *xml # /Foo/Bar/Baz/simulator/ is the absoulute path to the artifact on your environment
$ ./enqueue.sh
$ cd ../debayer
$ sed -i -e 's@/Absolute/Path/to/the/Artifact/simulator/onikiri2/@/Foo/Bar/Baz/simulator/onikiri2/@' *xml # /Foo/Bar/Baz/simulator/ is the absoulute path to the artifact on your environment
$ ./enqueue.sh
$ cd ..
```

When all the jobs are completed, please go to Step 5.

If you cannot use slurm, please execute the following commands.

```
$ mkdir result
$ cd tool/AutoRunTools/raytracing
$ sed -i -e 's@/Absolute/Path/to/the/Artifact/simulator/onikiri2/@/Foo/Bar/Baz/simulator/onikiri2/@' *xml # /Foo/Bar/Baz/simulator/ is the absoulute path to the artifact on your environment
$ ./mkscripts.sh
$ cd ../2dconv
$ sed -i -e 's@/Absolute/Path/to/the/Artifact/simulator/onikiri2/@/Foo/Bar/Baz/simulator/onikiri2/@' *xml # /Foo/Bar/Baz/simulator/ is the absoulute path to the artifact on your environment
$ ./mkscripts.sh
$ cd ../debayer
$ sed -i -e 's@/Absolute/Path/to/the/Artifact/simulator/onikiri2/@/Foo/Bar/Baz/simulator/onikiri2/@' *xml # /Foo/Bar/Baz/simulator/ is the absoulute path to the artifact on your environment
$ ./mkscripts.sh
$ cd ..
```

Script files are made in `result/[workload_name]/[number]/sh/exec/*.sh`.
Please execute them manually. Each of them does not depends on the others, thus you can execute them in parallel.
When all the execution are completed, please go to Step 5.

Step 5: Making statistics files

```
$ perl statistics.pl -c raytracing/cfg_raytracing_Image21_1.xml 001-863
$ perl summary.pl -craytracing/cfg_raytracing_Image21_1.xml 001-863 # Do not insert space after "-c".
$ perl statistics.pl -c raytracing/cfg_raytracing_Image19_1.xml 001-641
$ perl summary.pl -craytracing/cfg_raytracing_Image19_1.xml 001-641 # Do not insert space after "-c".
$ perl statistics.pl -c 2dconv/cfg_2dconv_1.xml 001-1217
$ perl summary.pl -c2dconv/cfg_2dconv_1.xml 001-1217 # Do not insert space after "-c".
$ perl statistics.pl -c debayer/cfg_debayer_1.xml 001-1009
$ perl summary.pl -cdebayer/cfg_debayer_1.xml 001-1009 # Do not insert space after "-c".
```

Step 6: Drawing charts

We prepared MATLAB script files to draw the charts in Fig. 5 and 6.
If you hane not been install Image Processing Toolbox to MATLAB, please install it.
Then, move to the directory containing the MATLAB script files.

```
$ cd ../../../../charts/
```

Open each file in MATLAB and run it.
You will get charts in Fig. 5 and 6.