Giter Site home page Giter Site logo

nnsc_2022_mobile's Introduction

NNSC_2022_mobile

Running PyTorch models on mobile phone

Brief description

  • This code provides scripts to profile neural networks on Android devices
  • Compression may be done using MusCo toolkit.

Repository structure

  • ./device_profiling helper code to profile models on phones
  • ./doc Markdown documentation

Dependencies

  • see env_docker.yaml. You can install requirements with conda:
conda create -n nnsc_2022_mobile --file env_docker.yaml
  • you can also use a docker image qbit271/mmsc_2022_mobile or build your own here

Benchmarking on mobile phones

  1. You need to first download or compile an appropriate PyTorch benchmarking binary, instructions can be found here. Otherwise, you can download the one we prebuilt for you from https://github.com/qbit-/NNSC_2022_mobile/tree/main/bin. For the prebuilt binary to work with your models, you need to use Pytorch 1.7.1 to build your models.

  2. Copy the benchmark binary to /data/local/tmp/speed_benchmark_torch on the device. Check that the device is accessible:

adb devices

copy the profiler to the device and make it executable

adb push speed_benchmark_torch-$ANDROID_ABI /data/local/tmp/speed_benchmark_torch
adb shell chmod +x /data/local/tmp/speed_benchmark_torch
  1. Check that you can execute the benchmarking binary using ADB:
adb shell /data/local/tmp/speed_benchmark_torch --help

Now you can use functions in ./device_profiling to automate profiling. See the example

nnsc_2022_mobile's People

Contributors

qbit- avatar

Watchers

 avatar Julia Gusak 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.