Gen AI in Business - Global Trends Report 2024.pdf
Sly and the RoarVM: Parallel Programming with Smalltalk
1. Sly
and
the
RoarVM
Exploring
the
Manycore
Future
of
Programming
Renaissance
Project
h=p://so@.vub.ac.be/~smarr/renaissance/
Stefan
Marr
So@ware
Languages
Lab,
Vrije
Universiteit
Brussel
Smalltalk
Dev
Room,
FOSDEM,
2012-‐02-‐05
2. Agenda
• Parallel
Smalltalk
and
the
RoarVM
– [self
demo]
fork
– Project
• Sly
and
the
Renaissance
Project
– Demo
– Context
– Language
and
Use-‐Cases
05/02/12
2
3. Disclaimer:
It
wasn’t
me!
IBM
Research
Vrije
Universiteit
Brussel:
– David
Ungar
So@ware
Languages
Lab
– Sam
S.
Adams
– Pablo
Inostroza
Valdera
– Doug
Kimelman
Portland
State
University
– Stefan
Marr
– Andrew
P.
Black
– Theo
D'Hondt
– Max
OrHai
05/02/12
3
4. RoarVM
and
Parallel
Smalltalk?
Get
the
RoarVM
Smalltalk,
Concurrency,
and
Parallelism
05/02/12
Demo
4
5. RoarVM
Smalltalk
• Process
class
addions
– yieldIfFewerCoresThan:
anInt
– coreMask,
coreMask:
anInt
• onlyOnCore:
anInt
– hostCore
– thisProcess
instead
of
activeProcess
• Uses
standard
Smalltalk
facilies
– [self
do]
fork
– Semaphore
class
05/02/12
5
6. RoarVM
Status
• VM:
rewri=en
Squeak,
20k
SLOC
C++
• MVC
images
run
fine
• Squeak/Pharo:
mulcore
instabilies
• Runs
on:
OSX,
Linux,
iOS,
Tilera,
up
to
59
cores
05/02/12
6
8. Avoid
the
Concurrency
Trap
by
Embracing
Non-‐Determinism
SLY
AND
THE
RENAISSANCE
PROJECT
05/02/12
8
9. Renaissance
Project
• Manycore:
>
100
cores
+ non-‐uniform
memory
access
• Problem
– Parallel
systems
are
nondeterminisc
– Communicaon
is
expensive
– Synchronizaon
==
bo=leneck
• The
vision
– Embrace
nondeterminism
– Harness
emergence
– Confidence
→
Delay
05/02/12
9
10. Non-‐determinisUc
Boids
and
ParUcle
SorUng
Flocking
behavior
of
birds
and
parUcle
bouncing
as
local-‐only
synchronizaUon
strategies
for
scalability
05/02/12
Demo
10
11. Sly
• Ensembles:
collecons
represenng
a
whole,
mul-‐part
enes
– e.g.
a
flock
of
birds
• Adverbs:
modifiers
to
operands
– individualLY,
serialLY,
randomLY:
n
• Gerunds:
reducon
semancs
– averagING,
selectINGpredicate,
ensemblING
05/02/12
11
12. Examples
of
Boids
• Every
boid
is
its
own
thread,
no
synch.
computeCentroid
^
self
flock
boids
averagINGserialLYposition
computeNeighbors
^
self
flock
boids
selectINGisNear:
self
matchVelocityWithNeighbors
^
self
neighbors
averagINGvelocity
/
8.0
More
details:
h=p://so@.vub.ac.be/~smarr/renaissance/sly3-‐overview/
05/02/12
12
13. Possible
Real
Life
Applicaon
Image:
h=p://blogs.technet.com/b/andrew/
archive/2007/08/22/olap-‐cubes-‐and-‐
muldimensional-‐analysis.aspx
05/02/12
13
14. Possible
Real
Life
Applicaon
• Online
analycal
processing
(OLAP)
– Business
intelligence,
data
mining
– Query
muldimensional
data
sets
– Calculated
data
dimensions
• Gesture
recognion
– Many
rules,
low-‐precision
input
• Race-‐and-‐repair:
how
to
bound
error?
05/02/12
14
16. Conclusion
• Sly:
map/reduce-‐like
programming
model
– Based
on
ensembles,
adverbs
and
gerunds
• RoarVM
– Research
arfact,
stable,
used
daily
– No
opmizaon
of
sequenal
performance
– Tested
up
to
59cores
– Shows
weak
scalability
05/02/12
16
18. Papers
[1]
J.
Pallas
and
D.
Ungar.
Mulprocessor
Smalltalk:
A
Case
Study
of
a
Mulprocessor-‐based
Programming
Environment.
In
PLDI
’88,
p.
268–277.
ACM,
1988.
[2]
D.
Ungar
and
S.
Adams.
Hosng
an
Object
Heap
on
Manycore
Hardware:
An
Exploraon.
In
DLS’09,
p.
99-‐110.
ACM,
2009.
[3]
D.
Ungar,
D.
Kimelman,
and
S.
Adams.
Inconsistency
Robustness
for
Scalability
in
Interacve
Concurrent‑Update
In-‐Memory
MOLAP
Cubes.
In
Inconsistency
Robustness
Symposium
2011.
05/02/12
Roundup
and
Conclusion
18