Numerical Program Optimization for High-Level Synthesis Xitong Gao, - - PowerPoint PPT Presentation

numerical program optimization for high level synthesis
SMART_READER_LITE
LIVE PREVIEW

Numerical Program Optimization for High-Level Synthesis Xitong Gao, - - PowerPoint PPT Presentation

Numerical Program Optimization for High-Level Synthesis Xitong Gao, George A. Constantinides xi.gao08@imperial.ac.uk, g.constantinides@imperial.ac.uk Imperial College London Introduction Floating-point operations... are easy to use High


slide-1
SLIDE 1

Numerical Program Optimization for High-Level Synthesis

Xitong Gao, George A. Constantinides

xi.gao08@imperial.ac.uk, g.constantinides@imperial.ac.uk

Imperial College London

slide-2
SLIDE 2

Introduction Floating-point operations...

  • are ubiquitous

Altera introduced new FPGAs (Arria 10 and Stratix 10) with hardened floating-point DSP elements

  • are easy to use

High dynamic range

slide-3
SLIDE 3

Introduction Floating-point operations...

  • are ubiquitous

Altera introduced new FPGAs (Arria 10 and Stratix 10) with hardened floating-point DSP elements

  • are easy to use

High dynamic range

  • use a lot of resources
  • have round-off errors

However, floating-point operations

slide-4
SLIDE 4

Introduction Our tool exploits the rules of equivalence to automatically

  • ptimize the structure of numerical

programs, for example:

  • (a + b) + c ≣ a + (b + c)
  • (a + b) * c ≣ a * b + a * c
  • and many more

LUTs Error

slide-5
SLIDE 5

Introduction

GCC / LLVM / Vivado HLS

  • ffast-math
  • What about accuracy?
  • Simple transformations
slide-6
SLIDE 6

Introduction

GCC / LLVM / Vivado HLS

  • ffast-math

SOAP

Arithmetic Expressions

  • What about accuracy?
  • Simple transformations
  • Deep transformations
  • Resource usage &

Accuracy!

slide-7
SLIDE 7

Introduction

GCC / LLVM / Vivado HLS

  • ffast-math

SOAP

Arithmetic Expressions

SOAP2

Full Programs

  • What about accuracy?
  • Simple transformations
  • Deep transformations
  • Full program

transformations

  • Resource usage &

Accuracy!

slide-8
SLIDE 8

Example

if (x < 20) { x = x + (y + 500); } else { x = (x + y) + 500; }

Program

slide-9
SLIDE 9

Example

if (x < 20) { x = x + (y + 500); } else { x = (x + y) + 500; }

Program

float x, y; assume(0 <= x <= 500); assume(err(x) == 0); assume(0 <= y <= 30); assume(err(y) == 0);

Specification

slide-10
SLIDE 10

Example

if (x < 20) { x = x + (y + 500); } else { x = (x + y) + 500; }

Program

float x, y; assume(0 <= x <= 500); assume(err(x) == 0); assume(0 <= y <= 30); assume(err(y) == 0);

Specification

slide-11
SLIDE 11

Example

if (x < 20) { x = x + (y + 500); } else { x = (x + y) + 500; }

Program

float x, y; assume(0 <= x <= 500); assume(err(x) == 0); assume(0 <= y <= 30); assume(err(y) == 0);

Specification

slide-12
SLIDE 12

Example

if (x < 20) { x = x + (y + 500); } else { x = (x + y) + 500; }

Program

float x, y; assume(0 <= x <= 500); assume(err(x) == 0); assume(0 <= y <= 30); assume(err(y) == 0);

Specification

slide-13
SLIDE 13

Example

if (x < 20) { x = x + (y + 500); } else { x = (x + y) + 500; }

Program

float x, y; assume(0 <= x <= 500); assume(err(x) == 0); assume(0 <= y <= 30); assume(err(y) == 0);

Specification

Transform

slide-14
SLIDE 14

Example

if (x < 20) { x = x + (y + 500); } else { x = (x + y) + 500; }

Program

float x, y; assume(0 <= x <= 500); assume(err(x) == 0); assume(0 <= y <= 30); assume(err(y) == 0);

Specification

Transform

LUTs Error

  • Pareto optimal
  • Pareto suboptimal
slide-15
SLIDE 15

Example

if (x < 20) { x = x + (y + 500); } else { x = (x + y) + 500; }

Program

float x, y; assume(0 <= x <= 500); assume(err(x) == 0); assume(0 <= y <= 30); assume(err(y) == 0);

Specification

LUTs Error

  • Pareto optimal
  • Pareto suboptimal
slide-16
SLIDE 16

Example

if (x < 20) { x = x + (y + 500); } else { x = (x + y) + 500; }

Program

float x, y; assume(0 <= x <= 500); assume(err(x) == 0); assume(0 <= y <= 30); assume(err(y) == 0);

Specification

LUTs Error

  • Pareto optimal
  • Pareto suboptimal

if (x < 20) { x = (x + y) + 500; } else { x = x + (y + 500); }

Most accurate

slide-17
SLIDE 17

Example

if (x < 20) { x = x + (y + 500); } else { x = (x + y) + 500; }

Program

float x, y; assume(0 <= x <= 500); assume(err(x) == 0); assume(0 <= y <= 30); assume(err(y) == 0);

Specification

LUTs Error

  • Pareto optimal
  • Pareto suboptimal

if (x < 20) { x = (x + y) + 500; } else { x = x + (y + 500); }

Most accurate

x = x + (y + 500);

Fewest resources but less accurate

slide-18
SLIDE 18

Example

if (x < 20) { x = x + (y + 500); } else { x = (x + y) + 500; }

Program

float x, y; assume(0 <= x <= 500); assume(err(x) == 0); assume(0 <= y <= 30); assume(err(y) == 0);

Specification

LUTs Error

  • Pareto optimal
  • Pareto suboptimal

if (x < 20) { x = (x + y) + 500; } else { x = x + (y + 500); }

Most accurate

x = (x + y) + 500; x = x + (y + 500);

Fewest resources but less accurate Fewest resources but more accurate

slide-19
SLIDE 19

And there is more...

  • how we do that

There are a lot of things we did not cover:

  • results
  • work flow

~60% better accuracy a more complex example program how it fits in the traditional HLS work flow

All of these above are in the poster!

slide-20
SLIDE 20

Thank you!

Join us in the poster session