GithubHelp home page GithubHelp logo

vegetableysm / mira Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wuklab/mira

0.0 0.0 0.0 32.13 MB

A Progam-Behavior-Guided Far Memory System

License: MIT License

Shell 0.01% C++ 2.82% Python 0.01% C 0.40% Makefile 0.01% HTML 2.21% CMake 0.07% LLVM 39.74% MLIR 54.75%

mira's Introduction

Mira: A Program-Behavior-Guided Far Memory System

This repo contains source code for paper Mira: A Program-Behavior-Guided Far Memory System. You can get more information from our paper.

๐Ÿšง UNDER CONSTRUCTION ๐Ÿšง

This repo is still under construction as we are moving our runtime from runtime/libcommon to runtime/libcommon2. Please check back later for completed features and documents.

System Setup

Mira system is built on top of LLVM project. We recommand to build and test Mira system with cloudlab machines. Mira are tested using the following hardware/software environment:

Cloudlab C6220 Machine:
c6220 (Ivy Bridge, 16 cores)
CPU 2 x Xeon E5-2650v2 processors (8 cores each, 2.6Ghz)
RAM 64GB Memory (8 x 8GB DDR-3 RDIMMs, 1.86Ghz)
NIC 1 x Mellanox FDR CX3 Single port mezzanine card

OS: Cloudlab Ubuntu Ubuntu 20.04 LTS image, with kernel version 5.4.0-100-generic #113-Ubuntu
MLNX_OFED version: MLNX_OFED_LINUX-4.9-7.1.0.0-ubuntu20.04-x86_64

Setting up Mira System

Directory Structure

โ”œโ”€โ”€ compiler		# Mira compiler
โ”‚ย ย  โ”œโ”€โ”€ cmake
โ”‚ย ย  โ”œโ”€โ”€ include
โ”‚ย ย  โ”œโ”€โ”€ lib		# Compiler code and modified cgeist frontend
โ”‚ย ย  โ”œโ”€โ”€ patches		# Patches to the llvm-project
โ”‚ย ย  โ”œโ”€โ”€ script
โ”‚ย ย  โ”œโ”€โ”€ test
โ”‚ย ย  โ””โ”€โ”€ tools		# Mira and modified cgeist code
โ”œโ”€โ”€ llvm-project	# Git submodule contains the LLVM project. Mira uses LLVM,MLIR and Clang (Optionally Bolt, LibCXX) from LLVM-project
โ”œโ”€โ”€ runtime
โ”‚ย ย  โ”œโ”€โ”€ apps		# Example apps 
โ”‚ย ย  โ”œโ”€โ”€ libcommon	# Mira runtime libs v1
โ”‚ย ย  โ”œโ”€โ”€ libcommon2	# Mira runtime libs v2
โ”‚ย ย  โ””โ”€โ”€ tests
โ””โ”€โ”€ test
    โ”œโ”€โ”€ include		# header files for pre-setup tests
    โ”œโ”€โ”€ onnx		# onnx sources and weights for GPT
    โ”œโ”€โ”€ scripts		# test scripts
    โ””โ”€โ”€ srcs		# source files

Machine Setup

Install the corresponding version of MLNX-OFED libraries. Use MLNX_OFED_LINUX-4.9-7.1.0.0-ubuntu20.04-x86_64 on cloudlab machines. Install required software packages (cmake,ninja,clang,google-perftools-dev,pprof)

Build Mira Compilers

First, initialize and fetch the submodule in compiler/llvm-project. Then apply patches in the compiler/patches to the LLVM module. Then using the following command to build LLVM libraries, replace DC_INCLUDE_PATH with your C standrard library include path, which could be found using the command `gcc -print-prog-name=cc1` -v. On cloudlab machines the directories are /usr/local/include:/usr/include/x86_64-linux-gnu:/usr/include.

mkdir llvm-project/build
cd llvm-project/build
cmake -G Ninja ../llvm \
  -DLLVM_ENABLE_PROJECTS="mlir;clang" \
  -DLLVM_TARGETS_TO_BUILD="host" \
  -DLLVM_ENABLE_ASSERTIONS=ON \
  -DCMAKE_BUILD_TYPE=Release \
  -DLLVM_INSTALL_UTILS=ON \
  -DCMAKE_C_COMPILER="clang" \
  -DCMAKE_CXX_COMPILER="clang++" \
  -DC_INCLUDE_DIRS="<your-c-library-path>" \
  -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
  -DLIBCXXABI_USE_LLVM_UNWINDER=YES \
  -DCLANG_DEFAULT_CXX_STDLIB=libstdc++ \
  -DLIBCXX_ENABLE_EXCEPTIONS=OFF
ninja

Then build Mira's compiler and front ends.

mkdir compiler/build
cd compiler/build
cmake -G Ninja .. \
  -DMLIR_DIR=$PWD/../../llvm-project/build/lib/cmake/mlir \
  -DCLANG_DIR=$PWD/../../llvm-project/build/lib/cmake/clang \
  -DLLVM_EXTERNAL_LIT=$PWD/../../llvm-project/build/bin/llvm-lit \
  -DCMAKE_C_COMPILER="clang" \
  -DCMAKE_CXX_COMPILER="clang++" \
  -DLLVM_TARGETS_TO_BUILD="host" \
  -DLLVM_ENABLE_ASSERTIONS=ON \
  -DCMAKE_BUILD_TYPE=DEBUG
ninja

build Mira runtime libraries.

remote_server need to be launched on the memory server. Both compute node and memory node should have environment variable SERVER_URL set. ON compute server it should be set to tcp://<remote_ip>:<port>, on memory node it should be set to tcp://*:<port>. remote server need to be launched before running the binary.

mkdir runtime/build
cd runtime/build
cmake -DCMAKE_BUILD_TYPE=Release ..
make common common2
make remote_server

(Optional) setup onnx compiling enironment

Please follow the instructions in the onnx-mlir project to setup onnx compling exvironment and obtain GPT2 model and weights from onnx models.

License

MIT

mira's People

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.