starfish
play

Starfish Efficient Concurrency Support for Computer Vision - PowerPoint PPT Presentation

Starfish Efficient Concurrency Support for Computer Vision Applications Robert LiKamWa Lin Zhong Rice University 1 In the year 2020... 2 Continuous mobile vision Where did I place Remind me to Oh, I haven't


  1. Starfish Efficient ¡Concurrency ¡Support for ¡ Computer ¡Vision ¡Applications Robert ¡LiKamWa Lin ¡Zhong Rice ¡University 1

  2. In ¡the ¡year ¡2020... 2

  3. Continuous ¡mobile ¡vision Where did I place Remind me to Oh, I haven't my keys? tell Lin to let talked to Fred me graduate! recently... ? ? ? ? ? ? ? ? ? ? 3

  4. Continuous ¡mobile ¡vision Energy ¡consumption ¡overwhelms ¡wearable ¡battery! Insufficient ¡concurrency ¡support ¡for ¡vision! 4

  5. Application Capture ¡Service Vision ¡ Headers Vision ¡ Library 5

  6. Application Capture ¡Service Vision ¡ Scale Headers Face 6

  7. Vision Library 200+ ¡ms Vision Library 200+ ¡ms Vision Library 200+ ¡ms Camera ¡is ¡overworked Computation ¡is ¡overworked We ¡need ¡efficient ¡concurrency ¡support! 7

  8. Vision Library Vision Library Vision Library Observations: • Vision ¡apps ¡utilize ¡ common ¡vision ¡library 8

  9. Scale Face common ¡ primitives Scale Face Scale SURF Observations: • Vision ¡apps ¡utilize ¡ common ¡vision ¡library • Capture/Computation ¡is ¡ redundant across ¡apps 9

  10. Scale Face common ¡ primitives Scale Face Scale SURF Observations: • Vision ¡apps ¡utilize ¡ common ¡vision ¡library • Capture/Computation ¡is ¡ redundant across ¡apps 10

  11. Proposal: ¡Split-­‑process ¡design ¡ for ¡ centralized ¡control ¡ Scale SURF Face Share ¡computations, Key ¡Idea: Reduce ¡redundancy 11

  12. Starfish Vision ¡ Library Library Starfish ¡Core Service Starfish Vision ¡ Library Library Starfish Library Starfish ¡Core ¡Service Starfish ¡Library Executes, ¡tracks, ¡and ¡shares Uses ¡vision ¡headers ¡ to ¡intercept ¡library ¡calls library ¡call ¡computations 12

  13. Starfish Vision ¡ Library Library Starfish ¡Core Service Starfish Vision ¡ Library Library Starfish Library Starfish Split-­‑process ¡library ¡solution ¡for ¡ efficient, ¡transparent ¡multi-­‑app ¡service 13

  14. faceDetect(img) Starfish Vision ¡ Starfish ¡Core Library Library Function ¡Cache ¡ Arg ¡Search faceDetect(img) Starfish Vision ¡ Library Library Exec. Function ¡Cache Starfish Storage/Retrieval Library First ¡Call Subsequent ¡Call(s) Skip ¡execution (0 ¡ms) Execute ¡call ¡(20-­‑200 ¡ms) Store ¡results Retrieve ¡results 14

  15. Starfish Vision ¡ Starfish ¡Core Library Library Cache ¡ Search Starfish Vision ¡ Library Library Function Cache Starfish Library Starfish Share ¡computations, Reduce ¡redundancy 15

  16. Starfish Vision ¡ Starfish ¡Core Library Library Cache ¡ Search Starfish Vision ¡ Library Library Function Cache Starfish Library Timing ¡optimizations: + ¡Reuse ¡"Fresh ¡Frames” ¡to ¡promote ¡cache ¡hits + ¡Delay ¡call ¡return ¡to ¡encourage ¡device ¡sleep 16

  17. Starfish Starfish ¡Core Library Cache ¡ Search Starfish Library Vision ¡ Mitigating ¡ Library Split-­‑Process ¡Overhead Function Starfish Cache Library + ¡Promote ¡sharing ¡by ¡reusing ¡"Fresh ¡Frames” + ¡Maintain ¡code ¡privacy ¡by ¡delaying ¡call ¡return + ¡Manage ¡concurrent ¡requests ¡through ¡fine-­‑grained ¡locks 17

  18. Starfish Starfish ¡Core Library Cache ¡ Search Starfish Library Vision ¡ Library Function Starfish Cache Library Reduce ¡expense ¡of ¡argument ¡passing Avoid ¡library ¡object ¡modification 18

  19. Split-­‑Process ¡in ¡the ¡Literature • Object ¡Redefinition • Lightweight ¡RPC Zero-­‑copy Require ¡library ¡redesign ¡ • SUN ¡RPC • Cloud ¡Transfer ¡ • COMET Object ¡tracking • MAUI Optimized ¡for ¡code ¡offload • CloneCloud 19

  20. Split-­‑Process ¡Argument ¡Passing Starfish ¡Library Shared ¡Memory Starfish ¡Core faceDetect( ) 3.5 ¡ms Vision ¡ Library Execution Goal: ¡Minimize ¡deep ¡copy ¡overhead deep ¡copy is ¡expensive ¡ 20

  21. 1) ¡ Protected ¡shallow ¡copy Starfish ¡Library Shared ¡Memory Starfish ¡Core CoW faceDetect( ) Vision ¡ Library Execution CoW Issue ¡copy-­‑on-­‑write ¡(mprotect) ¡on ¡received ¡objects 21

  22. 2) ¡ Direct ¡output ¡marshalling Starfish ¡Library Shared ¡Memory Starfish ¡Core CoW faceDetect( ) Vision ¡ Library Execution malloc() CoW Write ¡new ¡data ¡directly into ¡shared ¡memory 22

  23. 3) ¡ Reuse ¡arguments ¡from ¡prior ¡calls Starfish ¡Library Shared ¡Memory Starfish ¡Core CoW faceDetect( ) Vision ¡ Argument ¡ Library (img, ¡shm_ptr) Table Execution malloc() CoW Track, ¡reuse ¡previous ¡inputs/outputs 23

  24. (Usually) ¡Zero-­‑Copy ¡Argument ¡Passing Starfish ¡Library Shared ¡Memory Starfish ¡Core CoW faceDetect( ) Vision ¡ Argument ¡ Library (img, ¡shm_ptr) Table Execution malloc() CoW + ¡Reduce ¡deep ¡copies ¡through ¡argument ¡reuse + ¡Reduce ¡allocation ¡through ¡buffer ¡reuse ¡ 24

  25. Starfish ¡Optimizations • Share ¡Computations • Maintain ¡expectations ¡ ¡of ¡ developers ¡& ¡users • Increase ¡sharing ¡efficiency ¡ by ¡relaxing ¡timing • Decrease ¡redundancy • Reduce ¡argument ¡copy • Reuse ¡memory ¡buffers 25

  26. Experimental ¡Platform OpenCV ¡+ ¡Android ¡+ ¡Google ¡Glass ¡ Monsoon ¡Power ¡Monitor Benchmarks: 1) ¡Per-­‑call ¡micro-­‑benchmarks 2) ¡Multi-­‑app ¡benchmarks OMAP4430 ¡dual-­‑core ¡Cortex-­‑A9 ¡ pinned ¡to ¡600 ¡MHz 26

  27. Memory ¡optimizations ¡ cut ¡Starfish ¡overhead ¡in ¡half Library'call'execution:' resize() resize() First ¡Call Native& Native : 21 ¡ms Prepare&Inputs& Starfish&Unopt.& Unopt. ¡Starfish : 42 ¡ms ¡ Send&Inputs& Starfish& Starfish : 24ms Search&Cache& Exec.&Function& Allocate&Outputs& Prepare&Outputs& Receive&Outputs& 0" 5" 10" 15" 20" 25" Execution&time&(ms)& 27

  28. Memory ¡optimizations ¡ cut ¡Starfish ¡overhead ¡in ¡half Library'call'execution:' resize() resize() First ¡Call Native& Native : 21 ¡ms Prepare&Inputs& Starfish&Unopt.& Unopt. ¡Starfish : 42 ¡ms ¡ Send&Inputs& Starfish& Starfish : 24ms Search&Cache& Second ¡Call Exec.&Function& Native : 21 ¡ms Allocate&Outputs& Unopt. ¡Starfish : 10 ¡ms ¡ Prepare&Outputs& Starfish : 6 ¡ms ¡ Receive&Outputs& 0" 5" 10" 15" 20" 25" Execution&time&(ms)& Starfish ¡works ¡well ¡when native ¡function ¡execution ¡>> ¡5 ¡ms 28

  29. Places ¡where ¡Starfish ¡ fails • 5-­‑6 ¡ms ¡performance ¡overhead ¡per-­‑call: – Bad ¡for ¡fast ¡computations – Bad ¡with ¡large, ¡deep ¡arguments • Non-­‑cacheable ¡functions – Random, ¡temporal, ¡external ¡dependencies – Functions ¡with ¡specific ¡parameters But ¡great ¡for ¡many ¡high-­‑level ¡functions: Face ¡detect, ¡Corner ¡detect, ¡Image ¡resize 29

  30. Starfish ¡vs. ¡Multi-­‑App ¡Workload If ¡Lin ¡then ¡That Social ¡Logger Facebook Google+ Twitter MySpace Whatsapp ... Face Face Scale Detect Recog 0.3 ¡FPS 30

  31. When ¡running ¡multiple ¡apps, ¡ Starfish ¡achieves ¡higher ¡performance Higher ¡ Na/ve" Starfish" is ¡ 5" better 4.5" 4" 3.5" 3" Frame&Rate& 2.5" (FPS)& 2" 1.5" 1" 0.5" 0" 31 1" 2" 3" 4" 5" 6" 7" 8" 9" 10" Number&of&App&Instances&

  32. When ¡running ¡multiple ¡apps, Starfish ¡draws ¡single-­‑app ¡power Na.ve" Starfish" 2500" 2000" 1500" Power& Consump-on& (mW)& 1000" 500" 0" Lower 1" 2" 3" 4" 5" 6" 7" 8" 9" 10" is ¡ Number&of&App&Instances& better 32

  33. When ¡running ¡multiple ¡apps, Starfish ¡draws ¡single-­‑app ¡power Na.ve" Starfish" 2500" 2000" 1500" Power& Consump-on& (mW)& 1000" 500" 0" 1" 2" 3" 4" 5" 6" 7" 8" 9" 10" Number&of&App&Instances& Starfish ¡achieves ¡efficient ¡concurrency ¡support! ¡ 33

  34. Starfish Vision ¡ Starfish ¡Core Library Library Cache ¡ Search Starfish Vision ¡ Library Library Function Cache Starfish Library Starfish Share ¡computations, Reduce ¡redundancy 34

  35. Continuing mobile ¡vision Mitigating Preserving Designing Analog User/Subject Signal ¡Chain Efficient Bandwidth Privacy Systems 35

  36. Starfish: ¡ Share ¡computations, ¡Reduce ¡redundancy Transparent, ¡efficient ¡library ¡call ¡caching • Timing ¡optimizations ¡for ¡ frame ¡freshness ¡and ¡performance ¡preservation • Memory ¡optimizations for ¡ minimal ¡deep ¡copy ¡and ¡small ¡cache ¡footprint Google ¡Glass ¡Experiments: • Low ¡overhead ¡ Memory ¡optimizations ¡slash ¡overhead ¡in ¡half • Reduced ¡power ¡draw Multi-­‑app ¡workloads ¡draw ¡Single ¡app ¡ ¡power • 36

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend