Top Banner
Auto-tuning HotSpot JVM using OpenTuner Milinda Fernando (CSE,Univ. of Moratuwa) Tharindu Rusira (CSE, Univ. of Moratuwa) Chalitha Perera (CSE, Univ. of Moratuwa) Chamara Philips (CSE, Univ. of Moratuwa) Prof. Sanath Jayasena (CSE, Univ. of Moratuwa) Prof. Saman Amarasinghe (CSAIL, MIT) OpenTuner Workshop International Symposium on Code Generation and Optimization 2015
12

Auto-tuning HotSpot JVM using OpenTuneropentuner.org/slides/opentuner-cgo2015-rusira-jvm-opt.pdf · Auto-tuning HotSpot JVM using OpenTuner Milinda Fernando (CSE,Univ. of Moratuwa)

Jun 27, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Auto-tuning HotSpot JVM using OpenTuneropentuner.org/slides/opentuner-cgo2015-rusira-jvm-opt.pdf · Auto-tuning HotSpot JVM using OpenTuner Milinda Fernando (CSE,Univ. of Moratuwa)

Auto-tuning HotSpot JVM using OpenTuner

Milinda Fernando (CSE,Univ. of Moratuwa)Tharindu Rusira (CSE, Univ. of Moratuwa)Chalitha Perera (CSE, Univ. of Moratuwa)Chamara Philips (CSE, Univ. of Moratuwa)

Prof. Sanath Jayasena (CSE, Univ. of Moratuwa)Prof. Saman Amarasinghe (CSAIL, MIT)

OpenTuner WorkshopInternational Symposium on Code Generation and Optimization 2015

Page 2: Auto-tuning HotSpot JVM using OpenTuneropentuner.org/slides/opentuner-cgo2015-rusira-jvm-opt.pdf · Auto-tuning HotSpot JVM using OpenTuner Milinda Fernando (CSE,Univ. of Moratuwa)

Motivation

● Java Virtual machine is a complex piece of Software

● Responsible for providing execution environment for Java

programs

● What if the JVM can execute Java applications better

(faster?)

Page 3: Auto-tuning HotSpot JVM using OpenTuneropentuner.org/slides/opentuner-cgo2015-rusira-jvm-opt.pdf · Auto-tuning HotSpot JVM using OpenTuner Milinda Fernando (CSE,Univ. of Moratuwa)

JVM and Complexity

● HotSpot JVM

● More than 600 tunable flags and parameters

● How to handle a configuration space of this scale?

Page 4: Auto-tuning HotSpot JVM using OpenTuneropentuner.org/slides/opentuner-cgo2015-rusira-jvm-opt.pdf · Auto-tuning HotSpot JVM using OpenTuner Milinda Fernando (CSE,Univ. of Moratuwa)

OpenTuner[1]

[1] J. Ansel, S. Kamil, K. Veeramachaneni, U.-M. O'Reilly and S. Amarasinghe, "OpenTuner: An Extensible Framework for Program Autotuning," in MIT CSAIL Technical Report MIT-CSAIL-TR-2013-026, November 1, 2013.

● [1] provides results for a number of successful case studies

● GCC/G++ auto-tuner inspired a solution for JVM auto-tuning

● Multiple search techniques

● Evolutionary algorithms allow to reach optima aggressively in non-trivial

configuration landscapes● works best with massive search spaces and manages computational complexity

really well

Page 5: Auto-tuning HotSpot JVM using OpenTuneropentuner.org/slides/opentuner-cgo2015-rusira-jvm-opt.pdf · Auto-tuning HotSpot JVM using OpenTuner Milinda Fernando (CSE,Univ. of Moratuwa)

Configuration ManipulatorUsed to define the configuration space

def m anipulator(self):

m = m anipulator.ConfigurationM anipulator()

for flag_set in self.bool_flags:

for flag in flag_set:

m .add_param eter(m anipulator.Enum Param eter(flag, ['on', 'off']))

for flag_set in self.param _flags:

for flag in flag_set:

value = flag_set[flag]

if(value['m in'] > = value['m ax']):

m .add_param eter(m anipulator.IntegerParam eter(value['flagnam e'],value['m ax'],value['m in']))

else:

m .add_param eter(m anipulator.IntegerParam eter(value['flagnam e'],value['m in'],value['m ax'])

return m

Page 6: Auto-tuning HotSpot JVM using OpenTuneropentuner.org/slides/opentuner-cgo2015-rusira-jvm-opt.pdf · Auto-tuning HotSpot JVM using OpenTuner Milinda Fernando (CSE,Univ. of Moratuwa)

Run function

Measures the quality (fitness) of a given configuration.

Eg. ● For SPECjvm2008, operations per minute (ops/m)

● For DaCapo, execution time in ms

Page 7: Auto-tuning HotSpot JVM using OpenTuneropentuner.org/slides/opentuner-cgo2015-rusira-jvm-opt.pdf · Auto-tuning HotSpot JVM using OpenTuner Milinda Fernando (CSE,Univ. of Moratuwa)

JVM Flag Hierarchy

7

JVM flags

ByteCode CodeCache Compilation DeOptimization GCInterpreter Memory Priorities Temporary

TieredCompilation + C1

if (TieredCompilation) == TRUE

C2 Common

CMS G1 Throughput Collector

ParallelOld Parallel

Serial

Page 8: Auto-tuning HotSpot JVM using OpenTuneropentuner.org/slides/opentuner-cgo2015-rusira-jvm-opt.pdf · Auto-tuning HotSpot JVM using OpenTuner Milinda Fernando (CSE,Univ. of Moratuwa)

JVM Tuner

Page 9: Auto-tuning HotSpot JVM using OpenTuneropentuner.org/slides/opentuner-cgo2015-rusira-jvm-opt.pdf · Auto-tuning HotSpot JVM using OpenTuner Milinda Fernando (CSE,Univ. of Moratuwa)

Performance Improvement of SPECjvm2008 Startup Benchmarks

Page 10: Auto-tuning HotSpot JVM using OpenTuneropentuner.org/slides/opentuner-cgo2015-rusira-jvm-opt.pdf · Auto-tuning HotSpot JVM using OpenTuner Milinda Fernando (CSE,Univ. of Moratuwa)

Performance Improvement of Dacapo Benchmarks

Page 11: Auto-tuning HotSpot JVM using OpenTuneropentuner.org/slides/opentuner-cgo2015-rusira-jvm-opt.pdf · Auto-tuning HotSpot JVM using OpenTuner Milinda Fernando (CSE,Univ. of Moratuwa)

What happens to the JVM when auto-tuned?

● Observations on heap usage, compilation and class loading before and after tuning

● Compilation rate has a major impact on performance

DaCapo pmd benchmark CR (38.73%) DaCapo h2 benchmark CR (5.76%)

Page 12: Auto-tuning HotSpot JVM using OpenTuneropentuner.org/slides/opentuner-cgo2015-rusira-jvm-opt.pdf · Auto-tuning HotSpot JVM using OpenTuner Milinda Fernando (CSE,Univ. of Moratuwa)

Thank You