mantis: automatic performance prediction for smartphone applications yongin kwon, sangmin lee,...
TRANSCRIPT
![Page 1: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/1.jpg)
Mantis: Automatic Performance Prediction for Smartphone ApplicationsYongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,Ling Huang, Petros Maniatis, Mayur Naik, Yunheung Paek
USENIX ATC’13
![Page 2: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/2.jpg)
Performance Prediction ProblemPredict the execution time of a
program on a given input before running it.
![Page 3: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/3.jpg)
Two kinds of ApproachesMost existing techniques can be
classified into two broad categories.◦Domain-specific programs,
automatically-extracted features.◦General-purpose programs,
manually-specified features.
![Page 4: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/4.jpg)
MantisA new framework to
automatically predict the performance of general-purpose byte-code programs on given inputs.
Four components:◦Feature instrumentor◦Profiler◦Performance model generator◦Predictor code generator
![Page 5: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/5.jpg)
Architecture
![Page 6: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/6.jpg)
Feature InstrumentorInstruments the program to
collect the values of feature (f1, … , fM) as per feature schemes.
Feature scheme◦Branch counts◦Loop counts◦Method-call counts◦Variable values
![Page 7: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/7.jpg)
Examples
![Page 8: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/8.jpg)
ProfilerOutputs a data set
◦ti: the ith observation of execution time.
◦vi: the ith observation of the vector of M
features.
Niiit 1, v
],...,[ 1 iMii ffv
![Page 9: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/9.jpg)
Performance ModelingPerforms a sparse nonlinear
regression on the feature values and execution time.
Produces a function ◦ is the approximation of
execution time◦ is a subset of
In practice, K << M.
f)'(vf
],...,[' 1 Kffv ],...,[ 1 Mffv
![Page 10: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/10.jpg)
Performance Modeling(Cont.)However, regression with best
subset selection is NP-hard.◦Find the subset of size K that gives
the smallest Residual Sum of Squares(RSS).
◦Discrete optimization problem.
![Page 11: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/11.jpg)
SPORE-FoBaSparse POlynomial REgression –
FoBa.◦A feature from the candidate set is
added into the model if and only if adding it makes the RSS decrease a lot. If the drop is greater than ε.
◦Remove a feature from the active set if deleting it makes the RSS increase the least. If the increment is smaller than ε’.
![Page 12: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/12.jpg)
ExampleDegree-2 polynomial with
◦Expand (1+x1+x2)2 to get 1, x1, x2, x1
2, x1x2, x22.
◦Construct the following function for regression
],[ 21 xxv
225214
21322110)( xxxxxxf v
![Page 13: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/13.jpg)
Predictor code generatorProduce a code snippet, called slice, for each chosen features.
◦Slice: an executable sub-programs that yields the same value v of a feature at a program point p as the given program on all inputs.
Automatically evaluate feature values for each input by executing slices.
![Page 14: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/14.jpg)
Example
![Page 15: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/15.jpg)
Prototype Toolchain
![Page 16: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/16.jpg)
Experiment SetupA machine runs Ubuntu 11.10 64-
bit with a 3.1GHz quad-core CPU, and 8GB of RAM.
A Galaxy Nexus running Android 4.1.2 with dual-core 1.2Ghz CPU and 1GB RAM.
Six CPU-intensive Android applications.◦Each with 1,000 randomly generated
inputs.◦Train the predictor on 100 inputs.
![Page 17: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/17.jpg)
Experimental Results
![Page 18: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/18.jpg)
Features and Models
![Page 19: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/19.jpg)
Effect of the Number of Training Inputs
![Page 20: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/20.jpg)
Compare with Linear Model
![Page 21: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/21.jpg)
Prediction Time of Mantis and PE
![Page 22: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/22.jpg)
Prediction Error of Mantis and BE
![Page 23: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/23.jpg)
Prediction on Different Hardware Platform
![Page 24: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/24.jpg)
Prediction under Background Load
![Page 25: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/25.jpg)
Offline Stage Processing Time
![Page 26: Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,](https://reader035.vdocuments.site/reader035/viewer/2022062409/56649ef35503460f94c06560/html5/thumbnails/26.jpg)
ConclusionMantis is a framework that
automatically generates program performance predictors.◦Combines program slicing and
sparse regression in a novel way.Evaluation shows that the
generated predictors estimate execution time accurately and efficiently for smartphone applications.