Potluck: Cross-Application Approximate Deduplication for Computation-Intensive Mobile Applications
Total Page:16
File Type:pdf, Size:1020Kb
Session 3B: Mobile Applications ASPLOS’18, March 24–28, 2018, Williamsburg, VA, USA Potluck: Cross-Application Approximate Deduplication for Computation-Intensive Mobile Applications Peizhen Guo Wenjun Hu Yale University Yale University [email protected] [email protected] Abstract 1 Introduction Emerging mobile applications, such as cognitive assistance Many emerging mobile applications increasingly interact and augmented reality (AR) based gaming, are increasingly with the environment, process large amounts of sensory in- computation-intensive and latency-sensitive, while running put, and assist the mobile user with a range of tasks. For on resource-constrained devices. The standard approaches example, a personal assistance application can “see” the to addressing these involve either ooading to a cloud(let) environment and generate alerts or audio information for or local system optimizations to speed up the computation, visually-impaired users [8]. A driving assistance applica- often trading o computation quality for low latency. tion [44] can render 3D scenes overlaid on the physical en- Instead, we observe that these applications often operate vironment to help the driver to visualize the surroundings on similar input data from the camera feed and share com- beyond the immediate views. These applications are usually mon processing components, both within the same (type of) computation-intensive and latency-sensitive, while running applications and across dierent ones. Therefore, dedupli- on resource-constrained devices. cating processing across applications could deliver the best The standard approaches to resolving these challenges of both worlds. involve either ooading to a cloud(let) [18, 21, 40, 43] or local In this paper, we present Potluck, to achieve approximate system optimizations to speed up the computation [15, 32], deduplication. At the core of the system is a cache service often trading o computation quality for low latency. that stores and shares processing results between applica- Instead, we observe that these applications often operate tions and a set of algorithms to process the input data to on similar, correlated input data with and share common maximize deduplication opportunities. This is implemented processing components, both within the same (type of) ap- as a background service on Android. Extensive evaluation plications and across dierent ones. While the input data shows that Potluck can reduce the processing latency for are rarely the same, they share temporal, spatial, or seman- our AR and vision workloads by a factor of 2.5 to 10. tic correlation due to the scene change behavior or the re- quirements of the applications. Moreover, a vast majority ACM Reference Format: of these applications exhibit a unique computation feature Peizhen Guo and Wenjun Hu. 2018. Potluck: Cross-Application in common: correlated and similar input values often yield Approximate Deduplication for Computation-Intensive Mobile Ap- the same processing results. Being lifestyle applications, it plications. In Proceedings of 2018 Architectural Support for Program- is highly probable for these applications to be installed on ming Languages and Operating Systems (ASPLOS’18). ACM, New York, NY, USA, 14 pages. hps://doi.org/hp://dx.doi.org/10.1145/ the same device [34]. This suggests that deduplicating pro- 3173162.3173185 cessing across applications and inputs could deliver the best of both worlds, i.e., achieving good performance within the resource constraints. Section 2 discusses these opportunities in detail. Deduplication is orthogonal to both ooading and Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies local system optimizations, and can be combined with either are not made or distributed for prot or commercial advantage and that for further optimization. copies bear this notice and the full citation on the rst page. Copyrights While recent works involve sharing computation, we ar- for components of this work owned by others than the author(s) must gue for more generic deduplication. Specically, StarFish [33] be honored. Abstracting with credit is permitted. To copy otherwise, or shares some intermediate results at the library level for com- republish, to post on servers or to redistribute to lists, requires prior specic permission and/or a fee. Request permissions from [email protected]. puter vision applications, MCDNN [23] enables sharing re- ASPLOS’18, March 24–28, 2018, Williamsburg, VA, USA sults from some layers of the deep neural network for dif- © 2018 Copyright held by the owner/author(s). Publication rights licensed ferent applications operating on top, and FlashBack [14] to the Association for Computing Machinery. relies on matching pre-dened sensing input and retrieving ACM ISBN ISBN 978-1-4503-4911-6/18/03...$15.00 pre-computed results for virtual reality (VR) applications. hps://doi.org/hp://dx.doi.org/10.1145/3173162.3173185 271 Session 3B: Mobile Applications ASPLOS’18, March 24–28, 2018, Williamsburg, VA, USA However, all of these were designed for (almost) exact match- being co-installed, even though they may not be running si- ing of the input (images), for specic (type of) applications multaneously. Further, they often operate in similar physical only and operate within the same type of applications. In environments, share common processing steps, and map a contrast, we take an unusual approach to deduplicate compu- group of similar input values to the same output. We discuss tation across correlated input values, across (dierent types these in detail next. of) applications, and in a fashion agnostic to the exact im- plementation of the processing procedures. 2.2 Input correlation and similarity In this paper, we present Potluck, a cross-application ap- The above applications all take input from the environment proximate deduplication service to achieve the above goal. or some context, directly or indirectly. Such input exhibits Potluck essentially stores and shares processing results be- similarity, within an application or across applications, due to tween applications and leverages a set of algorithms to assess the activities of the mobile user showing spatial and temporal the input similarity to maximize deduplication opportuni- correlation. ties, as detailed in Section 3. We carefully design an input Temporal correlation. We can view the combined video in- matching algorithm to improve the processing performance put to all the applications as a continual camera feed. In other without compromising the accuracy of the results. Potluck words, assuming there is a never-ending centralized camera is implemented as a background service on Android that feed to the mobile device, dierent applications simply take a provides support across applications (Section 4). Extensive subset of the frames as needed. From standard video analysis, evaluation shows that our system can potentially reduce the signicant temporal correlation exists between successive processing latency for our benchmark augmented reality and frames because the scene rarely changes completely within vision applications by a factor of 2.5 to 10 (Section 5). a short interval, and this has been leveraged extensively in In summary, we make the following contributions: video compression. In most cases, the main objects of interest First, we highlight deduplication opportunities across emerg- in these scenes are slightly distorted versions of one another ing vision-based and AR-based mobile applications. These by some translation and/or scaling factor. arise from various sources of correlation in their input, com- mon processing components they leverage, and the co-installation Spatial correlation. It is common for humans to follow of these applications. along recurrent trajectories, for example, due to their regular Second, in view of the opportunities above, we propose a commuting schedules or frequenting a favorite restaurant set of cross-application approximate deduplication technique from time to time. Therefore, there is some level of recurrence to achieve both fast processing and accurate results. To the of the scenes obtained as part of those activities, though po- best of our knowledge, this is the rst such attempt. tentially taken from dierent view points and partially dier- Third, we build the system as a background service. Ex- ent environments, such as dierent lighting conditions and tensive evaluation conrms its benet is signicant. surrounding backgrounds. The actual images might show dierent color bias, for example. Such correlation can be 2 Motivation identied using SURF [12] like approaches. Semantic correlation. A further situation arises when the 2.1 Motivating applications same object or the same type of objects appears in com- Among the fastest growing applications, vision-based cog- pletely unrelated background scenes and at dierent times. nitive assistance applications and augmented reality (AR) For example, when a road sign is detected at dierent places based applications are two representative categories. and times, regardless of the exact sign, a driver assistance As an example cognitive application, Google Lens [10] app simply generates an alert. Since many applications in- continuously captures surrounding scenes via the camera, terpret the scene to related abstract notions of objects or recognizes objects using deep learning techniques, and then faces, many seemingly dierent images can be classied to presents related