The Nile Programming Language: Declarative Stream Processing For Media Applications
The Nile Programming Language: Declarative Stream Processing For Media Applications
Dan Amelang
Viewpoints Research Institute
UCSD PhD Student
TransformBeziers (matrix) →
ClipBeziers (min, max) →
Rasterize →
ApplyTexture (texture) →
WriteToImage (image)
Rasterization Pipeline
Nile-to-C C compiler
core.nl libgezira.a
gezira.h
bezier.nl
gezira.c
...
libnile.a
libgezira.a app.exe
app.c
Intra-pipeline Parallelism
Inter-pipeline Parallelism
Instruction-level SIMD Parallelism
• Multi-threaded
• Load balancing
• Heap balancing
• User space synchronization
Speedup on 40 core machine
35
30
25
Speedup
20
15
10
0
1 10 20 30 40
Cores
Meet “Frank”
Future Work
• More applications
• Data compression (zlib, png)
• Audio/video decoding
• 3D graphics
• Image processing
• More compiler backends
• OpenCL (for GPUs)
• Javascript
• More language features
• Sliding windows
• Feedback networks
• Binary streams
Related Work
• Programming models
• Kahn Process Networks [Kahn74, Kahn76]
• Dataflow Process Networks [Lee95]
• Programming languages
• Lucid [Wadge85]
• VAL [Acherman79], later SISAL [Mcgraw85]
• Id [Arvind90], later Parallel Haskell (pH) [Nikhil93]
• Streamit [Thies02]
• Single Assignment C [Scholz03] and S-Net [Grelck07]
Extra slides...
Model of Graphics Rendering?
From Computer Graphics: Principles and Practice [Foley et al.]:
Once the ET has been formed, the following processing steps for the scan-line
algorithm are completed:
1. Set y to the smallest y coordinate that has an entry in the ET, that is, y for the
first nonempty bucket.
2. Initialize the AET to be empty.
3. Repeat until the AET and ET are empty;
(a) Move from ET bucket y to the AET edges whose ymin = y (add entering edges).
(b) Remove from the AET those entries for which y = ymax (edges not involved in
the next scan line), then sort the AET on x.
(c) Fill in desired pixel values on scan line y by using pairs of x coordinates from
the AET (suitably rounded).
(d) Increment y by 1 (to the coordinate of the next scan line).
(e) For each nonvertical edge remaining in the AET, update x for the new y.
TODO: size graph of cairo vs. gezira