SlideShare a Scribd company logo
Arc
An IR for Batch and Stream Programming
Lars Kroll*, Klas Segeljakt*, Paris Carbone†, Christian Schulte*, Seif Haridi*†
*KTH Royal Institute of Technology, Stockholm, Sweden – †RISE SICS, Stockholm, Sweden
presented by Lars Kroll at the 17th Symposium on Data Base Programming Languages (DBPL 2019) in Phoenix, Arizona, USA in June 2019
Arc: An IR for Batch and Stream Programming
π
Tensors
Relational Streams
Dynamic Graphs
The Challenge
!2
knowledge
∞
Data Data Programming Systems Decision
Making
Arc: An IR for Batch and Stream Programming
π
Tensors
Relational Streams
Dynamic Graphs
Arcon: A Streaming Runtime for Heterogeneous Hardware
!3
Arcon
Worker
worker specific binaries
Worker Worker
Arc: An IR for Batch and Stream Programming
Arcon Compiler Pipeline
!4
Arcon
Arc (High Level IR)
Frontends
Logical Dataflow IR
Physical Dataflow IR
Binaries
Arc: An IR for Batch and Stream Programming
Arc Compiler Overview
!5
Lexer/Tokeniser
Parser
Macro Expansion
Type Inference
Arc
Descriptor
Translate to Dataflow IR
OptimisationsOptimisationsOptimisations
until Fixpoint
Antlr generated
Constraint based
implemented in
Arc: An IR for Batch and Stream Programming
What is Arc?
!6
• The Weld IR*
• A restrictive language for describing data transformations
• Pure expressions without side-effects (except: CUDFs)
• Collections: Read-only data types (e.g., vec[T], dict[T])
• Builders: Write-only data types (e.g., appender[T], merger[T], groupbuilder[T])
• Calling result on a builder returns the associated collection type (or a primitive for merger)
• Arc extends the Weld for streaming
• Observation
– Stream Sources are read-only
– Stream Sinks are write-only
– Connect Sinks to Sources via Channels
• Source is a collection stream[T]
• Sink is a builder streamappender[T]
• Calling result on a Sink returns a Source and creates a Channel between them
*Palkar, Shoumik, et al. "Weld: A common runtime for high performance data analytics." Conference on Innovative Data Systems Research (CIDR). 2017.
Arc: An IR for Batch and Stream Programming
|input:vec[i32]|
result(
for(input:vec[i32],
appender[i32],
|app:appender[i32], _:i64, i:i32|
merge(app, i + 5)))
Weld Example
!7
Weld
macro map(data, func) = (
result(for(data, appender, |b, i, x| merge(b, func(x))))
);
cmp.Weld
map(i+5)[1, 2, 3, 4, 5] [6, 7, 8, 9, 10]
Arc: An IR for Batch and Stream Programming
Arc Example 1
!8
|input:Stream[i32], output: StreamAppender[i32]|
for(input,
output,
|out, i|
merge(out, i + 5))
Arc
map(i+5)source (input) sink (output)
Arc: An IR for Batch and Stream Programming
Arc Example 1
!9
|input:Stream[i32], output: StreamAppender[i32]|
for(input: Stream[i32],
output: StreamAppender[i32],
|out: StreamAppender[i32], i:i32|
merge(out, i + 5): StreamAppender[i32])
Arc
map(i+5)source (input) sink (output)
Arc: An IR for Batch and Stream Programming
Arc Example 2
!10
|input:Stream[i32], output: StreamAppender[i32]|
for(input,
output,
|out, i|
if(i % 2 == 0,
merge(out, i),
out))
Arc
filter(i%2==0)source (input) sink (output)
Arc: An IR for Batch and Stream Programming
Arc Example 3
!11
|source:Stream[i32],
evenSink:StreamAppender[i32],
oddSink:StreamAppender[i32]|
let mapped = result(
for(source,
StreamAppender[i32],
|out, i| merge(out, i + 5)));
for(mapped, evenSink, |out, i|
if (i % 2 == 0, merge(out, i), out));
for(mapped, oddSink, |out, i|
if (i % 2 != 0, merge(out, i), out))
Arc
source
evenSink
oddSink
map(i+5)
filter(i%2==0)
filter(i%2!=0)
Arc: An IR for Batch and Stream Programming
Arc Optimisations
!12
• Operator Reordering
• Redundancy Elimination
• Operator Separation (Fission)
• Operator Fusion
Arc: An IR for Batch and Stream Programming
Arc Example 3
!13
Arc
source
evenSink
oddSink
map(i+5) then if(j%2==0)
|source:Stream[i32],
evenSink:StreamAppender[i32],
oddSink:StreamAppender[i32]|
for(source,
{evenSink,oddSink},
|out, i|
let j = i + 5;
if(j % 2 == 0,
{merge(out.$0, j),out.$1},
{out.$0, merge(out.$1, j)}))
Arc: An IR for Batch and Stream Programming
Arc Windows
!14
|input:Stream[{u64, i32}], output: StreamAppender[{u64, i32}]|
for(input,
Windower[Unit, Merger[i32,+]](
|e: {u64, i32},_,_| {[e.$0/600L], ()},
|wm: Watermark, open: Vec[WindowId], _|
{filter(open, |id: WindowId| id < wm/600L), ()},
|wid: WindowId, window: Merger[i32,+]| {wid, result(window)}
),
|win: Windower[{u64, i32}], e: {u64, i32}|
merge(win, e)
)
assign
trigger
aggregate
lift
{ts,15} {ts,3} {ts,24} {ts,11} {ts,6} {ts,21}
{ts,18}
∑
{ts,24}
∑
{ts,38}
∑
Disc.Ty. Aggr.Ty.
Arc: An IR for Batch and Stream Programming
Summary
!15
• Arcon deploys continuous streaming
analytics on heterogenous hardware
• Arc is its high-level IR to abstract
across frameworks and languages
• Arc extends Weld’s side-effect free
approach for streams and windows
• Arc allows logical dataflow
optimisations
Arc
Arcon

More Related Content

What's hot

One-Click CFD Users' Guide
One-Click CFD Users' GuideOne-Click CFD Users' Guide
One-Click CFD Users' Guide
Julien de Charentenay
 
CHITRARASU DEIVASIGAMANI - Work Portfolio
CHITRARASU DEIVASIGAMANI - Work PortfolioCHITRARASU DEIVASIGAMANI - Work Portfolio
CHITRARASU DEIVASIGAMANI - Work Portfolio
Chitrarasu Deivasigamani
 
A Virtual Machine Placement Algorithm for Energy Efficient Cloud Resource Res...
A Virtual Machine Placement Algorithm for Energy Efficient Cloud Resource Res...A Virtual Machine Placement Algorithm for Energy Efficient Cloud Resource Res...
A Virtual Machine Placement Algorithm for Energy Efficient Cloud Resource Res...
SuvomDas
 
Vlsi assisted nonrigid registration using modified demons algorithm
Vlsi assisted nonrigid registration using modified demons algorithmVlsi assisted nonrigid registration using modified demons algorithm
Vlsi assisted nonrigid registration using modified demons algorithm
jpstudcorner
 
INAC Online Hazards Database App
INAC Online Hazards Database AppINAC Online Hazards Database App
INAC Online Hazards Database App
Gerry James
 
Extracting a Rails Engine to a separated application
Extracting a Rails Engine to a separated applicationExtracting a Rails Engine to a separated application
Extracting a Rails Engine to a separated application
Jônatas Paganini
 
ICIAM 2019: Reproducible Linear Algebra from Application to Architecture
ICIAM 2019: Reproducible Linear Algebra from Application to ArchitectureICIAM 2019: Reproducible Linear Algebra from Application to Architecture
ICIAM 2019: Reproducible Linear Algebra from Application to Architecture
Jason Riedy
 
Extension of RTKLIB for the calculation and validation of protection levels
Extension of RTKLIB for the calculation and validation of protection levelsExtension of RTKLIB for the calculation and validation of protection levels
Extension of RTKLIB for the calculation and validation of protection levels
Zoltan Siki
 
Using MpCCI to model Fluid-Structure-Interactions with ABAQUS and 3rd party C...
Using MpCCI to model Fluid-Structure-Interactions with ABAQUS and 3rd party C...Using MpCCI to model Fluid-Structure-Interactions with ABAQUS and 3rd party C...
Using MpCCI to model Fluid-Structure-Interactions with ABAQUS and 3rd party C...
Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
Lo18
Lo18Lo18
Lo18
liankei
 
The skyline operator lee, woonghee
The skyline operator lee, woongheeThe skyline operator lee, woonghee
The skyline operator lee, woonghee
Woonghee Lee
 
Design optimization of BOP for fatigue and strength in HPHT environment using...
Design optimization of BOP for fatigue and strength in HPHT environment using...Design optimization of BOP for fatigue and strength in HPHT environment using...
Design optimization of BOP for fatigue and strength in HPHT environment using...
Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
flat_presentation_time_evolving_OD_matrix_estimation
flat_presentation_time_evolving_OD_matrix_estimationflat_presentation_time_evolving_OD_matrix_estimation
flat_presentation_time_evolving_OD_matrix_estimationLuís Moreira-Matias
 
Data Visualization Project Presentation
Data Visualization Project PresentationData Visualization Project Presentation
Data Visualization Project Presentation
Shubham Shrivastava
 
ICIAM 2019: A New Algorithm Model for Massive-Scale Streaming Graph Analysis
ICIAM 2019: A New Algorithm Model for Massive-Scale Streaming Graph AnalysisICIAM 2019: A New Algorithm Model for Massive-Scale Streaming Graph Analysis
ICIAM 2019: A New Algorithm Model for Massive-Scale Streaming Graph Analysis
Jason Riedy
 
Ieee eit-talk-large-scale-neural-modeling-in-map reduce-giraph
Ieee eit-talk-large-scale-neural-modeling-in-map reduce-giraphIeee eit-talk-large-scale-neural-modeling-in-map reduce-giraph
Ieee eit-talk-large-scale-neural-modeling-in-map reduce-giraph
imsure
 
Using Deep Learning in Production Pipelines to Predict Consumers’ Interest wi...
Using Deep Learning in Production Pipelines to Predict Consumers’ Interest wi...Using Deep Learning in Production Pipelines to Predict Consumers’ Interest wi...
Using Deep Learning in Production Pipelines to Predict Consumers’ Interest wi...
Databricks
 
Risk Analysis of Linear Projects
Risk Analysis of Linear ProjectsRisk Analysis of Linear Projects
Risk Analysis of Linear Projects
Intaver Insititute
 
Introduction to kdb+
Introduction to kdb+Introduction to kdb+
Introduction to kdb+
Rory Winston
 

What's hot (20)

One-Click CFD Users' Guide
One-Click CFD Users' GuideOne-Click CFD Users' Guide
One-Click CFD Users' Guide
 
CHITRARASU DEIVASIGAMANI - Work Portfolio
CHITRARASU DEIVASIGAMANI - Work PortfolioCHITRARASU DEIVASIGAMANI - Work Portfolio
CHITRARASU DEIVASIGAMANI - Work Portfolio
 
A Virtual Machine Placement Algorithm for Energy Efficient Cloud Resource Res...
A Virtual Machine Placement Algorithm for Energy Efficient Cloud Resource Res...A Virtual Machine Placement Algorithm for Energy Efficient Cloud Resource Res...
A Virtual Machine Placement Algorithm for Energy Efficient Cloud Resource Res...
 
Vlsi assisted nonrigid registration using modified demons algorithm
Vlsi assisted nonrigid registration using modified demons algorithmVlsi assisted nonrigid registration using modified demons algorithm
Vlsi assisted nonrigid registration using modified demons algorithm
 
INAC Online Hazards Database App
INAC Online Hazards Database AppINAC Online Hazards Database App
INAC Online Hazards Database App
 
Extracting a Rails Engine to a separated application
Extracting a Rails Engine to a separated applicationExtracting a Rails Engine to a separated application
Extracting a Rails Engine to a separated application
 
ICIAM 2019: Reproducible Linear Algebra from Application to Architecture
ICIAM 2019: Reproducible Linear Algebra from Application to ArchitectureICIAM 2019: Reproducible Linear Algebra from Application to Architecture
ICIAM 2019: Reproducible Linear Algebra from Application to Architecture
 
Extension of RTKLIB for the calculation and validation of protection levels
Extension of RTKLIB for the calculation and validation of protection levelsExtension of RTKLIB for the calculation and validation of protection levels
Extension of RTKLIB for the calculation and validation of protection levels
 
Using MpCCI to model Fluid-Structure-Interactions with ABAQUS and 3rd party C...
Using MpCCI to model Fluid-Structure-Interactions with ABAQUS and 3rd party C...Using MpCCI to model Fluid-Structure-Interactions with ABAQUS and 3rd party C...
Using MpCCI to model Fluid-Structure-Interactions with ABAQUS and 3rd party C...
 
Lo18
Lo18Lo18
Lo18
 
The skyline operator lee, woonghee
The skyline operator lee, woongheeThe skyline operator lee, woonghee
The skyline operator lee, woonghee
 
Design optimization of BOP for fatigue and strength in HPHT environment using...
Design optimization of BOP for fatigue and strength in HPHT environment using...Design optimization of BOP for fatigue and strength in HPHT environment using...
Design optimization of BOP for fatigue and strength in HPHT environment using...
 
Presentation_JeepCar
Presentation_JeepCarPresentation_JeepCar
Presentation_JeepCar
 
flat_presentation_time_evolving_OD_matrix_estimation
flat_presentation_time_evolving_OD_matrix_estimationflat_presentation_time_evolving_OD_matrix_estimation
flat_presentation_time_evolving_OD_matrix_estimation
 
Data Visualization Project Presentation
Data Visualization Project PresentationData Visualization Project Presentation
Data Visualization Project Presentation
 
ICIAM 2019: A New Algorithm Model for Massive-Scale Streaming Graph Analysis
ICIAM 2019: A New Algorithm Model for Massive-Scale Streaming Graph AnalysisICIAM 2019: A New Algorithm Model for Massive-Scale Streaming Graph Analysis
ICIAM 2019: A New Algorithm Model for Massive-Scale Streaming Graph Analysis
 
Ieee eit-talk-large-scale-neural-modeling-in-map reduce-giraph
Ieee eit-talk-large-scale-neural-modeling-in-map reduce-giraphIeee eit-talk-large-scale-neural-modeling-in-map reduce-giraph
Ieee eit-talk-large-scale-neural-modeling-in-map reduce-giraph
 
Using Deep Learning in Production Pipelines to Predict Consumers’ Interest wi...
Using Deep Learning in Production Pipelines to Predict Consumers’ Interest wi...Using Deep Learning in Production Pipelines to Predict Consumers’ Interest wi...
Using Deep Learning in Production Pipelines to Predict Consumers’ Interest wi...
 
Risk Analysis of Linear Projects
Risk Analysis of Linear ProjectsRisk Analysis of Linear Projects
Risk Analysis of Linear Projects
 
Introduction to kdb+
Introduction to kdb+Introduction to kdb+
Introduction to kdb+
 

Similar to Arc: An IR for Batch and Stream Programming

SFScon22 - Peter Hopfgartner - Bridging the Gap between BIM and GIS with Open...
SFScon22 - Peter Hopfgartner - Bridging the Gap between BIM and GIS with Open...SFScon22 - Peter Hopfgartner - Bridging the Gap between BIM and GIS with Open...
SFScon22 - Peter Hopfgartner - Bridging the Gap between BIM and GIS with Open...
South Tyrol Free Software Conference
 
Introducing Arc: A Common Intermediate Language for Unified Batch and Stream...
Introducing Arc:  A Common Intermediate Language for Unified Batch and Stream...Introducing Arc:  A Common Intermediate Language for Unified Batch and Stream...
Introducing Arc: A Common Intermediate Language for Unified Batch and Stream...
Flink Forward
 
Graphs in data structures are non-linear data structures made up of a finite ...
Graphs in data structures are non-linear data structures made up of a finite ...Graphs in data structures are non-linear data structures made up of a finite ...
Graphs in data structures are non-linear data structures made up of a finite ...
bhargavi804095
 
FPGA Implementation of Pipelined CORDIC Sine Cosine Digital Wave Generator
FPGA Implementation of Pipelined CORDIC Sine Cosine Digital Wave Generator FPGA Implementation of Pipelined CORDIC Sine Cosine Digital Wave Generator
FPGA Implementation of Pipelined CORDIC Sine Cosine Digital Wave Generator
cscpconf
 
A novel reduced instruction set computer-communication processor design usin...
A novel reduced instruction set computer-communication  processor design usin...A novel reduced instruction set computer-communication  processor design usin...
A novel reduced instruction set computer-communication processor design usin...
International Journal of Reconfigurable and Embedded Systems
 
Design of Adjustable Reconfigurable Wireless Single Core CORDIC based Rake Re...
Design of Adjustable Reconfigurable Wireless Single Core CORDIC based Rake Re...Design of Adjustable Reconfigurable Wireless Single Core CORDIC based Rake Re...
Design of Adjustable Reconfigurable Wireless Single Core CORDIC based Rake Re...
IOSR Journals
 
Design of Adjustable Reconfigurable Wireless Single Core CORDIC based Rake Re...
Design of Adjustable Reconfigurable Wireless Single Core CORDIC based Rake Re...Design of Adjustable Reconfigurable Wireless Single Core CORDIC based Rake Re...
Design of Adjustable Reconfigurable Wireless Single Core CORDIC based Rake Re...
IOSR Journals
 
Apache spark linkedin
Apache spark linkedinApache spark linkedin
Apache spark linkedin
Yukti Kaura
 
Realization of Direct Digital Synthesis in Cordic Algorithm
Realization of Direct Digital Synthesis in Cordic AlgorithmRealization of Direct Digital Synthesis in Cordic Algorithm
Realization of Direct Digital Synthesis in Cordic Algorithm
IJASRD Journal
 
Punit_Shah_resume
Punit_Shah_resumePunit_Shah_resume
Punit_Shah_resumePunit Shah
 
Punit_Shah_resume
Punit_Shah_resumePunit_Shah_resume
Punit_Shah_resumePunit Shah
 
Punit_Shah_resume
Punit_Shah_resumePunit_Shah_resume
Punit_Shah_resumePunit Shah
 
Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)
Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)
Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)
Spark Summit
 
IRJET - Wireless Transmission of Data using LDPC Codes based on Raspberry Pi
IRJET - Wireless Transmission of Data using LDPC Codes based on Raspberry PiIRJET - Wireless Transmission of Data using LDPC Codes based on Raspberry Pi
IRJET - Wireless Transmission of Data using LDPC Codes based on Raspberry Pi
IRJET Journal
 
Big Data Processing with .NET and Spark (SQLBits 2020)
Big Data Processing with .NET and Spark (SQLBits 2020)Big Data Processing with .NET and Spark (SQLBits 2020)
Big Data Processing with .NET and Spark (SQLBits 2020)
Michael Rys
 
Juan josefumeroarray14
Juan josefumeroarray14Juan josefumeroarray14
Juan josefumeroarray14Juan Fumero
 
R4ML: An R Based Scalable Machine Learning Framework
R4ML: An R Based Scalable Machine Learning FrameworkR4ML: An R Based Scalable Machine Learning Framework
R4ML: An R Based Scalable Machine Learning Framework
Alok Singh
 
Target updated track f
Target updated   track fTarget updated   track f
Target updated track fAlona Gradman
 
Chip Ex2010 Gert Goossens
Chip Ex2010 Gert GoossensChip Ex2010 Gert Goossens
Chip Ex2010 Gert Goossens
Alona Gradman
 
Cockatrice: A Hardware Design Environment with Elixir
Cockatrice: A Hardware Design Environment with ElixirCockatrice: A Hardware Design Environment with Elixir
Cockatrice: A Hardware Design Environment with Elixir
Hideki Takase
 

Similar to Arc: An IR for Batch and Stream Programming (20)

SFScon22 - Peter Hopfgartner - Bridging the Gap between BIM and GIS with Open...
SFScon22 - Peter Hopfgartner - Bridging the Gap between BIM and GIS with Open...SFScon22 - Peter Hopfgartner - Bridging the Gap between BIM and GIS with Open...
SFScon22 - Peter Hopfgartner - Bridging the Gap between BIM and GIS with Open...
 
Introducing Arc: A Common Intermediate Language for Unified Batch and Stream...
Introducing Arc:  A Common Intermediate Language for Unified Batch and Stream...Introducing Arc:  A Common Intermediate Language for Unified Batch and Stream...
Introducing Arc: A Common Intermediate Language for Unified Batch and Stream...
 
Graphs in data structures are non-linear data structures made up of a finite ...
Graphs in data structures are non-linear data structures made up of a finite ...Graphs in data structures are non-linear data structures made up of a finite ...
Graphs in data structures are non-linear data structures made up of a finite ...
 
FPGA Implementation of Pipelined CORDIC Sine Cosine Digital Wave Generator
FPGA Implementation of Pipelined CORDIC Sine Cosine Digital Wave Generator FPGA Implementation of Pipelined CORDIC Sine Cosine Digital Wave Generator
FPGA Implementation of Pipelined CORDIC Sine Cosine Digital Wave Generator
 
A novel reduced instruction set computer-communication processor design usin...
A novel reduced instruction set computer-communication  processor design usin...A novel reduced instruction set computer-communication  processor design usin...
A novel reduced instruction set computer-communication processor design usin...
 
Design of Adjustable Reconfigurable Wireless Single Core CORDIC based Rake Re...
Design of Adjustable Reconfigurable Wireless Single Core CORDIC based Rake Re...Design of Adjustable Reconfigurable Wireless Single Core CORDIC based Rake Re...
Design of Adjustable Reconfigurable Wireless Single Core CORDIC based Rake Re...
 
Design of Adjustable Reconfigurable Wireless Single Core CORDIC based Rake Re...
Design of Adjustable Reconfigurable Wireless Single Core CORDIC based Rake Re...Design of Adjustable Reconfigurable Wireless Single Core CORDIC based Rake Re...
Design of Adjustable Reconfigurable Wireless Single Core CORDIC based Rake Re...
 
Apache spark linkedin
Apache spark linkedinApache spark linkedin
Apache spark linkedin
 
Realization of Direct Digital Synthesis in Cordic Algorithm
Realization of Direct Digital Synthesis in Cordic AlgorithmRealization of Direct Digital Synthesis in Cordic Algorithm
Realization of Direct Digital Synthesis in Cordic Algorithm
 
Punit_Shah_resume
Punit_Shah_resumePunit_Shah_resume
Punit_Shah_resume
 
Punit_Shah_resume
Punit_Shah_resumePunit_Shah_resume
Punit_Shah_resume
 
Punit_Shah_resume
Punit_Shah_resumePunit_Shah_resume
Punit_Shah_resume
 
Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)
Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)
Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)
 
IRJET - Wireless Transmission of Data using LDPC Codes based on Raspberry Pi
IRJET - Wireless Transmission of Data using LDPC Codes based on Raspberry PiIRJET - Wireless Transmission of Data using LDPC Codes based on Raspberry Pi
IRJET - Wireless Transmission of Data using LDPC Codes based on Raspberry Pi
 
Big Data Processing with .NET and Spark (SQLBits 2020)
Big Data Processing with .NET and Spark (SQLBits 2020)Big Data Processing with .NET and Spark (SQLBits 2020)
Big Data Processing with .NET and Spark (SQLBits 2020)
 
Juan josefumeroarray14
Juan josefumeroarray14Juan josefumeroarray14
Juan josefumeroarray14
 
R4ML: An R Based Scalable Machine Learning Framework
R4ML: An R Based Scalable Machine Learning FrameworkR4ML: An R Based Scalable Machine Learning Framework
R4ML: An R Based Scalable Machine Learning Framework
 
Target updated track f
Target updated   track fTarget updated   track f
Target updated track f
 
Chip Ex2010 Gert Goossens
Chip Ex2010 Gert GoossensChip Ex2010 Gert Goossens
Chip Ex2010 Gert Goossens
 
Cockatrice: A Hardware Design Environment with Elixir
Cockatrice: A Hardware Design Environment with ElixirCockatrice: A Hardware Design Environment with Elixir
Cockatrice: A Hardware Design Environment with Elixir
 

Recently uploaded

platelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptxplatelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptx
muralinath2
 
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
NathanBaughman3
 
EY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptxEY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptx
AlguinaldoKong
 
Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...
Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...
Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...
muralinath2
 
Richard's entangled aventures in wonderland
Richard's entangled aventures in wonderlandRichard's entangled aventures in wonderland
Richard's entangled aventures in wonderland
Richard Gill
 
filosofia boliviana introducción jsjdjd.pptx
filosofia boliviana introducción jsjdjd.pptxfilosofia boliviana introducción jsjdjd.pptx
filosofia boliviana introducción jsjdjd.pptx
IvanMallco1
 
Anemia_ different types_causes_ conditions
Anemia_ different types_causes_ conditionsAnemia_ different types_causes_ conditions
Anemia_ different types_causes_ conditions
muralinath2
 
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATIONPRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
ChetanK57
 
Hemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptxHemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptx
muralinath2
 
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Sérgio Sacani
 
Citrus Greening Disease and its Management
Citrus Greening Disease and its ManagementCitrus Greening Disease and its Management
Citrus Greening Disease and its Management
subedisuryaofficial
 
Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...
Sérgio Sacani
 
In silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptxIn silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptx
AlaminAfendy1
 
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
Scintica Instrumentation
 
NuGOweek 2024 Ghent - programme - final version
NuGOweek 2024 Ghent - programme - final versionNuGOweek 2024 Ghent - programme - final version
NuGOweek 2024 Ghent - programme - final version
pablovgd
 
