# HuoYan **Repository Path**: YingkunZhou/HuoYan ## Basic Information - **Project Name**: HuoYan - **Description**: HuoYan 火眼金睛 Micro benchmark as the replacement of dhrystone and coremark with each program very short runtime duration. Therefore, enable agile evaluating performance of compiler and micro-architectur - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 1 - **Created**: 2023-01-30 - **Last Updated**: 2024-09-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # HuoYan 火眼金睛 Micro benchmark as the replacement of dhrystone and coremark with each program very short runtime duration. Therefore, enable agile evaluating performance of compiler and micro-architecture. ## how to use (quick start) ```bash $ cd jinjing1 $ g++ -g -O2 --static K2.cpp $ ./a.out < K/secret/test01.in > out ``` I've already provided `run.sh` template bash script in the root of the repo which you can utilize. ### structure of files ```bash . ├── jinjing1 │   ├── A │   │   ├── sample │   │   │   ├── sample01.ans │   │   │   └── sample01.in │   │   └── secret │   │   ├── large01.ans │   │   ├── large01.in │   │   ├── large02.ans │   │   ├── large02.in │   │   ├── large03.ans │   │   ├── large03.in │   │   ├── limits01.ans │   │   ├── limits01.in │   │   ├── limits02.ans │   │   ├── limits02.in │   │   ├── one01.ans │   │   ├── one01.in │   │   ├── primes01.ans │   │   └── primes01.in │   ├── A0.cpp │   ├── A1.cpp │   ├── B │   ├── B0.cpp │   ├── B1.cpp │   ├── B2.cpp │   ├── B3.cpp │   ├── B4.cpp │   ├── B5.cpp ... ... ``` eg. `A0.cpp` and `A1.cpp` both start with `A` which mean that they are the different solutions for the same problem. Meanwhile, the input data set of problem are in corresponding directory named `A`. In `A` folder, you will see two subdirectories -- `sample` and `secret`. The files in them are suffixed in the same way: - `*.in` represent input data files - `*.ans` represent output answer (in micro-architecture evaluation, you will always check correctness first) ### Support Apple M1 MacOS running Refer to the website [Counting cycles and instructions on the Apple M1 processor](https://lemire.me/blog/2021/03/24/counting-cycles-and-instructions-on-the-apple-m1-processor/) > You should be mindful that the ‘number of instructions’ is an ill-defined measure. Processors can fuse or split instructions, and they can decide to count or not the number of speculative instructions. In my particular benchmark, there are few mispredicted branches so that the difference between speculative instructions and actually retired instructions is not important. > To my knowledge, none of this performance-counter access is documented by Apple. Thus my code should be viewed with suspicion. It is possible that these numbers are not what I take them to be. However, the numbers are generally credible. compile it (eg. `A0.cpp`) ```bash cd jinjing1 clang++ -std=c++17 -O2 -fno-tree-vectorize -Wall -Wextra ../main.cpp ../m1cycles.cpp A0.cpp ``` Finally, run it ```bash $ sudo ./a.out < A/secret/limits01.in > out 100256444 cycles/float (+/- 0.0 %) 400131844 instructions/float (+/- 0.0 %) # 3.99 insn per cycle 100029363 branches/float (+/- 0.0 %) 1118 branches-misses/float (+/- 0.0 %) # 0.00 % of all branch ``` ## TODO list - [ ] You can run the `HuoYan` benchmark in Linux environment out of the box. But unfortunately, the benchmark currently does not support bare-metal running, which means someone should port I/O part into bare-metal environment (wouldn't be a difficult task). - [x] ~~There is no auto-judge and automatic assessment system now.~~ Now it is solved! see [fireye](fireye.md) framework for more details. - [ ] The soundness of `HuoYan` benchmark is still under consideration. Welcome to offer new insight about this under developing benchmark.