Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Multicore/Manycore Era?
-
Upload
stefan-marr -
Category
Technology
-
view
858 -
download
1
description
Transcript of Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Multicore/Manycore Era?
Which Problems Does a
Mul$-‐Language Virtual Machine
Need to Solve in the
Mul$core/Manycore Era?
Stefan Marr Ma8as De Wael, Michael Haupt, Theo D’Hondt
VMIL Workshop 2011 2011-‐10-‐24
VMs today
25/10/11 2
Performance Memory Management
F#
MulJ-‐Language Eco System PlaLorm Independent
What do we need in the MulJcore/Manycore Era?
25/10/11 3
Two Dimensions
25/10/11 4
Processor Design Concurrency Models
Actors
STM
DataFlow
Fork/Join
Processors and Concurrency Models
25/10/11 5
!"#$%!&'()*
!&'()*
!&'()*
!&'()*
!&'()*
+&,%-()&../")&0%'&'()*
!"$*%-()&.1")#(2.%0#33&)&$4%0&.#5$.
6$4&)78()&%9&4,():
!"#$%!&'()*
VM?
WHAT ARE THE RELEVANT CHANGES AT THE HARDWARE-‐LEVEL?
25/10/11 6
Brawny vs. Wimpy
• High sequenJal performance
• Few in numbers
• Weak sequenJal performance
• High in numbers
25/10/11 7
And everything in-‐between!
25/10/11 8
Wimpy Brawny
IBM Power7
Intel i7 Cell B.E. Nvidia Fermi
AMD Fusion
Intel MIC
Hybrid
Cores vs. Threads vs. Shared PUs
25/10/11 9
Source: AMD
Memory and CommunicaJon
Nehalem Cache Hierarchy Four Processor Setup
25/10/11 10
Source: Intel CommunicaJon implicit via memory
Memory and CommunicaJon
25/10/11 11
TILEPro64 Source: Tilera
What do VMs need to account for?
• Appropriate uJlizaJon – Varying performance of cores/units?
– Caches and simultaneous mul,threading?
• Non-‐uniform memory and communicaJon
– Cache hierarchies?
– Explicit inter-‐core communicaJon?
25/10/11 12
WHAT ARE TYPICAL IMPLEMENTATION PROBLEMS OF CONCURRENCY MODELS?
25/10/11 13
Actors
STM
DataFlow
Fork/Join
EncapsulaJon
actor BreakEncapsulation: def main_loop(self): receive: (Message) => Message.msg = "broken" # main msg = Message("Hello World!") broken ! (msg) # wait print msg.msg
25/10/11 14
IMPORTANT: Messages can be any kind of object but have to be immutable. Scala can’t enforce immutability (yet) so this has to be by convenJon. JCSP: obj-‐by-‐ref, no warning Kilim: zero-‐copy type system not “reflecJon-‐proof” Clojure: STM + pure Java Agents + pure Java Swing UI: “The single-‐ thread rule”
Scheduling Guarantees
25/10/11 15
Fork/Join Actors PrioriJzed Tasks
work-‐stealing fair scheduling priority-‐based scheduling
Immutability
25/10/11 16
Source: Star Wars Episode V: The Empire Strikes Back.
Crossing Borders and Language-‐Levels
25/10/11 17
ImplementaJon/Meta-‐Level Language/ApplicaJon-‐Level
jThread.sortedSet = FarRefWrapper(sortSet) jThread.sortedSet .add(FarRefWrapper(e)) // add(fr_e) (wrapper semantics) fr_e.compareTo(obj) { return send_wait(e, compareTo, obj) }
a e
add(e)
e.compareTo(*)
sortedSet
What do VMs need to account for?
• Enforcing language semanJcs?
• Flexible concurrent encapsulaJon?
– What is the relaJon to immutability?
• Enforceable scheduling guarantees?
• Normal vs. reflecJve operaJons?
25/10/11 18
What do VMs need to account for?
25/10/11 19
Processor Design Concurrency Models
Actors
STM
DataFlow
Fork/Join
What do VMs need to account for?
Processor Design
• Appropriate uJlizaJon – Varying performance?
– Hyperthreads?
• Non-‐uniform memory and communicaJon – Cache hierarchies? – Explicit inter-‐core
communicaJon?
Concurrency Models
• Flexible concurrent encapsulaJon? – Flexible Immutability?
• Enforceable scheduling guarantees?
• Normal vs. reflecJve operaJons?
25/10/11 20