Optimization & Vectorization

Universiteit Utrecht - Information and Computing Sciences

academic year 2019/20 – 1st block

title image title image title image

Navigation

News

Lectures & Slides

Examination & Grading

Course Overview

Schedule

Literature & Links

Newsback to navigation

Recent news


August 21:

  • Website for 2019/2020.


Older news will be moved here.



Course Overview back to navigation

bunny logo image

Course: INFOMOV is a practical course on optimization: the art of improving software performance, without affecting functionality. We apply high level and low level optimizations, in a structured manner. Especially for the low level optimizations, we must intimately understand the hardware platform (CPU, GPU, memory, caches) and modify our code to use it efficiently.

Vectorization: Modern processors achieve their performance levels using parallel execution. This happens on the thread level, but also on the instruction level. Being able to produce efficient vectorized code is an important factor in achieving peak performance.

GPGPU: Graphics processors employ a streaming code execution model, taking vectorization to extremes, both in the programming model and the underlying architecture. Leveraging GPU processing power is an important option when optimizing existing code.

Context: Optimization is a vital skill for game engine developers, but also applies to other fields.

Lecturer: Jacco Bikker (j.bikker@uu.nl or bikker.j@gmail.com)

Comms: join us on Slack: UUGMT.

Lectures:

  • Mondays, 09:00h - 10:45h, room BBG-209
    Monday Working Lecture: 11:00 - 12:45
  • Wednesdays, 09:00h - 10:45h, room BBG-214
    Wednesday Working Lecture: 11:00 - 12:45

The course will be taught in English. Warning: A decent level of C/C++ is expected. Expect a significantly higher workload if you are a C++ novice.


Files back to navigation

Downloads

Cross-platform version of the C/C++ template used in the course.
OpenCL template for the GPGPU lectures.
OpenCL template for those that prefer C#.

Resources will be made available during the course.


Lecture Slides & Recommended Readingsback to navigation

Below is a list of all lectures with a very brief summary of the topics, slides downloads, and recommended readings to prepare for the lecture.
This list is tentative.

Lecture 01
Mon Sep 9

Topic: Introduction  This lecture serves as an introduction to the course. And: Profiling With or without knowledge of optimization, it proves hard to 'guess' application performance bottlenecks. Profiling is a vital first (and often repeated) step in a structured approach to optimization.

Suggested readings:

Designing for Performance, Scalability & Reliability: StarCraft II's Approach

Slides:
Will be made available after the lecture.

 
Lecture 02
Wed Sep 11

Topic: Low Level Optimization  In this lecture, we explore various low level factors that determine application performance.

Suggested readings:

Michael Karbo, Inside the CPU (Chapter 30 from PC Architecture)

Slides:
Will be made available after the lecture.


 
Lecture 03
Mon Sep 16

Topic: Caching (1)   Considering the huge latencies involved in fetching data from RAM, caches play a crucial role in 'feeding the beast'. We explore various cache architectures and investigate implications in software development.

Suggested readings:

What Every Programmer Should Know About Memory

Slides:
Will be made available after the lecture.


 
Lecture 04
Mon Sep 23

Topic: Caching (2)  Continuation of the topic of the previous lecture.

Suggested readings:

Game Programming Patterns - Data Locality

Slides:
Will be made available after the lecture.

 
Lecture 05
Wed Sep 25

Topic: SIMD (1)  With CPU clock speeds reaching practical limits, parallelism becomes the main source of further advances in hardware performance. In this lecture, Intel's approach to SIMD programming (SSE) is introduced.


Slides:
Will be made available after the lecture.


Lecture 06
Mon Sep 30

Topic: SIMD (2)  Building on the concepts of lecture 6, we investigate advanced SIMD topics such as gather / scatter and masking.

Suggested readings:

Looking for 4x speedups? SSE to the rescue! (warning: by Intel)
SIMD Tutorial

Slides:
Will be made available after the lecture.

 
Lecture 07
Wed Oct 2

Topic:  Data-Oriented Design  Where Object-Oriented Design focuses on ease of development and maintainability, Data-Oriented Design focuses on data layout that is optimal for performance. Targeting the computer rather than the developer has significant impact on software architecture, but also on performance.

Suggested readings:

Data-Oriented Design (Or Why You Might Be Shooting Yourself in the Foot With OOP)


Slides:
Will be made available after the lecture.


Lecture 08
Mon Oct 7 

Topic: GPGPU (1)  For certain problems, a streaming processor is a good (and powerful) alternative to the CPU. In this lecture, we briefly explore GPU architecture and the concept of GPGPU.

Slides:
Will be made available after the lecture.



 Lecture 09
Wed Oct 9

Topic: GPGPU (2)  Building on the previous lecture, we investigate the implementation of a Verlet fluid simulator on the GPU.

Slides:
Will be made available after the lecture.


 
Lecture 10
Mon Oct 14

