Coder Social home page Coder Social logo

llnl / faros Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 4.0 65 KB

FAROS: A Framework for Benchmarking and Analysis of Compiler Optimization

License: Apache License 2.0

Python 81.98% CSS 7.29% Makefile 1.20% C 8.13% CMake 0.71% C++ 0.70%
benchmarking compiler-optimization openmp benchmark

faros's Introduction

FAROS: A Framework for Benchmarking and Analysis of Compiler Optimization

FAROS is an extensible framework to automate and structure the analysis of compiler optimizations of OpenMP programs. FAROS provides a generic configuration interface to profile and analyze OpenMP applications with their native build configurations.

Description and usage

This repo contains a benchmark harness to fetch, build, and run programs with different compilation options for analyzing the impact of compilation on performance. The usecase is contrasting OpenMP compilation with its serial elision to understand performance differences due to different compilation.

Harness script

The harness script in python, named benchmark.py, takes as input a YAML configuration file and a set of options to build and run programs described in that configuration. You can see below the help output describing possible options. The configuration file input is set with the -i, --input argument. There are three different actions the harness performs:

  1. fetch sources, with the option -f, --fetch, fetches the program sources from the specified repositories;
  2. build programs, with the option -b, --build, builds the selected program using the specified compilation options in the configuration, also fetching if needed;
  3. generate reports, with the option -g, --generate, generates compilation reports by combining optimization remarks for different compilation configurations, creating remark diff files between them, from all the sources of an application to a single file;
  4. run tests, with the option -r,--run and a following argument on how many repetitions to perform, that runs the executable with the specified input, repeating up to the number of repetitions set.

The flags can be individually set doing multiple runs of the harness, or combined to perform multiple actions in a single run -- fetching takes precedence over building, building over generating reports and running. The user select the list of programs to operate usin -p,--programs followed by individual program names or the keyword all for all the programs specified in the configuration input. Alternatively, the user may select the list of programs by provide a tag list with -t,--tags that matches tags for each program specified in the configuration. Also, the harness has a dry run option, -d,--dry-run, that prints what actions would be performed without actually performing them.

Below is the output when running help, -h, --help on the harness script:

Benchmark and analyze programs compiled with different compilation options.

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        configuration YAML input file for programs
  -f, --fetch           fetch program repos (without building)
  -b, --build           build programs (will fetch too)
  -r RUN, --run RUN     run <repetitions>
  -g, --generate        generate compilation reports
  -p PROGRAMS [PROGRAMS ...], --programs PROGRAMS [PROGRAMS ...]
                        programs to run from the config
  -t TAGS [TAGS ...], --tags TAGS [TAGS ...]
                        tagged program to use from the config
  -s, --stats           show run statistics
  -d, --dry-run         enable dry run

The harness creates four extra directories for its operation when building and running:

  1. the directory repos to download the benchmark application specified in the configuration;
  2. the directory bin to store the generated executable from building to run them;
  3. the directory reports, where it store compilation reports, including optimization remarks;
  4. the directory results to store profiling results, which contain execution times from running different built configurations and inputs.

YAML configuration input

Configuring YAML creates is a hierarchy of keys for each program to include that prescribe actions for the harness script. We describe those keys here. For a working example please see config.yaml in the repo, which iincludes configuration for 39 HPC programs including proxy/mini applications, NAS and Rodinia kernels, and the open-source large application GROMACS. The root of the hierarchy is a user-chosen, descriptive name per program configuration. The harness creates a sub-directory matching the name of this root key under bin to store executables

The key fetch contains the shell command to fetch the application code, for example cloning from a GitHub repo. Note that the fetching command can include also a patching file, if needed, provided by the user. In this repo we provide patch files for programs in config.yaml undr the directory patches. For example, for some programs, we apply a patch to guard calls to OpenMP runtime functions using the standard approach of enabling those calls within #ifdef OPENMP ... endif preprocessor directives.

The key tags sets a list of user-defined tags which can be used by the harness to include programs when performing its operation.

The key build_dir specifies the directory to build the application, so harness changes to this directory to execute the build commands specified under the key build. There is a different sub-key for each different compilation specification, denoted by a user-provided identifier. The harness creates different sub-directories under bin/<program>for each different compilation configurations

The key copy specifies a list of files or directories that the harness copies out to those sub-directories. The list contains the executable file and possibly any input files needed for executing, if the user desires to have self-contained execution in bin by avoiding referring to input files in the directory repos -- this is useful for relocating the directory bins without needing to copy over repos.

Further, the key run specifies the command to execute, which is typically the executable binary of the application, prepended with any environment variables to set.

Moreover, the key input specifies the input arguments for the application in the run command.

The key measure specifies a regular expression to match in the application's executable output to capture the desired measure of performance, such as execution time or some other Figure of Merit (FoM). If the value of the key measure is empty, the harness measures end-to-end, wall clock execution time from launching the application to its end, using python's time module.

