Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros &...

40
http://www.cs.bu.edu/groups/wing/ If You Build It, They Will Come: The SNBENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science Department Boston University
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    213
  • download

    0

Transcript of Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros &...

Page 1: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

http://www.cs.bu.edu/groups/wing/

If You Build It, They Will Come:The SNBENCH Architecture

Adam BradleyAzer Bestavros & Michael Long

Computer Science DepartmentBoston University

Page 2: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 2

Before we begin…

WelcomeTo

Summer!

Page 3: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 3

Sensorium Infrastructure @ BU

Sensorium: A common space equipped with video sensors (VS) for ubiquitous recognition and tracking of activities therein

Infrastructure: Range of VS Elements Programmable VS Network Backend compute engines Backend TByte storage Mobile/wireless query units Research Engineer

Page 4: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 4

snBench

The Sensorium is the computer…Design/implement the programming and run-time infrastructure necessary for developers to specify and deploy truly distributed applications over a heterogeneous network of Sensing Elements (SEs) and Computing Elements (CEs)

What sensors could I use and what functionality do I

get from them?

Page 5: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 5

snBench: Goals

“Write Once, Run… Wherever” Don’t program nodes…

Program the network! Start with building blocks

Sensors Stock algorithms (edge detect, face count, FFT) Dynamic modules (novel algorithms)

Glue together with high-level language Conditionals, loops, functions…

Pretend the network isn’t there “Single System Image” Programming Paradigm

Page 6: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 6

snBench: Programming Cycle

Program Program specified by gluing together building blocks

using SNAFU language Compile

SNAFU program is compiled to produce a plan of execution expressed in STEP

Map and Link Service Dispatcher decomposes STEP plans

into smaller linked dispatch-able STEPs Load and Execute

STEP plans are dispatched (i.e., loaded) into SXE execution environments

Page 7: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 7

SNAFU: SNet Apps as FUnctions!

Functional specification language e.g., identify the face seen through camera 1

identify(facefind(snapshot(cam1)))

Page 8: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 8

SNAFU: SNet Apps as FUnctions!

Use “annotative” functions for constraints e.g., minimum acceptable resolution

e.g., what streams can be “exposed”

public(facecount(snapshot(private(cam1)))))

facecount(resn(800x600x24b,snapshot(cam1)))

Page 9: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 9

SNAFU: SNet Apps as FUnctions!

Events in time captured by “triggers” e.g., motion detected at night triggers email

email(“[email protected]”, trigger( (motion(snapshot(cam2)) && (2am<NOW<4am)), snapshot(cam2)))

Page 10: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 10

SNAFU: SNet Apps as FUnctions!

Three trigger types: trigger(p,a): “Wait until p”

do { /* no-op */ } until (p); a; level_trigger(p,a): “Whenever p”

while (true) { if (p) a; }; edge_trigger: “Whenever p becomes true”

while (true) { if (p) { a; while (p) {} } }; Value of trigger is value of a’s evaluation Level and edge triggers produce streams

a.k.a. “persistent queries” living in network

Page 11: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 11

SNAFU: SNet Apps as FUnctions!

Trigger QoS (Scheduling annotations)

period(100ms, level_trigger(f(cam1), g(cam1)))

Page 12: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 12

SNAFU: SNet Apps as FUnctions!

Retrieving values from triggers: Non-blocking read - Last result Blocking read - Wait for next result Fresh read - Wait for a “from scratch” result

Recursion: LAST_TRIGGER_EVALUATION term

Last value produced by innermost(?) trigger term Not sure what to call it… “head recursion” ?

Page 13: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 13

STEP: Sensorium Typed Exec Plan

cam2

snapshot

motion

clock 4am2am

< <

&&

edge_trigger

email

[email protected]

“Instruction Set Architecture” is a DAG

email(“[email protected]”, edge_trigger( (motion(snapshot(cam2)) && (2am<NOW<4am)), snapshot(cam2)))

Page 14: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 14

STEP: Sensorium Typed Exec Plan

Notes: Evaluation percolates

up from leaf nodes toward roots.

Sensor nodes provide fresh data at all times.

Function nodes evaluate once then disable themselves.

Trigger nodes can re-enable children for re-evaluation.

cam2

snapshot

motion

clock 4am2am

< <

&&

edge_trigger

email

[email protected]

Page 15: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 15

snBench: Runtime Setting

SNAFU-to-STEP compiler SXE: Sensorium eXecution Environment SD: Service Dispatcher

SD, SXE

SXESXE

SXE

SXE

SXE

SXE

Compiler, Web Browser, SXE(?)

Page 16: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 16

Map, Link, and Dispatch

SXE

SXE

SXE

edge_trigger

email

[email protected]

cam2

snapshot

motion

clock 4AM2AM

< <

&&

Page 17: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 17

trigger

email

[email protected]

Map, Link, and Dispatch

SXE

SXE

SXE

motion

2AM clock 4AM

< <

logical_and

cam2