GBSN- Microbiology (Lab 3) Gram Staining
GBSN- Microbiology (Lab 3) Gram StainingGBSN- Microbiology (Lab 3) Gram Staining
GBSN- Microbiology (Lab 3) Gram Staining
Areesha Ahmad
 
erythropoiesis-I_mechanism& clinical significance.pptx
erythropoiesis-I_mechanism& clinical significance.pptxerythropoiesis-I_mechanism& clinical significance.pptx
erythropoiesis-I_mechanism& clinical significance.pptx
muralinath2
 
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptxBody fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
muralinath2
 
plant biotechnology Lecture note ppt.pptx
plant biotechnology Lecture note ppt.pptxplant biotechnology Lecture note ppt.pptx
plant biotechnology Lecture note ppt.pptx
yusufzako14
 
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
Sérgio Sacani
 

Recently uploaded (20)

platelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptxplatelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptx
 
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
 
EY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptxEY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptx
 
Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...
Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...
Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...
 
Richard's entangled aventures in wonderland
Richard's entangled aventures in wonderlandRichard's entangled aventures in wonderland
Richard's entangled aventures in wonderland
 
filosofia boliviana introducción jsjdjd.pptx
filosofia boliviana introducción jsjdjd.pptxfilosofia boliviana introducción jsjdjd.pptx
filosofia boliviana introducción jsjdjd.pptx
 
Anemia_ different types_causes_ conditions
Anemia_ different types_causes_ conditionsAnemia_ different types_causes_ conditions
Anemia_ different types_causes_ conditions
 
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATIONPRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
 
Hemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptxHemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptx
 
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
 
Citrus Greening Disease and its Management
Citrus Greening Disease and its ManagementCitrus Greening Disease and its Management
Citrus Greening Disease and its Management
 
Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...
 
In silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptxIn silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptx
 
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
 
NuGOweek 2024 Ghent - programme - final version
NuGOweek 2024 Ghent - programme - final versionNuGOweek 2024 Ghent - programme - final version
NuGOweek 2024 Ghent - programme - final version
 
GBSN- Microbiology (Lab 3) Gram Staining
GBSN- Microbiology (Lab 3) Gram StainingGBSN- Microbiology (Lab 3) Gram Staining
GBSN- Microbiology (Lab 3) Gram Staining
 
erythropoiesis-I_mechanism& clinical significance.pptx
erythropoiesis-I_mechanism& clinical significance.pptxerythropoiesis-I_mechanism& clinical significance.pptx
erythropoiesis-I_mechanism& clinical significance.pptx
 
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptxBody fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
 
plant biotechnology Lecture note ppt.pptx
plant biotechnology Lecture note ppt.pptxplant biotechnology Lecture note ppt.pptx
plant biotechnology Lecture note ppt.pptx
 
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
 

