which problems does a multi-language virtual machine need to solve in the multicore/manycore era?

20
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 20111024

Upload: stefan-marr

Post on 02-Jul-2015

857 views

Category:

Technology


1 download

DESCRIPTION

While parallel programming for very regular problems has been used in the scientific community by non-computer-scientists successfully for a few decades now, concurrent programming and solving irregular problems remains hard. Furthermore, we shift from few expert system programmers mastering concurrency for a constrained set of problems to mainstream application developers being required to master concurrency for a wide variety of problems.Consequently, high-level language virtual machine (VM) research faces interesting questions. What are processor design changes that have an impact on the abstractions provided by VMs to provide platform independence? How can application programmers’ diverse needs be facilitated to solve concurrent programming problems?We argue that VMs will need to be ready for a wide range of different concurrency models that allow solving concurrency problems with appropriate abstractions. Furthermore, they need to abstract from heterogeneous processor architectures, varying performance characteristics, need to account for memory access cost and inter-core communication mechanisms but should only expose the minimal useful set of notions like locality, explicit communication, and adaptable scheduling to maintain their abstracting nature.Eventually, language designers need to be enabled to guarantee properties like encapsulation, scheduling guarantees, and immutability also when an interaction between different problem-specific concurrency abstractions is required.

TRANSCRIPT

Page 1: 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  

Page 2: Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Multicore/Manycore Era?

VMs  today  

25/10/11   2  

Performance   Memory  Management  

F#  

MulJ-­‐Language  Eco  System   PlaLorm  Independent  

Page 3: Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Multicore/Manycore Era?

What  do  we  need  in  the  MulJcore/Manycore  Era?  

25/10/11   3  

Page 4: Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Multicore/Manycore Era?

Two  Dimensions  

25/10/11   4  

Processor  Design   Concurrency  Models  

Actors  

STM  

DataFlow  

Fork/Join  

Page 5: Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Multicore/Manycore Era?

Processors  and  Concurrency  Models  

25/10/11   5  

!"#$%!&'()*

!&'()*

!&'()*

!&'()*

!&'()*

+&,%-()&../")&0%'&'()*

!"$*%-()&.1")#(2.%0#33&)&$4%0&.#5$.

6$4&)78()&%9&4,():

!"#$%!&'()*

VM?  

Page 6: Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Multicore/Manycore Era?

WHAT  ARE  THE  RELEVANT  CHANGES  AT  THE  HARDWARE-­‐LEVEL?  

25/10/11   6  

Page 7: Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Multicore/Manycore Era?

Brawny  vs.  Wimpy  

•  High  sequenJal  performance  

•  Few  in  numbers  

•  Weak  sequenJal  performance  

•  High  in  numbers  

25/10/11   7  

Page 8: Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Multicore/Manycore Era?

And  everything  in-­‐between!  

25/10/11   8  

Wimpy  Brawny  

IBM  Power7  

Intel  i7   Cell  B.E.  Nvidia  Fermi  

AMD  Fusion  

Intel  MIC  

Hybrid  

Page 9: Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Multicore/Manycore Era?

Cores  vs.  Threads  vs.  Shared  PUs  

25/10/11   9  

Source:  AMD  

Page 10: Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Multicore/Manycore Era?

Memory  and  CommunicaJon  

Nehalem  Cache  Hierarchy   Four  Processor  Setup  

25/10/11   10  

Source:  Intel  CommunicaJon  implicit  via  memory  

Page 11: Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Multicore/Manycore Era?

Memory  and  CommunicaJon  

25/10/11   11  

TILEPro64  Source:  Tilera  

Page 12: Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Multicore/Manycore Era?

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  

Page 13: Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Multicore/Manycore Era?

WHAT  ARE  TYPICAL  IMPLEMENTATION  PROBLEMS  OF  CONCURRENCY  MODELS?  

25/10/11   13  

Actors  

STM  

DataFlow  

Fork/Join  

Page 14: Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Multicore/Manycore Era?

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”  

Page 15: Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Multicore/Manycore Era?

Scheduling  Guarantees  

25/10/11   15  

Fork/Join   Actors   PrioriJzed  Tasks  

work-­‐stealing   fair  scheduling   priority-­‐based  scheduling  

Page 16: Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Multicore/Manycore Era?

Immutability  

25/10/11   16  

Source:  Star  Wars  Episode  V:  The  Empire  Strikes  Back.  

Page 17: Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Multicore/Manycore Era?

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  

Page 18: Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Multicore/Manycore Era?

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  

Page 19: Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Multicore/Manycore Era?

What  do  VMs  need  to  account  for?  

25/10/11   19  

Processor  Design   Concurrency  Models  

Actors  

STM  

DataFlow  

Fork/Join  

Page 20: Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Multicore/Manycore Era?

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