snapshot

edge_trigger

email

[email protected]

motion

clock 4AM2AM

< <

&&

cam2

snapshot

Page 18: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 18

Why snBench?

A Sensorium Research Catalyst Extrinsic research

Accessible framework for developing distributed sensing applications in heterogeneous networks

Intrinsic research Languages, type systems, compilers, graph

algorithms, schedulers, QoS engines, naming, etc. to make the framework efficient/useful/flexible

Supporting research System context, supporting middleware/services

Page 19: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 19

Extrinsic Research

Flexible substrate for experimenting with distributed sensor applications Extensible w/ new algorithms (“opcodes”) Trade some speed for versatility and

easy re-programmability/re-tasking

Abstracts away “the network” Vision researchers don’t need to understand

communication protocols, RT schedulers, network resource reservation, etc.

Page 20: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 20

Extrinsic Research: Sensorium Target Applications

Assistive Environments e.g. for home/hospice/elder care/…

Safety Monitoring e.g. in factories/daycare/garages/subways…

Intelligent Spaces e.g. for classrooms/meeting rooms/theaters/farms…

Secure Facilities and Homeland Security Uses e.g. at airports/embassies/prisons/CS labs/…

People Flow/Activity Studies e.g. at malls/interstates/…

Page 21: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 21

Intrinsic/Extrinsic Research

Why limit ourselves to passive sensing?

Control actuators with snBench programs!

Multi-DOF Cameras Mobile Sensors Robots

Control theory issues…

Page 22: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 22

Intrinsic Research

Scheduling/Linking/Binding How did we arrive at this partitioning? How did we arrive at these assignments?

SXE

SXE

SXE

edge_trigger

email

[email protected]

cam2

snapshot

motion

clock 4AM2AM

< <

&&

Page 23: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 23

edge_trigger

email

[email protected]

cam2

snapshot

motion

clock 4AM2AM

< <

&&

Scheduling: Processing Capacity

SXE

SXE SXE

SXE

Load averages? Busy rate?

STEP nodes/s?Realtime scheduler?

?

Page 24: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 24

Scheduling: Network Capacity

SXE

SXESXE

edge_trigger

email

[email protected]

cam2

snapshot

motion

clock 4AM2AM

< <

&&

SXE

100Mb/s20%

512kb/s75%

8Mb/s95%

100Mb/s40%

100Mb/s10%

?

Page 25: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 25

Scheduling: Code Presence

edge_trigger

email

[email protected]

cam2

snapshot

motion

clock 4AM2AM

< <

&&

SXE

SXESXE

SXEmotion

oflow

delta

[empty]

delta

facefind

bodytrack

email

motion

email

[empty]

[empty]

snapshot

delta

?

Page 26: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 26

Intrinsic Research

SXE

SXE SXE

edge_trigger

email

[email protected]

cam2

snapshot

motion

clock 4AM2AM

< <

&&

SXE

100Mb/s20%

512kb/s75%

8Mb/s60%

100Mb/s40%

100Mb/s10%

?

motion

email

[empty]

[empty]

motion

oflow

delta

[empty]

delta

facefind

bodytrack

email

snapshot

delta

Scheduling = Constrained Graph embedding and

optimization!

Page 27: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 27

More Scheduling

Multiple simultaneous programs may share STEP sub-graphs:

email(“[email protected]”, block( edge_trigger(motion(snapshot(cam2)) && (2am<NOW<4am), snapshot(cam2)))

trigger( facerecognizer( block( edge_trigger(motion(snapshot(cam2)) && (2am<NOW<4am), snapshot(cam2))), facelibrary(“Adam Bradley”)), email(“[email protected]”, “He’s working late again.”))

Page 28: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 28

email(“[email protected]”, block( edge_trigger(motion(snapshot(cam2)) && (2am<NOW<4am), snapshot(cam2)))

trigger( facerecognizer( block( edge_trigger( motion(snapshot(cam2)) && (2am<NOW<4am), snapshot(cam2))), facelibrary(“Adam Bradley”)), email(“[email protected]”, “He’s working late again.”))

More Scheduling: CSE

Common Subexpression/Subgraph Elimination

cam2

snapshot

motion

clock 4AM2AM

< <

&&

edge_trigger

email

[email protected]

cam2

snapshot

motion

clock 4am2am

< <

&&

edge_trigger

email

[email protected]

trigger

“He’s working late again”

facerecognizer

facelibrary

“Adam Bradley”

Page 29: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 29

trigger( facerecognizer( block( edge_trigger( motion(snapshot(cam2)) && (2am<NOW<4am), snapshot(cam2))), facelibrary(“Adam Bradley”)), email(“[email protected]”, “He’s working late again.”))

email(“[email protected]”, block( edge_trigger(motion(snapshot(cam2)) && (2am<NOW<4am), snapshot(cam2)))

Com

mon

Subgra

ph

More Scheduling: CSE

Common Subexpression/Subgraph Elimination

cam2

snapshot

motion

clock 4AM2AM

< <

&&

edge_trigger

email

[email protected]

cam2

snapshot

motion

clock 4am2am

< <

&&

edge_trigger

email

[email protected]

trigger

“He’s working late again”

facerecognizer

facelibrary

“Azer Bestavros”

Page 30: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 30

trigger( facerecognizer( block( edge_trigger( motion(snapshot(cam2)) && (2am<NOW<4am), snapshot(cam2))), facelibrary(“Adam Bradley”)), email(“[email protected]”, “He’s working late again.”))

email(“[email protected]”, block( edge_trigger(motion(snapshot(cam2)) && (2am<NOW<4am), snapshot(cam2)))

More Scheduling: CSE

cam2

snapshot

lights_are_on

clock 4AM2AM

< <

logical_and

edge_trigger

email

[email protected]

cam2

snapshot

lights_are_on

clock 4AM2AM

< <

logical_and

edge_trigger

email

[email protected]

trigger

“He’s working late again”

facerecognizer

facelibrary

“Azer Bestavros”

Common Subexpression/Subgraph Elimination

Page 31: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 31

trigger( facerecognizer( block( edge_trigger( motion(snapshot(cam2)) && (2am<NOW<4am), snapshot(cam2))), facelibrary(“Adam Bradley”)), email(“[email protected]”, “He’s working late again.”))

email(“[email protected]”, block( edge_trigger(motion(snapshot(cam2)) && (2am<NOW<4am), snapshot(cam2)))

More Scheduling: CSE

cam2

snapshot

lights_are_on

clock 4AM2AM

< <

logical_and

edge_trigger

email

[email protected]

cam2

snapshot

lights_are_on

clock 4AM2AM

< <

logical_and

edge_trigger

email

[email protected]

trigger

“He’s working late again”

facerecognizer

facelibrary

“Azer Bestavros”

Common Subexpression/Subgraph Elimination

SXE

SXE

SXE

Page 32: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 32

Intrinsic Research

Program Optimization

What to optimize? STEP Node count? Trigger count? (More or less?)

let x = snapshot(cam2) inemail(“[email protected]”, block( edge_trigger(motion(x) && (2am<NOW<4am), x)))

let x = snapshot(cam2) intrigger( edge_trigger(motion(x) && (2am<NOW<4am), true), email(“[email protected]”, x))

Page 33: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 33

More Scheduling: Architecture

What if we can’t run SXE on a node?

STEP: a compile-able virtual ISA Embedded C dialects? Java ME?

Support alternate “linking” protocols Serial (base station) SN wireless protocols

(e.g. 802.15.4)

Page 34: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 34

Intrinsic Research

Better Programming Languages Alternate Execution Environments

STEP

SNAFUSnQL SnLOG

SnC

SXEJ2ME

Native CJXTA

Page 35: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 35

Intrinsic Research

Scheduling/Real-Time Type Systems

Resource Management Type Inference

Actualizers (SD is a “mini-ITM”) Static and dynamic “type checks”

period(100ms, let x = period(75ms, edge_trigger(y, z)) in edge_trigger(f(x), g(x))

level_trigger( state(4MB, entropymeasure( bw(2MBps, deltastream(cam1)))), period_gt(250ms, signal(actuator1, true))

Page 36: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 36

Intrinsic Research

Intentional Naming Naming sensors by identity:

“The webcam in Azer’s Office” Naming sensors by property:

“Any two cams which see point X from perspectives >90 degrees

apart” Naming sensors by dynamic attribute:

“Any cam which sees Adam” May depend upon existence of persistent queries. What

p.q.’s should we instantiate to produce the highest odds of success at the lowest cost?

Wearables as part of the Sensorium?

Page 37: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 37

Intrinsic Research

How do you offer RealTime, QoS, etc. if you don’t know about the timing of atomic operations? Live profiling of new opcodes Speculative/probabilistic scheduling Run-time scheduler parameter changes

Page 38: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 38

Supporting Research

SXE Implementations and Internals SXE itself as high-performance service

Real-time scheduling Self-profiling Fast I/O delivery (Lives in kernel sandbox?)

Programmer can upload their own functions C++, Java, C#, Perl, Matlab, whatever… Automatically generate glue to link with SXE Sandboxing issues

Page 39: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

May 13, 2005 The snBench Architecture 39

Current Status

Whitepaper SNAFU and STEP syntax (tentative) SNAFU type principles (tentative)

1G Implementation (work in progress) Java

SNAFU-to-STEP compiler Service Dispatcher SXE (with HTTP-based interface) JAR-based extensibility

Expect first live demo mid-summer

Page 40: Http:// If You Build It, They Will Come: The SN B ENCH Architecture Adam Bradley Azer Bestavros & Michael Long Computer Science.

http://www.cs.bu.edu/groups/wing/

If You Build It, They Will Come:The SNBENCH Architecture

Adam BradleyAzer Bestavros & Michael Long

Computer Science DepartmentBoston University