Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Queen’s Tower Imperial College London South Kensington, SW7 28th Jan 2007 | Ashley Brown Profiling floating point value ranges for reconfigurable implementation.

Similar presentations


Presentation on theme: "The Queen’s Tower Imperial College London South Kensington, SW7 28th Jan 2007 | Ashley Brown Profiling floating point value ranges for reconfigurable implementation."— Presentation transcript:

1 The Queen’s Tower Imperial College London South Kensington, SW7 28th Jan 2007 | Ashley Brown Profiling floating point value ranges for reconfigurable implementation Workshop on Reconfigurable Computing at 2007 Ashley Brown, 28 th Jan 2007

2 28th Jan 2007 | Ashley Brown# 2 Floating Point on FPGAs Two distinct sets of requirements Embedded systems (often as/alongside DSPs) –High precision often not important (video/audio processing) –Fixed point implementations possible Scientific computation –High precision extremely important –Reduction in precision or conversion to single prec. must be done with great care

3 28th Jan 2007 | Ashley Brown# 3 Our Focus Scientific applications –MORPHY: “automated topological analysis of a molecular electron density” –‘ydl_pij’ (MMVB): Iterative solver for computational chemistry SPECFP95 benchmarks –Only mildly interesting – do not have multiple datasets SPECFP2000 to follow

4 28th Jan 2007 | Ashley Brown# 4 The Problem D.P. floating point on FPGAs uses a lot of area Density is improving: but still want to squeeze more in! –Re-using hardware can reduce concurrency Scientific applications: typically 64-bit floating point Often full precision is (believed to be) required –Is this really the case? We have more options than single or double

5 28th Jan 2007 | Ashley Brown# 5 Current Solutions for F.P. minimisation Finding ‘minimal precision’: –Tools such as BitSize –Select precision for some operands, tool calculates the rest –Test vectors used to gauge errors Reducing hardware area: –Replacing floating point by fixed point, transparent to user (Cheung et al.) –Solution above would make the scientists cry. –Any butchery of the floating point hardware must be justified and checked

6 28th Jan 2007 | Ashley Brown# 6FloatWatch Valgrind-based value profiler Can return a number of metrics: –Floating point value ranges –Variation between 32-bit and 64-bit F.P. executions –Difference in magnitude between F.P. operations Each metric has uses for optimisation!

7 28th Jan 2007 | Ashley Brown# 7

8 28th Jan 2007 | Ashley Brown# 8

9 28th Jan 2007 | Ashley Brown# 9

10 28th Jan 2007 | Ashley Brown# 10

11 28th Jan 2007 | Ashley Brown# 11

12 28th Jan 2007 | Ashley Brown# 12

13 28th Jan 2007 | Ashley Brown# 13 What does this tell us? Alpha is constant (but could have found that from source) Memory operands all fall within the same range Result falls within the same range as memory operands Intermediate values result in a shift in the range Optimisation: we do not need double precision –A custom floating point format would suffice

14 28th Jan 2007 | Ashley Brown# 14FloatWatch Operates on x86 binaries under Valgrind –x86 machine code converted to simplified SSA –FloatWatch inserts instrumentation code after floating point operations –SSA converted back to x86 and cached Outputs a data file with selected metrics Processing script produces HTML+JavaScript report

15 28th Jan 2007 | Ashley Brown# 15Report Dynamic HTML interface –Copy HTML file from computing cluster to desktop, no installation required Select/deselect source lines, SSA “instructions” –Dynamic in-page graph –Table for exporting to GNU-plot, Excel etc. View value ranges at instruction, source line, function, file and application levels.

16 28th Jan 2007 | Ashley Brown# 16 Optimisation Opportunities Reduce floating point unit –Reduced precision –Restricted normalisation Use an alternative representation –Non-standard floating point (e.g. 48-bit) –Fixed point –Dual fixed-point Minimisation of redundancy –Remove denormal handling unless required –Remove or predict zero-value calculations

17 28th Jan 2007 | Ashley Brown# 17 Reduce Hardware Example using MORPHY F.P. values are interesting –Most confined to a narrow range –Different data sets to not vary the range Full range of double precision floating point not required Reduce Exponent

18 28th Jan 2007 | Ashley Brown# 18 Reduce Hardware – Alignment/Normalisation Most expensive step: shifting for add/subtract –Operand alignment –Normalisation Set limits on alignment to reduce hardware size –Trap to software to perform other alignments Provisional results: only shift-by-4 required for some applications

19 28th Jan 2007 | Ashley Brown# 19 Alternative Representations #1: Custom Floating Point No need to use 64- or 32-bit Use a compromise instead, maybe 48-bit is enough? 1mantissa(52)exp(11) 1mantissa(23)exp(8) 1mantissa(38)exp(9) IEEE Single Custom IEEE Double Maybe we can we drop the sign bit?

20 28th Jan 2007 | Ashley Brown# 20 Alternative Representations #2: Fixed Point For very narrow ranges, fixed point may be an option Must be treated with extreme care Dual fixed-point format provides another possibility –Two different formats: different fixed point positions –1 bit reserved to switch between formats

21 28th Jan 2007 | Ashley Brown# 21 “Pipeline Prediction” Similar concept to branch prediction Build a selection of pipelines with different performance characteristics –Slow but generic version –Fast version with limited range, reduced operand alignment –Compromise in between Predict which version is best to use (how?)

22 28th Jan 2007 | Ashley Brown# 22 True Reconfiguration – Temporal Profiling Value ranges can vary for different application phases Potential to reconfigure hardware as phases change Test applications have not shown this behaviour so far –Small kernels only –Full applications would be expected to show this behaviour

23 28th Jan 2007 | Ashley Brown# 23 Profiling Results – SPECFP95 ‘mgrid’ Operations producing zero Two ranges: similar shapes

24 28th Jan 2007 | Ashley Brown# 24 Range Close-up

25 28th Jan 2007 | Ashley Brown# 25 Profiling Results – SPECFP95 ‘swim’ Sawtooth caused by multiplication

26 28th Jan 2007 | Ashley Brown# 26 ‘swim’ Close-up

27 28th Jan 2007 | Ashley Brown# 27 Profiling Results – MMVB As with MORPHY, ranges similar between datasets

28 28th Jan 2007 | Ashley Brown# 28 Problems with this approach No guarantees that values do not occur outside identified ranges Not all applications will demonstrate behaviour similar to MORPHY –Value ranges could vary wildly with different datasets Valgrind is slow

29 28th Jan 2007 | Ashley Brown# 29 Future Work State-based profiling: –profile functions based on call-stack –allows context-dependent configurations Active simulation –Test new representations to check for rounding errors Use results in practice –FPGA implementations for real applications –Modelling of large-scale deployments

30 The Queen’s Tower Imperial College London South Kensington, SW7 28th Jan 2007 | Ashley Brown Any Questions? Jezebel 1916 Dennis ‘N’ Type Fire Engine Royal College of Science Motor Club Imperial College Union, SW7


Download ppt "The Queen’s Tower Imperial College London South Kensington, SW7 28th Jan 2007 | Ashley Brown Profiling floating point value ranges for reconfigurable implementation."

Similar presentations


Ads by Google