Mantis: Automatic Performance Prediction for Smartphone Applications Byung-Gon Chun Microsoft Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun.

Slides:



Advertisements
Similar presentations
Mechanizing Program Analysis With Chord Mayur Naik Intel Labs Berkeley.
Advertisements

Module 3: Business Information Systems
1 Improving Cluster Selection Techniques of Regression Testing by Slice Filtering Yongwei Duan, Zhenyu Chen, Zhihong Zhao, Ju Qian and Zhongjun Yang Software.
(c) 2007 Mauro Pezzè & Michal Young Ch 17, slide 1 Test Execution.
Test Yaodong Bi.
Automated Concolic Testing of Smartphone Apps Saswat Anand Stanford Univ. Mayur Naik Georgia Tech. Hongseok Yang Univ. of Oxford Mary Jean Harrold Georgia.
Mining Specifications Glenn Ammons, Dept. Computer Science University of Wisconsin Rastislav Bodik, Computer Science Division University of California,
SPEED: Precise & Efficient Static Estimation of Symbolic Computational Complexity Sumit Gulwani MSR Redmond TexPoint fonts used in EMF. Read the TexPoint.
Software & Services Group, Developer Products Division Copyright© 2010, Intel Corporation. All rights reserved. *Other brands and names are the property.
1 VLDB 2006, Seoul Mapping a Moving Landscape by Mining Mountains of Logs Automated Generation of a Dependency Model for HUG’s Clinical System Mirko Steinle,
Wish Branches Combining Conditional Branching and Predication for Adaptive Predicated Execution The University of Texas at Austin *Oregon Microarchitecture.
Han-na Yang Trace Clustering in Process Mining M. Song, C.W. Gunther, and W.M.P. van der Aalst.
Dynodroid: Dynamic Analysis of Smartphone Apps
Does Training Input Selection Matter for Feedback-Directed Optimizations? Paul Berube University of Alberta CDP05, October 17, 2005.
Architectures and Systems for Mobile-Cloud Computing: A Workload-Driven Perspective Prashant Nair Adviser: Moin Qureshi ECE Georgia Tech Xin Zhang Adviser:
ECE Synthesis & Verification1 ECE 667 Spring 2011 Synthesis and Verification of Digital Systems Verification Introduction.
Michael Ernst, page 1 Improving Test Suites via Operational Abstraction Michael Ernst MIT Lab for Computer Science Joint.
1 Advanced Material The following slides contain advanced material and are optional.
Mining Behavior Models Wenke Lee College of Computing Georgia Institute of Technology.
1 Software Testing and Quality Assurance Lecture 5 - Software Testing Techniques.
Experiment Support Introduction to HammerCloud for The LHCb Experiment Dan van der Ster CERN IT Experiment Support 3 June 2010.
Software Testing and QA Theory and Practice (Chapter 4: Control Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Automated Diagnosis of Software Configuration Errors
Efficient Privilege De-Escalation for Ad Libraries in Mobile Apps Bin Liu (SRA), Bin Liu (CMU), Hongxia Jin (SRA), Ramesh Govindan (USC)
Impact Analysis of Database Schema Changes Andy Maule, Wolfgang Emmerich and David S. Rosenblum London Software Systems Dept. of Computer Science, University.
Automated malware classification based on network behavior
Where Are the Nuggets in System Audit Data? Wenke Lee College of Computing Georgia Institute of Technology.
Dynodroid: An Input Generation System for Android Apps
Platform Support for Developing Analysis and Testing Plugins Shauvik Roy Choudhary with Jeremy Duvall, Wei Jin, Dan Zhao, Alessandro Orso School of Computer.
GPU Performance Prediction GreenLight Education & Outreach Summer Workshop UCSD. La Jolla, California. July 1 – 2, Javier Delgado Gabriel Gazolla.
A Metadata Based Approach For Supporting Subsetting Queries Over Parallel HDF5 Datasets Vignesh Santhanagopalan Graduate Student Department Of CSE.
Implementing a Speech Recognition System on a GPU using CUDA
Automated Construction of Parameterized Motions Lucas Kovar Michael Gleicher University of Wisconsin-Madison.
Scientific Workflow Scheduling in Computational Grids Report: Wei-Cheng Lee 8th Grid Computing Conference IEEE 2007 – Planning, Reservation,
ACSAC’04 Choice Predictor for Free Mongkol Ekpanyapong Pinar Korkmaz Hsien-Hsin S. Lee School of Electrical and Computer Engineering Georgia Institute.
Automating Database Processing
Mantis: Automatic Performance Prediction for Smartphone Applications Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Byung-Gon Chun,
C. Arnault – ATLAS RPMs- 14/03/ n° 1 ATLAS RPMs from CMT C. Arnault & C. Loomis
Automatically Repairing Broken Workflows for Evolving GUI Applications Sai Zhang University of Washington Joint work with: Hao Lü, Michael D. Ernst.
Web Logic Vulnerability By Eric Jizba and Yan Chen With slides from Fangqi Sun and Giancarlo Pellegrino.
RecBench: Benchmarks for Evaluating Performance of Recommender System Architectures Justin Levandoski Michael D. Ekstrand Michael J. Ludwig Ahmed Eldawy.
“Trusted Passages”: Meeting Trust Needs of Distributed Applications Mustaque Ahamad, Greg Eisenhauer, Jiantao Kong, Wenke Lee, Bryan Payne and Karsten.
Pattern-Based DFA for Memory- Efficient and Scalable Multiple Regular Expression Matching Author: Junchen Jiang, Yang Xu, Tian Pan, Yi Tang, Bin Liu Publisher:IEEE.
Hassen Grati, Houari Sahraoui, Pierre Poulin DIRO, Université de Montréal Extracting Sequence Diagrams from Execution Traces using Interactive Visualization.
MROrder: Flexible Job Ordering Optimization for Online MapReduce Workloads School of Computer Engineering Nanyang Technological University 30 th Aug 2013.
LOGOPolyUnpack: Automating the Hidden-Code Extraction of Unpack-Executing Malware Royal, P.; Halpin, M.; Dagon, D.; Edmonds, R.; Wenke Lee; Computer Security.
0 The old computing is about what computers can do… the new computing is about what people can do. - Ben Shneiderman.
Survey of Tools to Support Safe Adaptation with Validation Alain Esteva-Ramirez School of Computing and Information Sciences Florida International University.
Understanding Assessment = Understanding Learning Barry O’Sullivan British Council Assessment Research Group Conference - September 12 th 2015 Hosei University,
CISC Machine Learning for Solving Systems Problems Presented by: Eunjung Park Dept of Computer & Information Sciences University of Delaware Solutions.
2D-Profiling Detecting Input-Dependent Branches with a Single Input Data Set Hyesoon Kim M. Aater Suleman Onur Mutlu Yale N. Patt HPS Research Group The.
Deterministic Diagnostic Pattern Generation (DDPG) for Compound Defects Fei Wang 1,2, Yu Hu 1, Huawei Li 1, Xiaowei Li 1, Jing Ye 1,2 1 Key Laboratory.
Projections - A Step by Step Tutorial By Chee Wai Lee For the 2004 Charm++ Workshop.
Linear Analysis and Optimization of Stream Programs Masterworks Presentation Andrew A. Lamb 4/30/2003 Professor Saman Amarasinghe MIT Laboratory for Computer.
A method for using cloud computing for Android By: Collin Molnar.
AHED Automatic Human Emotion Detection
Formally Specified Monitoring of Temporal Properties
9/14/ :46 AM BRK3293 How the Portland Trail Blazers Use Personalization and Acxiom Data to Target Customers Chris Hoder Program Manager, AI + Research.
إستراتيجيات ونماذج التقويم
Microsoft products for non-profits
Microsoft Virtual Academy
Calpa: A Tool for Automating Dynamic Compilation
Declarative Transfer Learning from Deep CNNs at Scale
Laura Bright David Maier Portland State University
Overview: Dynamics 365 for Project Service Automation
Dynamic Program Analysis
Future L&D System Architecture
TechEd /23/2019 9:23 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
CSE 1020:Software Development
Topology Optimization through Computer Aided Software
Presentation transcript:

Mantis: Automatic Performance Prediction for Smartphone Applications Byung-Gon Chun Microsoft Yongin Kwon, Sangmin Lee, Hayoon Yi, Donghyun Kwon, Seungjun Yang, Ling Huang, Petros Maniatis, Mayur Naik, Yunheung Paik Seoul National University, UT Austin, Intel, Georgia Tech

Smartphone apps

Performance prediction problem Predict the execution time of a program on a given input before running it

Two kinds of approaches Differentiated by features chosen to model program’s performance Approach 1 : domain-specific program, automatically-extracted features Approach 2 : general-purpose program, manually-specified features

Performance predictor design dimensions Applicability Automation Accuracy Efficiency Approach 1 X O   Approach 2 O X   Mantis O O O O

Outline Motivation System overview Feature instrumentation Profiling Prediction modeling Predictor code generation Evaluation

Key insight of our approach Program execution runs often contain features that correlate with performance and are automatically computable efficiently

Automatically computable for (int i=0; i<n; ++i) { /* heavy computation */ }

Automatically computable for (int i=0; i<n; ++i) { if ( a[i] == true ) { /* heavy computation */ }

Cheaply computable for (int i=0; i<n; ++i) { if ( a[i] == true ) { /* heavy computation */ }

Key questions What are good program features for performance prediction? How do we model performance with relevant features? How do we compute features cheaply? How do we automatically generate predictor code?

System architecture Input data Profiler Feature values, perf. metrics Model generator Function over selected features Offline component Feature instrumentor Instrumented program Feature schemes Program No Predictor code Predictor code generator Predictor exe time <= TH Yes

System architecture Input data Profiler Feature values, perf. metrics Model generator Function over selected features Feature instrumentor Instrumented program Feature schemes Program No Predictor code Predictor code generator Predictor exe time <= TH Yes

Feature instrumentation Branch counts Loop counts Method call counts Variable values

Feature instrumentation Branch counts // original code if (flag) { lightweightCompute(); } else { heavyCompute(); } // instrumented code if (flag) { ++mantis_branch_cnt1; lightweightCompute(); } else { ++mantis_branch_cnt2; heavyCompute(); }

Feature instrumentation Loop counts // original code while(line=readLine()) { search(line); } // instrumented code while(line=readLine()) { ++mantis_loop_cnt; search(line); }

Feature instrumentation Method call counts // original code process(String arg) {... } // instrumented code process(String arg) { ++mantis_method_cnt;... }

Feature instrumentation Variable values // original code n=preprocess(); compute(n); // instrumented code n=preprocess(); mantis_n_sum += n; ++mantis_n_count; compute(n);

System architecture Input data Profiler Feature values, perf. metrics Model generator Function over selected features Feature instrumentor Instrumented program Feature schemes Program No Predictor code Predictor code generator Predictor exe time <= TH Yes

System architecture Input data Profiler Feature values, perf. metrics Model generator Function over selected features Feature instrumentor Instrumented program Feature schemes Program No Predictor code Predictor code generator Predictor exe time <= TH Yes

Performance modeling Expect a small set of features to explain performance among lots of features SPORE-FoBa (Huang et al. 2010)

Performance modeling SelectedFeatures = Prune_by_FoBa(Features) // FoBa (Zhang 2008) Terms = PolynomialExpansion(SelectedFeatures, d) // e.g., SelectedFeatures = {x1, x2} // (1 + x1 + x2) 2 => 1, x1, x2, x1 2, x2 2, x1x2 // ŷ = b 1 + b 2 x1 + b 3 x2 + b 4 x1 2 + b 5 x2 2 + b 6 x1x2 PerfModel = Choose_by_FoBa(Terms)

System architecture Input data Profiler Feature values, perf. metrics Model generator Function over selected features Feature instrumentor Instrumented program Feature schemes Program No Predictor code Predictor code generator Predictor exe time <= TH Yes

Predictor code generation: static program slicing A slice: a subprogram of the given program that yields the same value of variable v at program point p int x; if (b1) { x = 10; } else { if (b2) { x = 20; } else { x = 30; } x = 40; Print(x); program int x; x = 40; Print(x); slice

Predictor code generation: static program slicing Reader r = new Reader(file); String s; while((s = r.readLine()) != null) { mantis_loop_cnt++; // feature inst process(s); // expensive comp } program Reader r = new Reader(file); String s; while((s = r.readLine()) != null) { mantis_loop_cnt++; // feature inst } slice

Predictor code generation: static program slicer challenges Inter-procedural analysis Alias analysis Concurrency analysis Executable slices

Predictor code generation Intraprocedural: construct Program Dependency Graphs (PDGs) (HRB 1988) Interprocedural: construct a System Dependency Graph (SDG) (HRB 1988) Context sensitivity: augment the SDG with summary edges by running the SummaryEdge algorithm (RHS+ 1994) Run the two-pass reachability algorithm on the augmented SDG (HRB 1988) Translate intermediate code to final code

Outline Motivation System overview Feature instrumentation Profiling Prediction modeling Predictor code generation Evaluation

Mantis prototype Feature instrumentor Javassist Profiler Perl Script Model generator Octave Predictor code generator Joeq Datalog analysis & slicer Quad2Jasmin Jasmin bytecode quadcode jasmincode bytecode Android executable generator bytecode dx aapt DEX APK

Evaluation Prediction accuracy – Benefit of non-linear terms – Benefit of slicing Predictor execution time – Benefit of slicing Prediction on different hardware platforms Prediction under background load Mantis offline component processing time Prediction error = |ActualTime –PredictedExecutionTime| / ActualTime Prediction time = Predictor_Running_Time / ActualTime Prediction error = |ActualTime –PredictedExecutionTime| / ActualTime Prediction time = Predictor_Running_Time / ActualTime

Evaluation Prediction accuracy – Benefit of non-linear terms – Benefit of slicing Predictor execution time – Benefit of slicing Prediction on different hardware platforms Prediction under background load Mantis offline stage processing time

Experiment setup Applications: Encryptor, Path Routing, Spam Filter, Chess Engine, Ringtone Maker, and Face Detection Galaxy Nexus running Android randomly generated inputs for each application : % basic-block coverage 100 inputs for training 5% : predictor execution time threshold

Prediction error and time ApplicationPrediction error (%) Prediction time (%) Encryptor Path Routing Spam Filter Chess Engine Ringtone Maker Face Detection % error by executing predictor costing at most 1.3% of app execution time

Prediction error and time ApplicationPrediction error (%) Prediction time (%) No. of detected features No. of chosen features Encryptor Path Routing Spam Filter Chess Engine Ringtone Maker Face Detection

Benefit of slicing Baselines: PE and BE Partial Execution (PE) : runs the instrumented program only until we obtain the chosen feature values Bounded Execution (BE) : runs the instrumented program for amount of time the Mantis predictor runs

Mantis vs. Partial Execution (PE) ApplicationMantis pred. time (%)PE pred. time (%) Encryptor Path Routing Spam Filter Chess Engine Ringtone Maker Face Detection

Mantis vs. Bounded Execution (BE) ApplicationMantis pred. error (%)BE pred. error (%) Encryptor Path Routing Spam Filter Chess Engine Ringtone Maker2.2 Face Detection4.9

Related work Predicting performance or resource consumption in databases, cluster computing, networking, program optimization, etc. Non-trivial features: program complexity, hardware simulation specificity, cooperative bug finding Worst-case behavior prediction in embedded/real-time systems

Conclusion Mantis: a framework that automatically generates accurate and efficient program performance predictors – Extracts information from program executions – Models performance with machine learning – Generates predictors with program analysis – Uses even features that occur late in execution

Backup Slides

Selected features and generated models ApplicationSelected featuresGenerated model Encryptormatrix-key size(f 1 ) loop count of encryption (f 2 ) c 0 f 1 2 f 2 + c 1 f c 2 f 2 + c 3 Path Routingbuild map loop count (f 1 )c 0 f c 1 f 1 + c 2 Spam Filterinner loop count of sorting (f 1 ) c 0 f 1 + c 1 Chess Engineno. of second-level game- tree nodes (f 1 ), no. of chess pieces (f 2 ) c 0 f c 1 f 1 f 2 + c 2 f c 3 Ringtone Makercut interval length (f 1 )c 0 f 1 + c 1 Face Detectionwidth (f 1 ), height (f 2 )c 0 f 1 f 2 + c 1 f c 2

Prediction errors varying the number of input samples

Prediction error and time of Mantis running with Galaxy S2 and Galaxy S3 ApplicationGalaxy S2Galaxy S3 Prediction error (%) Prediction time (%) Prediction error (%) Prediction time (%) Encryptor Path Routing Spam Filter Chess Engine Ringtone Maker Face Detection

Prediction error under background CPU-intensive loads ApplicationMantis pred. error (%) for the x% background CPU load x=0x=50x=75x=99 Encryptor Path Routing Spam Filter Chess Engine Ringtone Maker Face Detection

Predictor code generation: static program slicer challenges Inter-procedural analysis – Context-sensitive inter-procedural algorithm Alias analysis – Flow- and context-insensitive may-alias analysis with object allocation site heap abstraction Concurrency analysis – May-alias Executable slices – A set of rules we identified

Mantis offline stage processing time (in seconds) ApplicationProf.Model gen. SlicingTestTotalIter. Encryptor Path Routing Spam Filter Chess Engine Ringtone Maker Face Detection