Compiler Optimisation

Similar documents
Compiler Optimisation 2014 Course Project

Compiler Optimisation

Compiler Optimisation

Compiler Optimisation

Assignment Tutorial.

Object Model. Object Orientated Analysis and Design. Benjamin Kenwright

Operating Systems. read the warning about the size of the project make sure you get the 6 th edition (or later) of the book

FIT3056 Secure and trusted software systems. Unit Guide. Semester 2, 2010

Submitting Coursework via SurreyLearn

UCD School of Information and Library Studies. IS30020: Web Publishing

CSCI544, Fall 2016: Assignment 2

CMPE 152 Compiler Design

PROGRAMME SPECIFICATION POSTGRADUATE PROGRAMMES. Programme name Professional Engineering (Civil Engineering)

Assignment 2: Understanding Data Cache Prefetching

CSCI544, Fall 2016: Assignment 1

a f b e c d Figure 1 Figure 2 Figure 3

PROGRAMME SPECIFICATION POSTGRADUATE PROGRAMMES

Masters in Advanced Computer Science

Hugh Leather, Edwin Bonilla, Michael O'Boyle

Inf2C - Computer Systems Lecture 1 Course overview & the big picture

Administrative Guidance for Internally Assessed Units

Operating Systems Course Overview

EECS2031 Winter Software Tools. Assignment 2 (15%): C Programming

C152 Laboratory Exercise 5

CS / Cloud Computing. Recitation 11 November 5 th and Nov 8 th, 2013

Automatic Selection of Compiler Options Using Non-parametric Inferential Statistics

STEP-BY-STEP DICAS TUTORIAL SPRING 2017 MATCH CYCLE. CSULB DPD Program Prepared December 2016 Dr. Rachel Blaine, DPD Director

CS 240 Fall Mike Lam, Professor. Just-for-fun survey:

L25: Modern Compiler Design Exercises

CSSE2002/7023 The University of Queensland

ENCM 501 Winter 2016 Assignment 1 for the Week of January 25

ENCM 501 Winter 2018 Assignment 2 for the Week of January 22 (with corrections)

Assignment 1: Understanding Branch Prediction

Programming Standards: You must conform to good programming/documentation standards. Some specifics:

Pradip Bose Tom Conte IEEE Computer May 1998

ITP489 In-Memory DBMS for Real Time Analytics

Department of Computer Science. COS 122 Operating Systems. Practical 3. Due: 22:00 PM

APPLYING TO UCAS FOR ENTRY IN AUTUMN 2017 FORMER STUDENT GUIDE

Understanding and Exploring Memory Hierarchies

COMP 3331/9331: Computer Networks & Applications Programming Assignment 2 for Session 1, 2016

High Performance Computing in C and C++

ECEN Security and Privacy for Big Data. Introduction Professor Yanmin Gong 08/22/2017

CSCI 201L Syllabus Principles of Software Development Spring 2018

Online Coursework Management (OCM) User Guide

COMP250: Introduction to Computer Science. Jérôme Waldispühl & Carlos Oliver Gonzalez School of Computer Science McGill University

Master of Engineering in Computer Engineering Orientation. August 22, Pierce Cantrell Department of Electrical and Computer Engineering

LDPC Simulation With CUDA GPU

e-subs: Centre Marks Submission (CMS) FAQs

Probabilistic Modelling and Reasoning Assignment 2

Pearson Edexcel Award

CS 432 Fall Mike Lam, Professor. Compilers. Advanced Systems Elective

Important Project Dates

CSC209. Software Tools and Systems Programming.

COMP Assignment 1

ITS310: Introduction to Computer Based Systems Credit Hours: 3

CS 432 Fall Mike Lam, Professor. Compilers. Advanced Systems Elective

Project 5 Handling Bit Arrays and Pointers in C

C152 Laboratory Exercise 5

COMP 3500 Introduction to Operating Systems Project 5 Virtual Memory Manager

5COS005W Coursework 2 (Semester 2)

APPENDIX Summary of Benchmarks

Algorithms and Data Structures

Design Project Computation Structures Fall 2018

The University of Queensland School of Information Technology and Electrical Engineering Semester 2, 2005 CSSE1000 PROJECT

CS3733: Operating Systems

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit.

There is no required text book for this course. Online reading material, videos, and PowerPoint slides etc. will be provided via Canvas.

Lecture 1. CMSC 412 S17 (lect 1)

Computer Graphics Coursework 1

ENCM 501 Winter 2017 Assignment 3 for the Week of January 30

Advanced Client-Side Web Programming CSCI 491/595 Syllabus Fall 2018

CS111: Intro to Computer Science

Banner Student. Release Guide

Your submitted proj3.c must compile and run on linprog as in the following example:

Getting started with my.acap

CSE 501! Principles and Applications! of Program Analysis! " Alvin Cheung" Spring 15"

ITT Technical Institute. TB143 Introduction to Personal Computers Onsite and Online Course SYLLABUS

Portland State University ECE 587/687. Caches and Memory-Level Parallelism

Inf2C Computer Systems. Coursework 2. MIPS Multi-cycle Processor Design

Database Systems (INFR10070) Dr Paolo Guagliardo. University of Edinburgh. Fall 2016

- b: size of block in bytes. - s: number of sets in the cache (or total number of sets between split caches). - n: associativity of cache.

You must pass the final exam to pass the course.

Practical: a sample code

Programming Assignment 5 (100 Points) START EARLY!

Assignment 1: Communicating with Programs

All LJMU programmes are delivered and assessed in English

Advanced Vision Practical

15-440: Project 4. Characterizing MapReduce Task Parallelism using K-Means on the Cloud

