Giter VIP home page Giter VIP logo

mcsquare-isca24's Introduction

$(MC)^{2}$: Lazy MemCopy at the Memory Controller

We provide the source code and setup necessary for $(MC)^{2}$. $(MC)^{2}$ is a hardware extension that provides support for a lazy memcpy operation.

This operation avoids copying data at the time of function call. Instead, if copied destinations are later accessed, $(MC)^{2}$ uses tracking information to seamlessly reroute the request to the appropriate source, while lazily executing copies only when necessary. $(MC)^{2}$ modifies the memory controller and has been implemented using gem5, a CPU simulator.

For full details on the different mechanisms we evaluate, please refer to our paper:

(MC)^2: Lazy MemCopy at the Memory Controller
Aditya K Kamath, Simon Peter
ACM/IEEE 51st Annual International Symposium on Computer Architecture (ISCA), 2024

This repository consists of the source code of the simulator and all scripts needed to replicate the figures in the paper. We shall first explain how to replicate our results, then highlight the important files and folders contained in this repository.

Setting up gem5

Our repository builds on the gem5 simulator (original readme for gem5 is retained as README). Detailed instructions on building gem5 and alternative docker containers can be found on their webpage.

Ensure that your machine supports KVM, as this is used during our simulations. This can be done by running the following command and ensuring the return value is 1 or more:

egrep -c '(vmx|svm)' /proc/cpuinfo

Dependencies

Ubuntu 20.04 or 22.04 is preferred. The following commands installs all the dependencies for Ubuntu 22.04:

sudo apt install build-essential git m4 scons zlib1g zlib1g-dev \
    libprotobuf-dev python3-dev protobuf-compiler libprotoc-dev \
    qemu-kvm libvirt-daemon-system libgoogle-perftools-dev \
    libboost-all-dev pkg-config python3-tk libvirt-clients \
    bridge-utils python3-matplotlib python3-numpy

Building the gem5 executable

To generate the gem5 executable, you can run the following command, replacing {cpus} with the number of threads to use to build. When running experiments, this command is automatically executed by the Makefile.

scons build/X86/gem5.opt -j {cpus}

Obtaining disk images

The disk images used for our evaluation can be downloaded from here: https://zenodo.org/records/11479488
Unzip this file, and place the os folder inside the mcsquare folder in this repository.
This folder structure should look like: MCSquare-ISCA24/mcsquare/os/

Running experiments

Individually executing experiments

Once the setup for gem5 is completed, proceed with the following steps to run the artifact. Individual experiments can be run and figures obtained by running the following commands:

make launch_micro_latency   #Figure 10:   10 min
make launch_micro_breakdown #Figure 11:   10 min
make launch_micro_seq       #Figure 12:   30 min
make launch_micro_rand      #Figure 13:    1 hr
make launch_protobuf        #Figure 14,20: 2 hr
make launch_mongo           #Figure 15:   15 hr
make launch_mvcc            #Figure 16,17: 6 hr
make launch_hugepage_access #Figure 18    20 min
make launch_pipe            #Figure 19:   15 min
make launch_src_write       #Figure 21:   10 min

The outputs will be generated as two seperate files. A TXT file is generated in results/figure_X.txt, where X is the specific figure number, which contains the raw numbers to be plotted. figures/figure_X.png will contain the plotted figure. The exception is for Figure 20, where only a TXT file containing the table is generated. Minor variances in performance numbers occur from run to run, but general trends should remain stable.

Running all experiments

Alternatively, to run all the benchmarks and generate figures run:

make launch_all 

To regenerate all outputs run:

make extract_all

$(MC)^{2}$ source code

A new folder called mcsquare contains the files that implement $(MC)^{2}$ and the scripts required for execution. It contains the following subfolders:

  • mcsquare/lib: This folder contains the runtime code for $(MC)^{2}$, consisting of a header file (mcsquare.h) containing the function for lazy memcpy (memcpy_elide_clwb), and the library interposers. These files are used within simulation to convert benchmarks from standard memcpy to lazy memcpy.
  • mcsquare/scripts: This folder contains bash and python scripts for executing experiments and plotting the different graphs.
  • mcsquare/results: This folder is generated on running an experiment, and contains the raw output for the experiment.
  • mcsquare/figures: This folder is generated on completing an experiment, and contains the plotted figure for the experiment.

The functionality for $(MC)^{2}$ is encapsulated in src/mem/mcsquare.cc, which contains the implementation of the tables and buffers required. Other modifications were performed in the memory controller and memory interconnect to support this new feature.

Companion repositories

  • Modified linux contains the source code of Linux modified to use lazy copies on huge page faults and when writing to/reading from pipes.
  • Modified Cicada contains the source code of the Cicada MVCC database modified to allow varying row sizes and granularities of writes.
  • Modified zIO contains the source code of zIO modified to copy elide all memcpy operations instead of just IO-based ones.

mcsquare-isca24's People

Contributors

binkert avatar steve-reinhardt avatar giactra avatar andysan avatar bobbyrbruce avatar nilayvaish avatar odanrc avatar rdreslin avatar beckmabd avatar relokin avatar abmerop avatar powerjg avatar hnpl avatar akkamath avatar tiagormk avatar atgutier avatar bkp avatar cdunham avatar kyleroarty avatar ************2 avatar wmin0 avatar sandip4n avatar ramymdsc avatar jthestness avatar aroelke avatar alexdutu avatar tushar-krishna avatar earlou avatar gabordzs avatar jordivaquero avatar

Stargazers

 avatar Yeonan Ha avatar

Watchers

 avatar

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.