Your SlideShare is downloading. ×
0
The role of Java™ in
Heterogeneous Computing
…and how you can help!

Nandini Ramani
Vice President, Java Platform
@eyeseew...
The following is intended to outline our general product direction. It
is intended for information purposes only, and may ...
Java

3

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
9 Million Java developers worldwide
#1 Choice for developers
#1 Development platform
5 of Top 5 OEMs ship Java ME
3 Billio...
Life of Java Program

Hello.java

5

javac

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Hello.cl...
Oracle Java Platforms Overview
Footprint
100MB+

10MB-100MB

1MB-10MB

50KB-1MB

Java Card
SECURITY

6

Java ME Embedded
S...
Rich Tools
Ecosystem

7

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Rich Tools Ecosystem
Choice is good
 Java has rich and competitive tools ecosystem
 Ports to many platforms and tool cha...
Java is Open!

9

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
OpenJDK
In a Nutshell
“The place to collaborate on an open-source implementation of the
Java Platform, Standard Edition, a...
OpenJDK Virtuous Cycle
Open Community – GPL v2 +
Classpath Exception

Both Gratis and Commercial
offerings (Including Supp...
64-bit
Porting and optimizing
Oracle JDK for Linux ARM/V8
GA - H1 2015

12

Copyright © 2013, Oracle and/or its affiliates...
Java and
Heterogeneous
Compute

13

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
“The HSA Foundation goal is to make it
dramatically easier to program
heterogeneous parallel devices.”

14

Copyright © 20...
“The HSA Foundation goal is to make it
dramatically easier to program
heterogeneous parallel devices.”

15

Copyright © 20...
Parallel
Java and Heterogeneous Computing

 Power usage is leading to parallel throughput
 Programmers need to execute a...
History of Parallelism Support in Java
java.util.concurrent
(jsr166)
Phasers, etc
java.lang.Thread
(jsr166)

1.4
2002
17

...
Parallelism Support in Java 8 – Lambdas
Simplifying the code to write parallel actions
// The OLD way. Simplistic, Brittle...
Parallelism Support in Java 8 – Lambdas
Simplifying the code to write parallel actions
// Total Salary of all California E...
Parallelism Support in Java 8 – Arrays
Simplifying the code to write parallel actions
// New Parallel Methods added to Arr...
“The HSA Foundation goal is to make it
dramatically easier to program
heterogeneous parallel devices.”

21

Copyright © 20...
Heterogeneous
Java and Heterogeneous Computing

 Future is power-constrained
 Tradeoff is latency vs. throughput
 Typic...
New Challenges –
Array-wise programming concepts
Java and Heterogeneous Computing
Array-wise programming

Exploit the hard...
New Challenges – “WORA” Becomes Local
Java and Heterogeneous Computing
 Transitioning from write once, run anywhere “WORA...
New Challenges – Route Work to Best Resource
Java and Heterogeneous Computing
 Some cores optimized for:
– High Throughpu...
New Challenges – Non-Uniform Memory Access
Java and Heterogeneous Computing
 Heterogeneous systems have

JVM

bumpy costs...
How do we meet these and other challenges?
JVM
OS
ISA 1
Chip 1

Copyright © 2013, Oracle and/or its affiliates. All rights...
How do we meet these and other challenges?

http://openjdk.java.net/projects/sumatra/

28

Copyright © 2013, Oracle and/or...
Project Sumatra
Java and Heterogeneous Computing
 OpenJDK Project with leadership from AMD and Oracle
 Goal is to simpli...
30

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Gary Frost
Software Fellow

31

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Sumatra Demo
Java and Heterogeneous Computing
 Histogram of male/female (5150) names
 Found in selected works of ‘Charle...
Sumatra Demo
Java and Heterogeneous Computing
 Here is the actual Java 8 code at the heart of the demo
Arrays.stream(libr...
Sumatra Demo
Java and Heterogeneous Computing
 Java 8 can efficiently dispatch the enclosed lambda across multiple

cores...
35

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
HSA enablement of JAVA
Java 7

Java 8

Beyond Java 8

OpenCL enabled Aparapi

HSA enabled Aparapi

Sumatra

• AMD initiate...
How you can help!
Java and Heterogeneous Computing
 Project Sumatra is Open Source
 We can always use help:
– Test build...
38

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
39

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Upcoming SlideShare
Loading in...5
×

Keynote (Nandini Ramani) - The Role of Java in Heterogeneous Computing & How You Can Help - by Nandini Ramani, VP, Java Platform, Oracle Corporation

3,329

Published on

Keynote presentation, The Role of Java in Heterogeneous Computing, and How You Can Help, by Nandini Ramani, VP, Java Platform, Oracle Corporation, at the AMD Developer Summit (APU13), Nov. 11-13, 2013.

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
3,329
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
43
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Keynote (Nandini Ramani) - The Role of Java in Heterogeneous Computing & How You Can Help - by Nandini Ramani, VP, Java Platform, Oracle Corporation"

  1. 1. The role of Java™ in Heterogeneous Computing …and how you can help! Nandini Ramani Vice President, Java Platform @eyeseewaters 1 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  2. 2. The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. ©2013 Oracle Corporation 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  3. 3. Java 3 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  4. 4. 9 Million Java developers worldwide #1 Choice for developers #1 Development platform 5 of Top 5 OEMs ship Java ME 3 Billion mobile phones run Java 80% of mobile developers use Java 100% of Blu-Ray players ship with Java 97% of enterprise desktops run Java 89% of desktops in USA run Java 7 Billion Java Cards sold 5 Billion Java Cards in use 115 Million TV devices run Java 4 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  5. 5. Life of Java Program Hello.java 5 javac Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Hello.class Hello.jar Java Virtual Machine
  6. 6. Oracle Java Platforms Overview Footprint 100MB+ 10MB-100MB 1MB-10MB 50KB-1MB Java Card SECURITY 6 Java ME Embedded SMALL EMBEDDED Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Java SE Embedded MEDIUM EMBEDDED LARGE EMBEDDED Java SE DESKTOP SERVER
  7. 7. Rich Tools Ecosystem 7 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  8. 8. Rich Tools Ecosystem Choice is good  Java has rich and competitive tools ecosystem  Ports to many platforms and tool chains 8 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  9. 9. Java is Open! 9 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  10. 10. OpenJDK In a Nutshell “The place to collaborate on an open-source implementation of the Java Platform, Standard Edition, and related projects.” http://openjdk.java.net 10 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  11. 11. OpenJDK Virtuous Cycle Open Community – GPL v2 + Classpath Exception Both Gratis and Commercial offerings (Including Support, Enterprise tooling, etc, available) Java 7 RI Binaries 30+ Projects Java for IBM Platforms Source contributions Java for SAP Platforms Java for Red Hat Platforms Companies AND Individuals 11 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Customized VM for Internal Use ...and many more
  12. 12. 64-bit Porting and optimizing Oracle JDK for Linux ARM/V8 GA - H1 2015 12 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  13. 13. Java and Heterogeneous Compute 13 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  14. 14. “The HSA Foundation goal is to make it dramatically easier to program heterogeneous parallel devices.” 14 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  15. 15. “The HSA Foundation goal is to make it dramatically easier to program heterogeneous parallel devices.” 15 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  16. 16. Parallel Java and Heterogeneous Computing  Power usage is leading to parallel throughput  Programmers need to execute a mix of parallel and sequential tasks  Java remains the tool of choice as hardware tilts toward the parallel 16 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  17. 17. History of Parallelism Support in Java java.util.concurrent (jsr166) Phasers, etc java.lang.Thread (jsr166) 1.4 2002 17 5.0 … 2004 … Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Fork/Join Framework (jsr166y) 7 8 6 2006 Project Lambda …. 2011 … 2014
  18. 18. Parallelism Support in Java 8 – Lambdas Simplifying the code to write parallel actions // The OLD way. Simplistic, Brittle, and Serialized // Find Total Salary of all California Employees public static int californiaSalary(List<Employee> employees, int salary) { int sum=0; for (Employee e : employees) { if (e.getStateCode() == CALIFORNIA) sum += e.getSalary(); } return sum; } 18 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  19. 19. Parallelism Support in Java 8 – Lambdas Simplifying the code to write parallel actions // Total Salary of all California Employees int sum = employees.parallelStream() .filter(e -> e.getStateCode() == CALIFORNIA) .mapToInt(e -> e.getSalary()) .sum(); 19 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  20. 20. Parallelism Support in Java 8 – Arrays Simplifying the code to write parallel actions // New Parallel Methods added to Array // In place cumulation Array.parallelPrefix(anArray, BinaryOperator) // Sort Array.parallelSort(anArray); // In place mutations Array.parallelSetAll(anArray, UnaryOperator) // Special Iterator for decomposition in addition to single-element Array.spliterator(anArray) 20 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  21. 21. “The HSA Foundation goal is to make it dramatically easier to program heterogeneous parallel devices.” 21 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  22. 22. Heterogeneous Java and Heterogeneous Computing  Future is power-constrained  Tradeoff is latency vs. throughput  Typical system will be a few low latency cores, many high throughput cores, some special accelerators 22 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  23. 23. New Challenges – Array-wise programming concepts Java and Heterogeneous Computing Array-wise programming Exploit the hardware  Java is a concurrent language with  Java JDK 8 includes parallel concurrent and parallel programming support built into the core 23 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. decomposition and programming tools out of the box.
  24. 24. New Challenges – “WORA” Becomes Local Java and Heterogeneous Computing  Transitioning from write once, run anywhere “WORA” to a world where one JVM can access multiple ISAs at once JVM 1 JVM OS 1 OS 2 OS ISA 1 ISA 2 ISA 1 ISA 2 Chip 1 Chip 2 Chip 1 Chip 2 Mem 1 24 JVM 2 Mem 2 Mem 1 Mem 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  25. 25. New Challenges – Route Work to Best Resource Java and Heterogeneous Computing  Some cores optimized for: – High Throughput JVM – Low latency OS ? – Low Power  Where should work be routed? 25 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. ISA 1 ISA 2 Chip 1 Chip 2 Mem 1 – Special Accelerators Mem 2
  26. 26. New Challenges – Non-Uniform Memory Access Java and Heterogeneous Computing  Heterogeneous systems have JVM bumpy costs with non-uniform memory – JVM can manage memory on the fly in response to program dynamics – Manage memory access and data flow across ISAs 26 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. OS ISA 1 ISA 2 Chip 1 Chip 2 Mem 1 Memory Mem 2
  27. 27. How do we meet these and other challenges? JVM OS ISA 1 Chip 1 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Chip 2 Mem 1 27 ISA 2 Mem 2
  28. 28. How do we meet these and other challenges? http://openjdk.java.net/projects/sumatra/ 28 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  29. 29. Project Sumatra Java and Heterogeneous Computing  OpenJDK Project with leadership from AMD and Oracle  Goal is to simplify Heterogeneous Compute (via multiple ISAs) for nine million+ Java developers  Oracle team includes Labs and SPARC expertise  HSA Standards are important: – HSAIL helps with common back end notation – HSA helps with portability 29 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  30. 30. 30 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  31. 31. Gary Frost Software Fellow 31 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  32. 32. Sumatra Demo Java and Heterogeneous Computing  Histogram of male/female (5150) names  Found in selected works of ‘Charles Dickens’  So conceptually we have sequence of nested loops. for each selected book{ for each name{ for each occurrence of ‘name’ in ‘book’{ name.count++; } } } 32 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Can be done in parallel !
  33. 33. Sumatra Demo Java and Heterogeneous Computing  Here is the actual Java 8 code at the heart of the demo Arrays.stream(library) .filter(Book::isSelected) .forEach(book-> Arrays.stream(names) .parallel() // <-- Loop over the names in parallel. .forEach(name -> // for each occurrence of ‘name’ in ‘book’ // name.count++; ); ); 33 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  34. 34. Sumatra Demo Java and Heterogeneous Computing  Java 8 can efficiently dispatch the enclosed lambda across multiple cores when the stream is marked as parallel() Arrays.stream(T[] array) .parallel() .forEach(t -> /* lambda */)  A Sumatra JVM will dispatch to CPU and HSA enabled GPU cores. – JVM converts (JITS) bytecode to HSAIL and executes via HSA Runtime 34 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  35. 35. 35 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  36. 36. HSA enablement of JAVA Java 7 Java 8 Beyond Java 8 OpenCL enabled Aparapi HSA enabled Aparapi Sumatra • AMD initiated Open Source project • Java 8 Lambda based API • Java API for data parallel algorithms • HSA and SVM enablement • Adds Native GPU acceleration to JVM • Java 8 Lambda/Stream API • No need to learn OpenCL • JVM generates HSAIL via JIT • No explicit buffer transfers • JVM dispatches to CPU or GPU depending on workload characteristics. Java Application Java JDK Stream + Lambda API APARAPI API APARAPI / Lambda API OpenCL™ 36 HSAIL HSA Finalizer & Runtime HSA Finalizer & Runtime JVM JVM JVM GPU ISA CPU JIT HSAIIL OpenCL™ Compiler and Runtime CPU ISA Java Application Java Application GPU Copyright © 2013, Oracle and/or its affiliates. All rights reserved. GPU ISA CPU ISA CPU GPU GPU ISA CPU ISA CPU GPU
  37. 37. How you can help! Java and Heterogeneous Computing  Project Sumatra is Open Source  We can always use help: – Test builds – Track progress – Are you a VM or Compiler super star? We can always use more help! http://openjdk.java.net/projects/sumatra/ 37 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  38. 38. 38 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  39. 39. 39 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×