Arc: An IR for Batch and Stream Programming

  • 1. Arc An IR for Batch and Stream Programming Lars Kroll*, Klas Segeljakt*, Paris Carbone†, Christian Schulte*, Seif Haridi*† *KTH Royal Institute of Technology, Stockholm, Sweden – †RISE SICS, Stockholm, Sweden presented by Lars Kroll at the 17th Symposium on Data Base Programming Languages (DBPL 2019) in Phoenix, Arizona, USA in June 2019
  • 2. Arc: An IR for Batch and Stream Programming π Tensors Relational Streams Dynamic Graphs The Challenge !2 knowledge ∞ Data Data Programming Systems Decision Making
  • 3. Arc: An IR for Batch and Stream Programming π Tensors Relational Streams Dynamic Graphs Arcon: A Streaming Runtime for Heterogeneous Hardware !3 Arcon Worker worker specific binaries Worker Worker
  • 4. Arc: An IR for Batch and Stream Programming Arcon Compiler Pipeline !4 Arcon Arc (High Level IR) Frontends Logical Dataflow IR Physical Dataflow IR Binaries
  • 5. Arc: An IR for Batch and Stream Programming Arc Compiler Overview !5 Lexer/Tokeniser Parser Macro Expansion Type Inference Arc Descriptor Translate to Dataflow IR OptimisationsOptimisationsOptimisations until Fixpoint Antlr generated Constraint based implemented in
  • 6. Arc: An IR for Batch and Stream Programming What is Arc? !6 • The Weld IR* • A restrictive language for describing data transformations • Pure expressions without side-effects (except: CUDFs) • Collections: Read-only data types (e.g., vec[T], dict[T]) • Builders: Write-only data types (e.g., appender[T], merger[T], groupbuilder[T]) • Calling result on a builder returns the associated collection type (or a primitive for merger) • Arc extends the Weld for streaming • Observation – Stream Sources are read-only – Stream Sinks are write-only – Connect Sinks to Sources via Channels • Source is a collection stream[T] • Sink is a builder streamappender[T] • Calling result on a Sink returns a Source and creates a Channel between them *Palkar, Shoumik, et al. "Weld: A common runtime for high performance data analytics." Conference on Innovative Data Systems Research (CIDR). 2017.
  • 7. Arc: An IR for Batch and Stream Programming |input:vec[i32]| result( for(input:vec[i32], appender[i32], |app:appender[i32], _:i64, i:i32| merge(app, i + 5))) Weld Example !7 Weld macro map(data, func) = ( result(for(data, appender, |b, i, x| merge(b, func(x)))) ); cmp.Weld map(i+5)[1, 2, 3, 4, 5] [6, 7, 8, 9, 10]
  • 8. Arc: An IR for Batch and Stream Programming Arc Example 1 !8 |input:Stream[i32], output: StreamAppender[i32]| for(input, output, |out, i| merge(out, i + 5)) Arc map(i+5)source (input) sink (output)
  • 9. Arc: An IR for Batch and Stream Programming Arc Example 1 !9 |input:Stream[i32], output: StreamAppender[i32]| for(input: Stream[i32], output: StreamAppender[i32], |out: StreamAppender[i32], i:i32| merge(out, i + 5): StreamAppender[i32]) Arc map(i+5)source (input) sink (output)
  • 10. Arc: An IR for Batch and Stream Programming Arc Example 2 !10 |input:Stream[i32], output: StreamAppender[i32]| for(input, output, |out, i| if(i % 2 == 0, merge(out, i), out)) Arc filter(i%2==0)source (input) sink (output)
  • 11. Arc: An IR for Batch and Stream Programming Arc Example 3 !11 |source:Stream[i32], evenSink:StreamAppender[i32], oddSink:StreamAppender[i32]| let mapped = result( for(source, StreamAppender[i32], |out, i| merge(out, i + 5))); for(mapped, evenSink, |out, i| if (i % 2 == 0, merge(out, i), out)); for(mapped, oddSink, |out, i| if (i % 2 != 0, merge(out, i), out)) Arc source evenSink oddSink map(i+5) filter(i%2==0) filter(i%2!=0)
  • 12. Arc: An IR for Batch and Stream Programming Arc Optimisations !12 • Operator Reordering • Redundancy Elimination • Operator Separation (Fission) • Operator Fusion
  • 13. Arc: An IR for Batch and Stream Programming Arc Example 3 !13 Arc source evenSink oddSink map(i+5) then if(j%2==0) |source:Stream[i32], evenSink:StreamAppender[i32], oddSink:StreamAppender[i32]| for(source, {evenSink,oddSink}, |out, i| let j = i + 5; if(j % 2 == 0, {merge(out.$0, j),out.$1}, {out.$0, merge(out.$1, j)}))
  • 14. Arc: An IR for Batch and Stream Programming Arc Windows !14 |input:Stream[{u64, i32}], output: StreamAppender[{u64, i32}]| for(input, Windower[Unit, Merger[i32,+]]( |e: {u64, i32},_,_| {[e.$0/600L], ()}, |wm: Watermark, open: Vec[WindowId], _| {filter(open, |id: WindowId| id < wm/600L), ()}, |wid: WindowId, window: Merger[i32,+]| {wid, result(window)} ), |win: Windower[{u64, i32}], e: {u64, i32}| merge(win, e) ) assign trigger aggregate lift {ts,15} {ts,3} {ts,24} {ts,11} {ts,6} {ts,21} {ts,18} ∑ {ts,24} ∑ {ts,38} ∑ Disc.Ty. Aggr.Ty.
  • 15. Arc: An IR for Batch and Stream Programming Summary !15 • Arcon deploys continuous streaming analytics on heterogenous hardware • Arc is its high-level IR to abstract across frameworks and languages • Arc extends Weld’s side-effect free approach for streams and windows • Arc allows logical dataflow optimisations Arc Arcon