Latest Status of These Tests on Gem5
Total Page:16
File Type:pdf, Size:1020Kb
gem5art Release 0.2.1 Jul 01, 2021 Contents 1 Introduction 3 1.1 Installing gem5art............................................4 2 Artifacts 5 2.1 gem5art artifacts.............................................5 2.2 ArtifactDB................................................7 2.3 Artifacts API Documentation......................................9 3 Run 15 3.1 Introduction............................................... 15 3.2 SE and FS mode runs.......................................... 15 3.3 Running an experiment.......................................... 16 3.4 Run Already in the Database....................................... 17 3.5 Searching the Database to find Runs................................... 17 3.6 Searching the Database to find Runs with Specific Names....................... 18 3.7 Runs API Documentation........................................ 18 4 Tasks 21 4.1 Use of Python Multiprocessing..................................... 21 4.2 Use of Celery............................................... 21 4.3 Tasks API Documentation........................................ 22 5 Disk Images 23 5.1 Introduction............................................... 23 5.2 Building a Simple Disk Image with Packer............................... 23 6 Frequently Asked Questions 27 7 Tutorial: Run Full System Linux Boot Tests 29 7.1 Introduction............................................... 29 7.2 Setting up the environment........................................ 30 7.3 Building gem5.............................................. 30 7.4 Creating a disk image.......................................... 31 7.5 Compiling the linux kernel........................................ 32 7.6 gem5 run scripts............................................. 33 7.7 Database and Celery Server....................................... 33 7.8 Creating a launch script......................................... 33 i 7.9 If Using Celery.............................................. 37 7.10 If Using Python Multiprocessing Library:................................ 37 7.11 Results.................................................. 38 8 Tutorial: Run NAS Parallel Benchmarks with gem5 39 8.1 Introduction............................................... 39 8.2 Setting up the environment........................................ 40 8.3 Building gem5.............................................. 41 8.4 Creating a disk image.......................................... 41 8.5 Compiling the linux kernel........................................ 45 8.6 gem5 run scripts............................................. 45 8.7 Database and Celery Server....................................... 46 8.8 Creating a launch script......................................... 46 8.9 If Using Celery.............................................. 49 8.10 If Using Python Multiprocessing Library:................................ 49 8.11 Results.................................................. 50 9 Tutorial: Run Microbenchmarks with gem5 51 9.1 Introduction............................................... 51 9.2 Setting up the environment........................................ 51 9.3 Build gem5................................................ 52 9.4 Download and compile the microbenchmarks.............................. 52 9.5 gem5 run scripts............................................. 53 9.6 Database and Celery Server....................................... 53 9.7 Creating a launch script......................................... 53 10 Tutorial: Run SPEC CPU 2017 / SPEC CPU 2006 Benchmarks in Full System Mode with gem5art 57 10.1 Introduction............................................... 57 10.2 Setting up the Experiment........................................ 60 10.3 Running the Experiment......................................... 64 10.4 Appendix I. Working Status....................................... 67 10.5 Appendix II. Disk Image Generation Scripts.............................. 67 11 Tutorial: Run PARSEC Benchmarks with gem5 69 11.1 Introduction............................................... 69 11.2 Setting up the environment........................................ 70 11.3 Building gem5.............................................. 71 11.4 Creating a disk image.......................................... 71 11.5 Compiling the linux kernel........................................ 75 11.6 gem5 run scripts............................................. 75 11.7 Database and Celery Server....................................... 75 11.8 Creating a launch script......................................... 76 11.9 Results.................................................. 79 12 Indices and tables 83 Python Module Index 85 Index 87 ii gem5art, Release 0.2.1 Authors: • Jason Lowe-Power The gem5art project is a set of Python modules to help make it easier to run experiments with the gem5 simulator. gem5art contains libraries for Artifacts, Reproducibility, and Testing. You can think of gem5art as a structured protocol for running gem5 experiments When running an experiment, there are inputs, steps to run the experiment, and outputs. gem5art tracks all of these through Artifacts. An artifact is a some object, usually a file, which is used as part of the experiment. The gem5art project contains an interface to store all of these artifacts in a database. This database is mainly used to aid reproducibility, for instance, when you want to go back and re-run an experiment. However, it can also be used to share artifacts with others doing similar experiments (e.g., a disk image with a shared workload). The database is also used to store results from gem5 runs. Given all of the input artifacts, these runs have enough information to reproduce exactly the same experimental output. Additionally, there is metadata associated with each gem5 run (e.g., the experiment name, the script name, script parameters, gem5 binary name, etc.) which are useful for aggregating results from many experiments. These experimental aggregates are useful for testing gem5 as well as conducting research. We will be using this data by aggregating the data from 100s or 1000s of gem5 experiments to determine the state of gem5’s codebase at any particular time. For instance, as discussed in the Linux boot tutorial, we can use this data to determine which Linux kernels, Ubuntu versions, and boot types are currently functional in gem5. One of the underlying themes of gem5art is that you should fully understand each piece of the experiment you’re running. To this end, gem5art requires that every artifact for a particular experiment is explicitly defined. Additionally, we encourage the use of Python scripts at every level of experimentation from the workload and disk image creation to running gem5. By using Python scripts, you can both automate and document the processes for running your experiments. Many of the ideas used to develop gem5art came from our experience using gem5 and the pain points of running complex experiments. Jason Lowe-Power used gem5 extensively during his PhD at University of Wisconsin-Madison. Through this experience, he made many mistakes and lost an untold number of days trying to reproduce experiments or re-creating artifacts that were accidentally deleted or moved. gem5art was designed to reduce the likelihood that this happens to other researchers. Authors: • Ayaz Akram • Jason Lowe-Power Contents 1 gem5art, Release 0.2.1 2 Contents CHAPTER 1 Introduction The primary motivation behind gem5art is to provide an infrastructure to use a structured approach to run experiments with gem5. Particular goals of gem5art include: • structured gem5 experiments • easy to use • resource sharing • reproducibility • easy to extend • documentation of the performed experiments gem5art is mainly composed of the following components: • a database to store artifacts (gem5art-artifacts) • python objects to wrap gem5 experiments (gem5art-run) • a celery worker to manage gem5 jobs (gem5art-tasks) The process of performing experiments using gem5 can quickly become complicated due to involvement of multiple components. This can be intimidating for new users, and it can be difficult to manage even for experienced researchers. As an example, following is a diagram which shows the interaction that takes place among different components (artifacts) while running full-system experiments with gem5. 3 gem5art, Release 0.2.1 Figure: Flowchart of gem5 full system mode use case Each bubble in the diagram represents a different artifact which is one small part of a gem5 experiment culminating in the results from the gem5 execution. All of the lines show dependencies between artifacts (e.g., the disk image depends on the m5 binary). You can imagine everything in this example to be contained in a base git repository (base repo) artifact which can keep track of changes in files not tracked by other repositories. Packer is a tool to generate disk images and serves as an input to the disk image artifact. gem5 source code repo artifact serves as an input to two other artifacts (gem5 binary and m5 utility). Linux source repository and base repository (specifically kernel config files) are used to build the disk image and multiple artifacts then generate the final results artifact. gem5art serves as a tool/infrastructure to streamline this entire process and keeps track of things as they change, thus leading to reproducible runs. Moreover, it allows to share the artifacts used in the above example, among multiple users. Additionally, gem5art tracks results like all other artifacts, so they can be