Coder Social home page Coder Social logo

hb_starlite's Introduction

Starlite: A Programmability Testing Environment for HammerBlade

This repository contains a setup for evaluating the programming infrastructure for the HammerBlade project. The main component is a Docker container setup that includes TVM, PyTorch, and GraphIt. There are also tools for estimating the energy consumption of programs implemented using this infrastructure.

Running the Container

To run the container, use our launch script to pull it from Docker Hub:

$ ./docker/bash.sh mutinifni/sdh-tvm-pytorch:latest

You might need root permissions based on your local Docker setup (so try this with sudo if it doesn't work without it).

You can also see the Dockerfile source for details on how this is set up. For other (standard) containers for TVM (including GPU support), see the official Dockerfiles, and related instructions.

Development

Inside the container, you can use PyTorch, TVM, and GraphIt.

PyTorch

For machine learning and dense linear algebra development, we recommend you use PyTorch. To get started, begin with the "60-minute blitz" PyTorch tutorial. Then, depending on the task you want to accomplish, explore the full set of PyTorch tutorials to find examples that are closest to your domain.

TVM

You can also opt to use TVM directly, especially via its MXNet frontend. See the extensive list of tutorials that come with TVM.

GraphIt

To develop graph processing kernels, use GraphIt. Begin by following the Getting Started guide, which walks you through the implementation of the PageRank-Delta algorithm. (You can skip the initial setup instructions; the compiler is already installed in the container for you.) Then, check out the language manual for more details.

HBPintool

The tool only supports being run from the source root of hbpintool (/hbpintool/ in this image).

From the hbpintool directory run these commands to profile your GraphIt program:

  1. source SOURCE_THIS
  2. ./hbpintool /path/to/your/graphit/program [your-graphit-program-arguments]

You should find the output in a file called hbpintool.out

Preventing Compiler Inlining

For accuracy the hbpintool relies on the GraphIt generated edgeset_apply function being defined in the program executable.

However, depending on how the GraphIt C++ output was compiled, this function may have been inlined.

To keep this from happening, open the .cpp file generated by graphitc.py and add __attribute__((noinline)) to the definition of the templated edgeset_apply function (the exact name depends on the GraphIt schedules used).

Serial Code Only

This tool is only written to profile serial code (Don't compile the GraphIt program with -fopenmp). The models it uses to calculate energy factors in the parallelism for the relevant hardware.

Intel 64

This tool can only run on Intel x86_64 processors.

Profiling

We recommend that testers use the PyTorch frontend for development. Then, to profile an implementation you've created, we recommend you use TVM. To do so, you will need to export the PyTorch model as ONNX and import into TVM. Follow these steps:

  1. Export the model. Use torch.onnx.export to save your model to an ONNX file.
  2. Import the model into TVM and compile. See the TVM tutorial about importing ONNX models.

hb_starlite's People

Contributors

mutinifni avatar mrutt92 avatar sampsyo avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar Dustin Richmond avatar  avatar  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.