SLIDE 1 Virtual Machine and Bytecode for Optimization on Heterogeneous Systems
Kerry A. Seitz, Jr. and Mark C. Lewis Trinity University, San Antonio, TX
SLIDE 2
Acknowledgments
Trinity University Department of Computer Science Trinity University Mach Fellowship Program
SLIDE 3
Overview
Introduction Bytecode Design Implementation Conclusion
SLIDE 4
Heterogeneous Computing
Use all hardware
components available
CPU, GPU, FPGA, DSP
Increase Performance Hardware independent
| Introduction | Bytecode Design | Implementation | Conclusion |
SLIDE 5
Heterogeneous Computing Challenges
Different programming models Different combinations of devices Little development tool support
OpenCL, CUDA
Developer training
| Introduction | Bytecode Design | Implementation | Conclusion |
SLIDE 6
Motivations
Make heterogeneous computing easier Runtime code optimizations Platform independence
| Introduction | Bytecode Design | Implementation | Conclusion |
SLIDE 7
Annotation
Provide optimization hints to VM Can be disregarded until optimization Backwards compatibility Two formats
Within instructions Annotation file
| Introduction | Bytecode Design | Implementation | Conclusion |
SLIDE 8
Annotation Examples
Immutability Escape thread/stack frame Generics/Type Erasure Specify Device
| Introduction | Bytecode Design | Implementation | Conclusion |
SLIDE 9
Popular Virtual Machines
Java – stack-based Dalvik – register-based (16 registers) Both have issues
| Introduction | Bytecode Design | Implementation | Conclusion |
SLIDE 10
Virtual Machine Design
Variables
216 per stack frame Type associated with each Annotations
Class Files
Header modeled after Dalvik Annotations
| Introduction | Bytecode Design | Implementation | Conclusion |
SLIDE 11
Instruction Format
| Introduction | Bytecode Design | Implementation | Conclusion |
SLIDE 12
Instruction Format
| Introduction | Bytecode Design | Implementation | Conclusion |
SLIDE 13
Instruction Format
| Introduction | Bytecode Design | Implementation | Conclusion |
SLIDE 14
Instruction Format
| Introduction | Bytecode Design | Implementation | Conclusion |
SLIDE 15
Programming Language
Scala OpenCL
High-level Object oriented/functional Compiles to JVM Lower-level Heterogeneous Platform independent
(with correct drivers)
| Introduction | Bytecode Design | Implementation | Conclusion |
SLIDE 16
GPU Execution
Uses OpenCL (through JavaCL) Compiles bytecode instructions into OpenCL kernel Parallelizes over an array of data
| Introduction | Bytecode Design | Implementation | Conclusion |
SLIDE 17
Summary
Heterogeneous computing is hard, but increasingly
essential
Designed bytecode to aid in heterogeneous computing
Optimization hints in annotations Platform independent
Implementation in Scala with OpenCL
| Introduction | Bytecode Design | Implementation | Conclusion |
SLIDE 18
Future research
Design more annotations Implement more annotations Develop lower level interpreter/JIT compiler Explore program analysis techniques
| Introduction | Bytecode Design | Implementation | Conclusion |
SLIDE 19
Questions?