Download presentation
Presentation is loading. Please wait.
Published byShannon Byrd Modified over 8 years ago
1
On the Evaluation of Space-Time Functions Jacob Beal, Kyle Usbeck Spatial Computing Workshop @ SASO 2011 Work sponsored by DARPA; the views and conclusions contained in this document are those of the authors and not DARPA or the U.S. Government.
2
Distributed function calls are hard! ● Action at a distance ● Recursion ● Function equivalence
3
Distributed function calls are hard! ● Action at a distance ● Recursion ● Function equivalence Devi ce #1 Devi ce #11 Devi ce #8 Devi ce #7 Devi ce #9 Devi ce #6 Devi ce #3 Devi ce #10 Devi ce #4 Devi ce #5 Devi ce #2 f(Device #6, #10, #11) f6f6 f11f11 f10f10
4
Distributed function calls are hard! ● Action at a distance ● Recursion ● Function equivalence f(0) f(1) f(2) f(3) f(4) f(3) f(2) f(1) f(0) Device #1Device #2
5
Distributed function calls are hard! ● Action at a distance ● Recursion ● Function equivalence ● Worse w. 1 st class fns Most “distributed” calls avoid the last two... [c.f. Beal, 2009] Devi ce #11 Devi ce #9 Devi ce #8 Devi ce #7 Devi ce #6 Devi ce #3 Devi ce #10 Devi ce #1 Devi ce #4 Devi ce #5 Devi ce #2 Track the ball
6
Approach: Continuous Model Advantages: simple, scalable, robust, adaptive... Continuous space & time Infinite number of devices See neighbors' past state Approximate with: Discrete network of devices Signals transmit state neighborhood device
7
Proto (def gradient (src)...) (def distance (src dst)...) (def dilate (src n) (<= (gradient src) n)) (def channel (src dst width) (let* ((d (distance src dst)) (trail (<= (+ (gradient src) (gradient dst)) d))) (dilate trail width))) neighborhood device Device Kernel evaluation global to local compilation discrete approximation platform specificity & optimization Global Local Discrete [Beal & Bachrach, '06]
8
Proto's Families of Primitives Pointwise Restriction FeedbackNeighborhood + restrict + 741 delay 48 any-hood nbr
9
Continuous Space-Time Programs tes t- sen se + Manifold Field Operator Return Value 1 1 3 12 4 (+ 1 (test-sense)) Well-defined iff: each operator's inputs and outputs have same domain.
10
Functions: Substitution Model Arg : x + 1 (def inc (x) (+ x 1)) (inc (test-sense)) inc: in c tes t- sen se + 1 1 3 12 4 Problems: code bloat, can't compile recursion or 1 st class fns
11
3 1 Functions: Call In-Place Model Arg : x + 1 (def inc (x) (+ x 1)) (inc (test-sense)) inc: in c tes t- sen se + 1 1 2 4 Better: allows “normal” compiled function calls 3 1
12
Recursion: Substitution vs. Call-in-Place (def factorial (x) (if (= x 0) 1 (* x (factorial (- x 1))))) factoria l To make call-in-place work, we'll need to be able to branch... factorial: Arg : x notnot 0 = muxmux - 1 1 * restri ct factor ial
13
Proto's Families of Primitives Pointwise Restriction FeedbackNeighborhood + restrict + 741 delay 48 any-hood nbr
14
Different Spaces Interacting Sub-manifold Selector
15
Different Spaces Interacting (let ((x (bool-sense))) (+ (restrict x 2) (restrict (not x) 3))) + boo l- sen se 2 no t 3 x T F F T 2 3 Not well-defined! 2+? ?+3
16
Syntactic safety: if & mux Well-defined iff selected inputs cover output. (if (bool-sense) 2 3) mu x boo l- sen se 2 no t 3 2 3 2 3 T F F T
17
Changing Field Domains (let ((z 3)) (if (bool-sense) 2 (+ z 1))) mu x boo l- sen se 2 no t + T F F T 2 1 1 3 3 Not well-defined! z
18
Changing Field Domains restric t F T 2 4 Well-defined iff output domain becomes subspace of input domain 4
19
Changing Field Domains (let ((z 3)) (if (bool-sense) 2 (+ z 1))) mu x boo l- sen se 2 no t + restric t T F F T 2 2 4 3 1 1 4 3 3 z
20
Branches and Function Calls mu x tes t- sen se 2 no t in c restric t T F F T 2 2 4 3 Arg : x + 1 inc: + 1 1 3 4 (let ((z 3)) (if (bool-sense) 2 (inc z))) 3 3 Manifold restriction → well-defined distributed function calls! z Call function iff domain not empty
21
Branches → Function Closure (let ((y 2)) (def inc-by (x) (+ x y)) (inc-by (test-sense))) Arg : x + inc-by: inc- by tes t- sen se 2 Problem: what if the function call was in an if? y
22
Branches → Function Closure (let ((y 2)) (def inc-by (x) (+ x y)) (inc-by (test-sense))) Arg : x + inc-by: inc- by tes t- sen se 2 restric t Solution: external references pass through restrict y
23
Distributed Recursion Arg : x factorial: Solution: external references pass through restrict fact oria l 1 3 (def factorial (x) (if (= x 0) 1 (* x (factorial (- x 1))))) Arg : x factorial: fact oria l 0 2 Arg : x factorial: fact oria l 1 Arg : x factorial: fact oria l 0
24
Proto's Families of Primitives Pointwise Restriction FeedbackNeighborhood + restrict + 741 delay 48 any-hood nbr
25
Branches → Feedback Operators no t mu x dchang e dt 0 + dela y (rep x 0 (+ x (dt))) Combination ensures well-defined x x
26
Proto's Families of Primitives Pointwise Restriction FeedbackNeighborhood + restrict + 741 delay 48 any-hood nbr
27
Neighborhood Ops (max-hood (+ (nbr (test-sense)) 3)) nb r Field~~ + Field~~ 3 tes t- sen se max- hood 3 1 6 4
28
Restricting Neighborhoods nb r restric t 3 1 F T Neighborhood must change domain too! Same problem as for restriction without if construct Solution: compile-time error checking
29
Implementation in Proto ● Previously, all function calls were inlined! ● Upgrades: ● Function call opcodes added to VM ● External references → implicit arguments ● Error checking for bad nbr / if interactions
30
Verification of Smaller Code Size
31
Distributed function call problems: ● Action at a distance ● Recursion ● Function equivalence ● 1 st class fns [c.f. Beal, 2009] ✔ ✔ (except part of 1 st class) ✔ (partly implemented)
32
Contributions & Future Work ● Evaluation model for space-time function calls ● Analysis of Proto operator interactions ● Implementation of call-in-place model in Proto ● Future work: 1 st -class fns, implement recursion http://proto.bbn.com/
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.