ECE 4514 Digital Design II. Spring Lecture 13: Logic Synthesis

Australian Informatics Olympiad Thursday 23 August, Information Booklet

Computer Architecture

Genome Sciences 373: Genome Informatics. Quiz section #1 March 29, 2018

Welcome to today s Webcast. Thank you so much for joining us today!

CMSC 132: Object-Oriented Programming II. Administrivia

Advanced Relational Database Management MISM Course S A3 Spring 2019 Carnegie Mellon University

Tuesday and Thursday 1:05 pm - 2:25 pm

Part 1: Written Questions (60 marks):

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit.

e-procurement Integrated e-bidding User Handbook Bidder Version 1 Wien, October 27th, 2016

DM811 - Heuristics for Combinatorial Optimization

Transcription:

Compiler Optimisation 2 Coursework Hugh Leather IF 1.18a hleather@inf.ed.ac.uk Institute for Computing Systems Architecture School of Informatics University of Edinburgh 2018

Course work Based on GCC compiler One piece of course work: 25% of course mark Set today and due Thursday 4pm Feb 22rd 2018 week 6 Feedback due Thursday 4pm Mar 8th 2018 week 8 Penalties for late submission. Plagiarism software used. Do your own work!

Iterative Compilation Find the best way to compile a program

Goal Evaluate different compiler optimisation settings on a set of benchmarks. Try to beat -O3 Write a report about your methodology and your findings.

Program Optimisation in GCC GCC supports some simple levels of optimisations: -O1, -O2, -O3 At each level, a set of optimisations are enabled (25 for O1, 25+29 for O2 and 19+28+9 for O3) At higher levels, more optimisations are enabled which results in potentially 1 faster code, but also slows down the compilation process. Rather than using these pre-defined optimisation options, the users can enable individual options themselves, e.g. -funroll-loops. For more information on optimisation options see http://gcc.gnu.org/onlinedocs/gcc/optimize-options.html 1 Not all optimisations make code better

Methodology: Evaluating Compiler Flags Always use -O3: Some optimisations won t work without it Randomly choose flags (on/off) and parameter values http://gcc.gnu.org/onlinedocs/gcc/optimize-options.html Evaluate 200 randomly chosen configurations (i.e. combinations of optimisations) Use the same configurations for all benchmarks!

Running Experiments Avoid noise: Make sure no one else is logged on to the computer (using who) and no other applications are running (using top). Dont run on top of AFS use /disk/scratch or /tmp. BUT: move the results back to your home-directory and dont leave the data accessible to everyone Run benchmarks at least 10 times to get stable results. Determine how many measurements you need to get a stable value. Compute and report average runtime. Also report the variance and the number of iterations you used.

Running Experiments - Cont. Use scripting languages to automate the process of evaluating optimisations on the benchmark programs. Example (pseudo code) for each b in benchmarks for each o in optimisations compile b with o run b N times and record runtimes calculate average runtime and variance end end

The Benchmarks We use 14 benchmarks from the SPEC CPU2006 and MediaBench II suites. CPU intensive benchmarks developed from real user applications. Download and extract the programs (use wget) from: https://docs.google.com/file/d/0b5gasmlwjhtoatdvafkzuznobdq/edit Let me know if you need more disk space!

Directory Structure

Compiling and Running the Benchmarks Compiling a program with certain optimisations enabled and executing it a single time: cd 400.perlbench/src/ make CFLAGS="-funroll-loops param max-unroll-times=4" cd.././run.sh

Report and Results Maximum 5 pages + 2 pages for results Explain what you have done. Precisely describe the experimental setup. Architecture and platform. Timing method. Number of runs per benchmark/configuration For every program report performance of: Baseline -O0, -O1, -O2, -O3 Best found flags for individual program. Best found single set of flags across all programs. Average across all flag settings (expected random performance). Results should be detailed: per-program, average, variance

Report and Results - contd. Store all raw data in a file. For each program: First line: program name Following lines: flag setting and all runtimes Runtimes in milliseconds, without decimal digits 400.perlbench "-O0" 837 833 890 850 813 828... "-O1" 602 620 610 611 650 580...... 401.bzip2 "-O0" 837 833 890 850 813 828... "-O1" 602 620 610 611 650 580...... e-mail file to: hleather@inf.ed.ac.uk WITH the subject: copt-results

Report Structure Abstract. (Summary of paper) and Introduction Evaluation methodology: Selection of flags, etc. Experimental setup: Platform. How time was measured. Number of runs. Results (for each program) Baseline -O0, -O1, -O2, -O3 Best found flags for individual program. Best found single set of flags across all programs. Average across all flag settings (expected random performance). Analysis and Discussion of Results. Followed by conclusion.

Submission. Awarding of Marks Submit to ITO written report by Thursday 4pm Feb 22rd 2018. Marks are awarded for clear explanation of experimental methodology and thorough analysis of results. Remember wish to see optimisation setting that gives best results per program AND the setting that is best for all the benchmarks.

Final Remarks For further questions e-mail me Start early!! It takes time to run the experiments! Deadline: Thursday 4pm Feb 22rd 2018

PPar CDT Advert 4-year programme: MSc by Research + PhD Research-focused: Work on your thesis topic from the start Collaboration between: University of Edinburgh s School of Informatics Ranked top in the UK by 2014 REF Edinburgh Parallel Computing Centre UK s largest supercomputing centre Research topics in software, hardware, theory and application of: Parallelism Concurrency Distribution Full funding available Industrial engagement programme includes internships at leading companies Now accepting applications! Find out more and apply at: pervasiveparallelism.inf.ed.ac.uk The biggest revolution in the technological landscape for fifty years