Giter Club home page Giter Club logo

dynbal's Introduction

Keep in Balance: Runtime-reconfigurable Intermittent Deep Inference

Overview

This project develops a middleware plugin (referred to as DynBal) that reconfigures the inference engine at runtime. During intermittent DNN inference, DynBal dynamically optimizes the inference configuration for each layer in order to balance the data reuse and data refetch costs, taking into account the varying level of intermittency at runtime.

We implemented our DynBal design on the Texas Instruments device MSP-EXP432P401R. It is an ARM-based 32-bit MCU with 64KB SRAM and single instruction multiple data (SIMD) instructions for accelerated computation. An external NVM module (Cypress CY15B104Q serial FRAM) was integrated to the platform.

DynBal was integrated with the Stateful intermittent inference engine for evalution purposes, although it can be easily integrated into most existing intermittent inference engines.

DynBal contains two key design components which interacts with the inference engine at runtime:

  • Performance estimation: implements an indirect metric, referred to as the Usage Span, which is used to evaluate an inference configuration under a specific level of intermittency
  • Runtime reconfiguration: dynamically updates the inference configuration parameters using feedback from the performance estimation component and heuristics derived at design time.

Demo video: https://www.youtube.com/watch?v=U45VH-SFxKs

Experimental data (including parameter selections): link

Table of Contents

Directory/File Structure

Below is an explanation of the directories/files found in this repo.

  • common/conv.cpp, common/fc.cpp, common/pooling.cpp, common/op_handlers.cpp, common/op_utils.*: functions implementing various neural network layers and auxiliary functions shared among different layers.
  • common/cnn_common.*, common/intermittent-cnn.*: main components of the Stateful intermittent inference engine.
  • common/dynbal*: functions that implement the aforementioned key design components of DynBal.
  • common/platform.*, common/plat-mcu.* and common/plat-pc.*: high-level wrappers for handling platform-specific peripherals.
  • common/my_dsplib.*: high-level wrappers for accessing different vendor-specific library calls performing accelerated computations.
  • common/counters.* : helper functions for measuring runtime overhead.
  • dnn-models/: pre-trained models and python scripts for model training, converting different model formats to ONNX and converting a model into a custom format recognized by the lightweight inference engine.
  • dnn-models/dynbal.py: functions for offline analysis of the Usage Span metric.
  • msp432/: platform-speicific hardware initialization functions.
  • tools/: helper functions for various system peripherals (e.g., UART, system clocks and external FRAM).

Getting Started

Prerequisites

Here are basic software and hardware requirements to build DynBal along with the Stateful intermittent inference engine:

Setup and Build

  1. Prepare vendor-supplied libraries for hardware-accelerated computation. git submodule update --init --recursive will download them all.
  2. Convert the provided pre-trained models with the command python3 dnn-models/transform.py --target msp432 --stateful (cifar10|har|kws) to specify the model to deploy from one of cifar10, har or kws.
  3. Download and extract MSP432 driverlib, and copy driverlib/MSP432P4xx folder into the msp432/ folder.
  4. Import the folder msp432/ as a project in CCStudio.

dynbal's People

Contributors

meenchen avatar yan12125 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

lgs001elite

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.