Topic: GPGPU (3)  Transferring optimization concepts to the GPU: profiling, high-level, low-level, caches, other architecture considerations. GPGPU-specific algorithms for common problems.

Suggested readings:

A Survey of General-Purpose Computation on Graphics Hardware

Slides:
Will be made available after the lecture.



Lecture 11
Wed Oct 16

Topic: Fixed Point Math  Floating point calculations can often be done with integer arithmetic, and there are good reasons for doing so. In this lecture, the 'lost art' of fixed point arithmetic is introduced.

Suggested readings:

The Neglected Art of Fixed Point Arithmetic

Slides:
Will be made available after the lecture.

 
Lecture 12
  Mon Oct 21

Topic: Efficient Multithreading  Multi-core processing, NUMA architectures and hyperthreading, and the consequences for cache behavior. Worker threads as the basis for efficient parallel systems.

Slides:
Will be made available after the lecture.

 
Lecture 13
Wed Oct 23

Topic: Snippets  Various examples of optimizations that worked and didn't work.


Slides:
Will be made available after the lecture.


Lecture 14
Mon Oct 28

Guest lecture: TBD.




 
Lecture 15
Wed Oct 30

Topic: Process & Grand Recap Final lecture, recap of the structured optimization process, recap of various concepts, exam preparation.


Slides:
Will be made available after the lecture.


Course Schedule back to navigation

Period 1 Schedule (tentative)

Week Date Lecture / Exams Practicum Deadlines
Notes
36

No lecture
 


37
Mon Sep 9
09:00-10:45  
Lecture 1:
Introduction
  First practicum: profiling tutorial.
Document, project files.
Wed Sep 11
09:00-10:45
Lecture 2:
Low-level

P1 will be introduced.
38
Mon Sep 16
09:00-10:45
Lecture 3:
Caching (1)


Wed Sep 18
09:00-10:45
NO LECTURE


39
Mon Sep 23
09:00-10:45
Lecture 4:
Caching (2)
Tue Sep 24: Deadline Assignment 1
Click here for P1 details
Wed Sep 25, 23:59:
Extended Deadline (-1 pt)
Wed Sep 25
09:00-10:45
Lecture 5:
SIMD (1)

P2 will be introduced.
40
Mon Sep 30
09:00-10:45
Lecture 6:
SIMD (2)


Wed Oct 2
09:00-10:45
Lecture 7:
Data-Oriented Design
 

41
Mon Oct 7
09:00-10:45
Lecture 8:
GPGPU (1)


Wed Oct 9
09:00-10:45
Lecture 9:
GPGPU (2)
Thu Oct 10: Deadline Assignment 2
Click here for P2 details.
 Fri Oct 11, 23:59:
Extended Deadline (-1 pt)
42
Mon Oct 14
09:00-10:45
Lecture 10:
GPGPU (3)
   P3 will be introduced.
Wed Oct 16
09:00-10:45
Lecture 11:
Fixed Point Math
 
43
Mon Oct 21
09:00-10:45
Lecture 12:
Efficient Multithreading

 
Wed Oct 23
09:00-10:45
Lecture 13:
Guest lecture: StreamHPC
 
44
Mon Oct 28
09:00-10:45
Lecture 14:
Snippets

 
Wed Oct 30
09:00-10:45
Lecture 15:
Process & Grand Recap
Thu Oct 31, 23:59:
Deadline
Final Assignment
Fri Nov 1, 23:59:
Extended Deadline (-1 pt)

45


EXAM: Tue Nov 5


Assignments back to navigation


All assignments can be done alone or in teams of two students. For teams: it is not mandatory to do all four assignments with the same partner; switching is allowed.


Assignment P1 - LOW LEVEL

Assignment will be announced in the first week of the course.

Deadline: Tuesday September 24, 23:59. Extended deadline (1pt penalty): Wednesday September 25, 23:59.


Assignment P2 - CACHING

Assignment will be announced during the course.

Deadline: Thursday October 10, 23:59. Extended deadline (1pt penalty): Friday October 11, 23:59.


Assignment P3 - NOT A DRILL

In this final assignment, you will apply all techniques to speed up real-world software.
Assignment will be announced during the course.

Deadline: Thursday October 31, 23:59. Extended deadline (1pt penalty): Friday November 1, 23:59.

 

Exam & Grading back to navigation

GRADING

Programming assignments: Your practical grade P is based on two programming assignments P1, P2 (25% each) and one final assignment P3 (50%).

Exam: Your exam / theory grade T is based on a single final exam.

Final grade: Your final grade is (3P + T) / 4. You must score at least 4.0 (before rounding) for the exam to pass this course.

RETAKES AND REQUIREMENTS

Retake: To qualify for a retake, the final grade must be at least 4 (before rounding). You may repair your final grade by redoing one of the four assignments, or the exam. Exact terms will be discussed individually.

 

Literature & Links back to navigation

Overview of literature used during this course:


Previous editions

 

News Archive back to navigation

Old posts


Old posts will be archived here.