Lastly, the key clean specifies the commands that harness executes to clean the repo for building a different compilation configuration.

Contributing

To contribute to this repo please send a pull request on the develop branch of this repo.

Authors

This code was created by Giorgis Georgakoudis (LLNL), [email protected], assisted with technical design input from Ignacio Laguna (LLNL), Tom Scogland, and Johannes Doerfert (ANL).

Citing FAROS

Please cite the following paper:

License

This repo is distributed under the terms of the Apache License (Version 2.0) with LLVM exceptions. Other software that is part of this repository may be under a different license, documented by the file LICENSE in its sub-directory.

All new contributions to this repo must be under the Apache License (Version 2.0) with LLVM exceptions.

See files LICENSE and NOTICE for more information.

SPDX License Identifier: "Apache-2.0 WITH LLVM-exception"

LLNL-CODE-813267

faros's People

Contributors

ggeorgakoudis avatar ilagunap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

faros's Issues

Find file None failed! with LULESH in Lassen

I get the following errors in Lassen:

[laguna@lassen708 FAROS]$ ./harness.py -i config.yaml -b -g -p LULESH
main

apps: 38 selected ['LULESH']

Clean...
HEAD is now at 3e01c40 Merge pull request #19 from nmhamster/master
===> Build...program LULESH mode seq
['make -j CXX=clang++ CXXFLAGS="-g -O3 -march=native -I. -Wall -DUSE_MPI=0 -fsave-optimization-record -save-stats" LDFLAGS="-g -O3 -march=native"']
Building lulesh.cc
Building lulesh-comm.cc
clang++ -c -g -O3 -march=native -I. -Wall -DUSE_MPI=0 -fsave-optimization-record -save-stats -o lulesh.o lulesh.cc
Building lulesh-init.cc
Building lulesh-viz.cc
Building lulesh-util.cc
clang++ -c -g -O3 -march=native -I. -Wall -DUSE_MPI=0 -fsave-optimization-record -save-stats -o lulesh-comm.o lulesh-comm.cc
clang++ -c -g -O3 -march=native -I. -Wall -DUSE_MPI=0 -fsave-optimization-record -save-stats -o lulesh-viz.o lulesh-viz.cc
clang++ -c -g -O3 -march=native -I. -Wall -DUSE_MPI=0 -fsave-optimization-record -save-stats -o lulesh-util.o lulesh-util.cc
clang++ -c -g -O3 -march=native -I. -Wall -DUSE_MPI=0 -fsave-optimization-record -save-stats -o lulesh-init.o lulesh-init.cc
clang-9: clang-9: warning: warningargument unused during compilation: '-march=native' [-Wunused-command-line-argument]:
argument unused during compilation: '-march=native' [-Wunused-command-line-argument]
clang-9: warning: clang-9: argument unused during compilation: '-march=native' [-Wunused-command-line-argument]warning
: argument unused during compilation: '-march=native' [-Wunused-command-line-argument]
clang-9: warning: argument unused during compilation: '-march=native' [-Wunused-command-line-argument]
lulesh-init.cc:38:4: warning: field 'm_refdens' will be initialized after field 'm_regNumList' [-Wreorder]
m_refdens(Real_t(1.0)),
^
lulesh-init.cc:45:4: warning: field 'm_nodeElemCornerList' will be initialized after field 'm_regElemSize' [-Wreorder]
m_nodeElemCornerList(0),
^
2 warnings generated.
Linking
clang++ lulesh.o lulesh-comm.o lulesh-viz.o lulesh-util.o lulesh-init.o -g -O3 -march=native -lm -o lulesh2.0
Merge stats and reports...
filename repos/LULESH/lulesh-comm.stats
filename repos/LULESH/lulesh-viz.stats
filename repos/LULESH/lulesh-util.stats
filename repos/LULESH/lulesh-init.stats
filename repos/LULESH/lulesh.stats
Copy...
Clean...
HEAD is now at 3e01c40 Merge pull request #19 from nmhamster/master
Removing lulesh-comm.o
Removing lulesh-comm.opt.yaml
Removing lulesh-comm.stats
Removing lulesh-init.o
Removing lulesh-init.opt.yaml
Removing lulesh-init.stats
Removing lulesh-util.o
Removing lulesh-util.opt.yaml
Removing lulesh-util.stats
Removing lulesh-viz.o
Removing lulesh-viz.opt.yaml
Removing lulesh-viz.stats
Removing lulesh.o
Removing lulesh.opt.yaml
Removing lulesh.stats
Removing lulesh2.0
===> Build...program LULESH mode omp
['make -j CXX=clang++ CXXFLAGS="-g -fopenmp -O3 -march=native -I. -Wall -DUSE_MPI=0 -fsave-optimization-record -save-stats" LDFLAGS="-g -O3 -march=native -fopenmp"']
Building lulesh.cc
clang++ -c -g -fopenmp -O3 -march=native -I. -Wall -DUSE_MPI=0 -fsave-optimization-record -save-stats -o lulesh.o lulesh.cc
Building lulesh-comm.cc
clang++ -c -g -fopenmp -O3 -march=native -I. -Wall -DUSE_MPI=0 -fsave-optimization-record -save-stats -o lulesh-comm.o lulesh-comm.cc
Building lulesh-viz.cc
clang++ -c -g -fopenmp -O3 -march=native -I. -Wall -DUSE_MPI=0 -fsave-optimization-record -save-stats -o lulesh-viz.o lulesh-viz.cc
Building lulesh-util.cc
clang++ -c -g -fopenmp -O3 -march=native -I. -Wall -DUSE_MPI=0 -fsave-optimization-record -save-stats -o lulesh-util.o lulesh-util.cc
Building lulesh-init.cc
clang++ -c -g -fopenmp -O3 -march=native -I. -Wall -DUSE_MPI=0 -fsave-optimization-record -save-stats -o lulesh-init.o lulesh-init.cc
clang-9: warning: argument unused during compilation: '-march=native' [-Wunused-command-line-argument]
clang-9: warning: argument unused during compilation: '-march=native' [-Wunused-command-line-argument]
clang-9: warning: argument unused during compilation: '-march=native' [-Wunused-command-line-argument]
clang-9: warning: argument unused during compilation: '-march=native' [-Wunused-command-line-argument]
clang-9: warning: argument unused during compilation: '-march=native' [-Wunused-command-line-argument]
lulesh-init.cc:38:4: warning: field 'm_refdens' will be initialized after field 'm_regNumList' [-Wreorder]
m_refdens(Real_t(1.0)),
^
lulesh-init.cc:45:4: warning: field 'm_nodeElemCornerList' will be initialized after field 'm_regElemSize' [-Wreorder]
m_nodeElemCornerList(0),
^
2 warnings generated.
Linking
clang++ lulesh.o lulesh-comm.o lulesh-viz.o lulesh-util.o lulesh-init.o -g -O3 -march=native -fopenmp -lm -o lulesh2.0
Merge stats and reports...
filename repos/LULESH/lulesh-comm.stats
filename repos/LULESH/lulesh-viz.stats
filename repos/LULESH/lulesh-util.stats
filename repos/LULESH/lulesh-init.stats
filename repos/LULESH/lulesh.stats
Merge OpenMP info...
Copy...
Creating HTML report output for build seq ...
Reading YAML files...
Rendering index page...
Rendering HTML files...
2 of 21Find file None failed!
4 of 21Find file None failed!
6 of 21Find file None failed!
7 of 21Find file None failed!
10 of 21Find file None failed!
Find file None failed!
11 of 21Find file None failed!
Find file None failed!
Find file None failed!
Find file None failed!
17 of 21Find file None failed!
18 of 21Find file None failed!
Find file None failed!
19 of 21Find file None failed!
Find file None failed!
20 of 21Find file None failed!
Done generating compilation reports!
Creating HTML report output for build omp ...
Reading YAML files...
Rendering index page...
Rendering HTML files...
2 of 21Find file None failed!
7 of 21Find file None failed!
Find file None failed!
9 of 21Find file None failed!
10 of 21Find file None failed!
Find file None failed!
11 of 21Find file None failed!
Find file None failed!
Find file None failed!
Find file None failed!
13 of 21Find file None failed!
14 of 21Find file None failed!
Find file None failed!
15 of 21Find file None failed!
19 of 21Find file None failed!
Find file None failed!
Done generating compilation reports!
Creating diff remark YAML files...
Reading YAML files...
Reading YAML files...
args.filter None
Done generating YAML diff optimization report for builds seq|omp mode all
Creating HTML report output diff for seq omp..
Reading YAML files...
Rendering index page...
Rendering HTML files...
1 of 5Find file None failed!
2 of 5Find file None failed!
Done generating compilation report for builds seq|omp mode all
Creating diff remark YAML files...
Reading YAML files...
Reading YAML files...
args.filter analysis
Done generating YAML diff optimization report for builds seq|omp mode analysis
Creating HTML report output diff for seq omp..
Reading YAML files...
Rendering index page...
Rendering HTML files...
Done generating compilation report for builds seq|omp mode analysis
Creating diff remark YAML files...
Reading YAML files...
Reading YAML files...
args.filter missed
Done generating YAML diff optimization report for builds seq|omp mode missed
Creating HTML report output diff for seq omp..
Reading YAML files...
Rendering index page...
Rendering HTML files...
3 of 5Find file None failed!
4 of 5Find file None failed!
Done generating compilation report for builds seq|omp mode missed
Creating diff remark YAML files...
Reading YAML files...
Reading YAML files...
args.filter passed
Done generating YAML diff optimization report for builds seq|omp mode passed
Creating HTML report output diff for seq omp..
Reading YAML files...
Rendering index page...
Rendering HTML files...
3 of 4Find file None failed!
Done generating compilation report for builds seq|omp mode passed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.