150 likes | 294 Views
Design of A Custom Vector Operation API Exploiting SIMD Intrinsics within Java. Presented by John-Marc Desmarais Authors: Jonathan Parri, John-Marc Desmarais, Daniel Shapiro, Miodrag Bolic and Voicu Groza. CARG 2010. Overview. Introduction What is SIMD? jSIMD Userflow
E N D
Design of A Custom Vector Operation API Exploiting SIMD Intrinsics within Java Presented by John-Marc Desmarais Authors: Jonathan Parri, John-Marc Desmarais, Daniel Shapiro, Miodrag Bolic and Voicu Groza
CARG 2010 Overview • Introduction • What is SIMD? • jSIMDUserflow • Issues and Considerations • Java Native Interface • Current Implementation • Results • Future Work • Conclusion carg.site.uottawa.ca
CARG 2010 Introduction SIMD (Single Instruction Multiple Data) • Many embedded systems have begun to take advantage of the Java framework. • JVMs can be embedded or rest on top of the OS. • SIMD is an often under utilized option available on many processors. (O3 compilation) • In Java it is up to the JVM to best decide how to use SIMD if available at runtime. carg.site.uottawa.ca
CARG 2010 SIMD Single Instruction Multiple Data Functional Unit Data Multiple processing elements that performs the same operation on data simultaneously. Functional Unit Instruction … Functional Unit carg.site.uottawa.ca
Common SIMD Implementations xmm0 xmm1 • AMD 3DNow! • Intel MMX • SSE (Streaming SIMD Extensions) • AltiVec from Apple, IBM and Freescale • VIS from Sun Microsystems xmm2 xmm3 128 bits x86/x64 PowerPC SPARC
CARG 2010 jSIMD: User Flow SIMD (Single Instruction Multiple Data) Current SIMD Optimization Java Flow Standard Java Profile at Runtime Change Java Code Runtime JVM to SIMD Mapping May take very long or may not even achieve best SIMD usage jSIMD SIMD Optimization Approach Standard Java with jSIMD carg.site.uottawa.ca
CARG 2010 Issues & Considerations SIMD (Single Instruction Multiple Data) Packing • Packaging and aligning data into SIMD registers is very time consuming. • Transactional • Intermediate values should not leave SIMD memory and register space. • Target Specifics • Various targets have different SIMD implementations. (May not even exist, fallback) carg.site.uottawa.ca
CARG 2010 jSIMD: SIMD for Java SIMD (Single Instruction Multiple Data) Java and the JNI • Java allows programs to use native libraries. • SIMD instructions can be called manually from native code. • Solution! Map all SIMD intrinsic into JNI making them invisible to the Java programmer. • No system specific code/headers are permitted in the library so compilation can be performed automatically on any platform. carg.site.uottawa.ca
CARG 2010 jSIMD: SIMD for Java SIMD (Single Instruction Multiple Data) Current Implementation Running Targets: Intel x86/x64 AMD x86/x64 SPARC PowerPC Future Targets: NIOS II with custom SIMD Unit carg.site.uottawa.ca
CARG 2010 jSIMD: User Perspective SIMD (Single Instruction Multiple Data) Transparency • Extended Java ISA with parallel SIMD operations. • Native operations hidden as Java methods. • User is not concerned with native interface. Java jSIMD API Native SIMD Mappings in C Base Java ISA carg.site.uottawa.ca
CARG 2010 Results SIMD (Single Instruction Multiple Data) JVM versus Programmer Know-How JVM does an impressive job at SIMD mapping but is not as effective as a determined programmer with an understanding of the underlying target architecture. carg.site.uottawa.ca
CARG 2010 Results
CARG 2010 Design Space Exploration Memory Hierarchy Coprocessors & Hardware Accelerators Multiprocessors (Add more processors) DSE Multi-Core Interconnect Topology ISE (Instruction Set Extensions) SIMD (Single Instruction Multiple Data) GPU (Graphical Processing Units) carg.site.uottawa.ca
PARRI:CARG 2010 Future Work SIMD (Single Instruction Multiple Data) Future as DSE Avenue Profile Manual Specification and Automatic Detection for Native SIMD Analysis Vectorize Rewrite Java for jSIMD carg.site.uottawa.ca
PARRI:CARG 2010 Conclusion We have shown that jSIMD can be used to accelerate VM-based applications more effectively than contemporary automated solutions. • VMs should integrate this approach into their languages. • Until such time as VM support is made available, programmers can use our API to accelerate their applications. carg.site.uottawa.ca