Compilers and VMs for Programming Environments Used by - - PowerPoint PPT Presentation
Compilers and VMs for Programming Environments Used by - - PowerPoint PPT Presentation
Compilers and VMs for Programming Environments Used by Scien;sts Jos Nelson Amaral Univ. of Alberta (with input from Laurie Hendren and Rahul
Why ¡Python ¡in ¡Computa;onal ¡ Chemistry? ¡
- Easy ¡integra;on ¡of ¡code ¡wriMen ¡in ¡C/C++; ¡
- Composibility ¡(reuse) ¡
– New ¡students ¡quickly ¡get ¡results ¡ – Build ¡from ¡exis;ng ¡modules, ¡instead ¡of ¡building ¡ from ¡scratch ¡
- Easy ¡to ¡learn ¡the ¡language ¡
- Visualiza;on ¡(very ¡important) ¡
- Drawbacks: ¡
– Performance ¡of ¡Python ¡modules ¡
Comple;ng ¡the ¡Bridge ¡
Python/NumPy ¡ + ¡ ¡Annota;ons ¡ UnPython ¡ Compiler ¡ Restricted ¡ C++ ¡ ¡Syntax ¡ OpenMP ¡ CPU ¡ ¡Code ¡ OpenMP ¡ Compiler ¡ Jit4GPU ¡ Compiler ¡ AMD ¡CAL ¡ Code ¡ AMD ¡CAL ¡ Compiler ¡ Jit4OpenCL ¡ Compiler ¡ OpencL ¡ Code ¡ Nvidia ¡ OpenCL ¡ Compiler ¡ AMD ¡ OpenCL ¡ Compiler ¡
Comple;ng ¡the ¡Bridge ¡
Python/NumPy ¡ + ¡ ¡Annota;ons ¡ UnPython ¡ Compiler ¡ Restricted ¡ C++ ¡ ¡Syntax ¡ OpenMP ¡ CPU ¡ ¡Code ¡ OpenMP ¡ Compiler ¡ Jit4GPU ¡ Compiler ¡ AMD ¡CAL ¡ Code ¡ AMD ¡CAL ¡ Compiler ¡ Jit4OpenCL ¡ Compiler ¡ OpencL ¡ Code ¡ Nvidia ¡ OpenCL ¡ Compiler ¡ AMD ¡ OpenCL ¡ Compiler ¡ MatLab ¡
? ¡ ? ¡
What ¡we ¡have ¡
Python/NumPy ¡ + ¡ ¡Annota;ons ¡ MatLab ¡ UnPython ¡ Compiler ¡ Restricted ¡ C++ ¡ ¡Syntax ¡ OpenMP ¡ CPU ¡ ¡Code ¡ OpenMP ¡ Compiler ¡ Jit4GPU ¡ Compiler ¡ AMD ¡CAL ¡ Code ¡ AMD ¡CAL ¡ Compiler ¡ Jit4OpenCL ¡ Compiler ¡ OpencL ¡ Code ¡ Nvidia ¡ OpenCL ¡ Compiler ¡ AMD ¡ OpenCL ¡ Compiler ¡
? ¡ ? ¡
What ¡we ¡want ¡
Python/NumPy ¡ + ¡ ¡Annota;ons ¡ MatLab ¡
Intermediate ¡ Represen-‑ ¡ ta;on ¡
MatLab ¡ ¡ to ¡IR ¡ Python ¡ ¡ to ¡IR ¡ IR ¡to ¡ ¡ mul;core ¡ IR ¡to ¡ ¡ NVidia ¡ IR ¡to ¡ ¡ CELL ¡ IR ¡to ¡ ¡ AMD ¡
Issues ¡with ¡MATLAB ¡
- No ¡formal ¡specifica;on ¡and ¡no ¡official ¡
publicly-‑available ¡implementa;on ¡
– McLab ¡group ¡is ¡crea;ng ¡on ¡a ¡best-‑effort ¡ specifica;on; ¡
- Designed ¡for ¡interpreta;on ¡not ¡for ¡efficient ¡
execu;on; ¡
- Many ¡dynamic ¡features ¡
– But ¡many ¡of ¡those ¡are ¡not ¡needed ¡or ¡are ¡misused; ¡
Goals ¡for ¡Hendren’s ¡group ¡
- Create ¡a ¡modern ¡and ¡open ¡research ¡
framework ¡for ¡MATLAB: ¡
– Focus ¡on ¡dynamic ¡features ¡that ¡are ¡effec;vely ¡ used ¡ – Facilitate ¡crea;on ¡of ¡extensions ¡for ¡domain-‑ specific ¡languages ¡ – Create ¡a ¡suitable ¡IR ¡ ¡
Hendren’s ¡McLab ¡Vision: ¡ “start ¡with ¡the ¡languages ¡ that ¡scien;sts ¡are ¡using” ¡
Challenges ¡
- Type ¡inference ¡
- Dynamic ¡features ¡
- Loose ¡Language ¡specifica;ons ¡
- Diverse, ¡complex, ¡and ¡evolving ¡hardware ¡