1 / 30

Precision Modeling and Bitwidth Optimization of Floating-Point Applications

Precision Modeling and Bitwidth Optimization of Floating-Point Applications. Zhihong Zhao Miriam Leeser Alternative System Concepts, Inc. Northeastern University Windham, NH, USA Boston, MA, USA. Outline. Variable Bitwidth Computing

yovela
Télécharger la présentation

Precision Modeling and Bitwidth Optimization of Floating-Point Applications

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Precision Modeling and Bitwidth Optimization of Floating-Point Applications Zhihong Zhao Miriam Leeser Alternative System Concepts, Inc. Northeastern University Windham, NH, USA Boston, MA, USA

  2. Outline • Variable Bitwidth Computing • Precision Modeling Methodology • Behavioral Profiling • Error Modeling • Verification • Bitwidth Optimization • Problem Formulation • Optimization Algorithms • Optimization Results • Future Work • Conclusion

  3. Variable Bitwith Computing • Why Variable Bitwidth Computing ? • Obtaining Optimized Bitwidths • Other’s approach : simulation-based bitwidth searching • Our approach: model-based bitwidth optimization • System flowchart of the model-based bitwidth optimization

  4. Why Variable Bitwith Computing ? • Standard FP representation (Single Precision): 32 bits • sign: 1 bit • exponent: 8 bits • mantissa: 23 bits • Implementation of standard FP operations in custom circuits is expensive • Mantissa bitwidth can be reduced without compromising precision requirements

  5. Relative Error VS Bitwidth

  6. Simulation-based Searching • Iterative simulation • No explicit arithmetic precision model generated or needed • Time consuming Initial B Simulation B <= B-1 Y good N B <= B+1 Optimal B

  7. Model-based Optimization • No iterative simulation • Application-specific arithmetic precision model generated • One bitwidth value for each operation node Data-path Profiling Modeling Optimization Optimal B

  8. System Flowchart Test Data Data Path Error Range Behavioral Profiling Bitwidth Optimization Profile Data Optimized Bitwidths Precision Model Precision Modeling

  9. Precision Modeling Methodology • Behavioral Profiling • Error Models of FP Operations • Rounding Error • Propagation Error • Constructing Precision Model

  10. Profile-Driven Modeling • Behavioral profiling gathers profile data through one-time simulation • bit probability • statistical values of variables in data-path • Profiling is performed on a graphical representation (usually CDFG) of the application • Profile data is used in precision modeling • Selecting stimuli is important

  11. Behavioral Profiling • Watcher insertion & simulation Watcher CDFG node Data Stimuli

  12. Error in Floating-Point Model • The overall error of a FP operation: • Overall error at the result of an operation : Propagation Error(PE) + Rounding Error(RE)

  13. Propagation Error (1) • Calculation of PE • K is the amplification factor, determined based on the operation’s type and data

  14. Propagation Error (2) Equation: MULT: ADD: SQRT:

  15. Rounding Error Mantissa: Precise value: FP value: Error:

  16. Constructing Precision Model • Establish error model for each node in data-path using the RE+PE model • Construct precision model for the application based-on data-path structure • The precision model is a function of output error of the application in terms of bit-widths in data-path and input error of the application • The precision model can be used to predict output error and optimize bitwidths

  17. Experimental Results • Experimental Procedure • Example Data-paths (CDFGs) • Comparison of Predicted Error Range and Actual Errors

  18. Experimental Procedure

  19. CDFG: PID Controller

  20. Result: PID Controller

  21. Bitwidth Optimization • Problem Formulation • Optimization Methods • Grid Steepest Descent (GDS) • Accelerated Grid Steepest Descent (GSD-A) • Optimization Results

  22. Problem Formulation • Precision model based on CDFG and profile data: N: number of nodes in CDFG • Objective function: bi: bit-width of node i • Constraints: P: accuracy requirements Z: range for bit-width selection

  23. Optimization Algorithms (1) • Regular Steepest Decent • In each step, direction is calculated, step length is determined by searching in the direction x: vector of bitwidthsk: search step • Grid Steepest Decent (GSD) • In each step, step length is fixed (λ=1), direction is determined by searching

  24. Optimization Algorithms (2) • Grid Steepest Decent (GSD) Initialize bitwidths Lower bound Only one of the bitwidths increases by 1 Search neighbors Adopt best direction λ = 1 y F<P? d = [0 0 … 0 1 0 … 0] end

  25. Optimization Algorithms (3) L=1,H=23 • Accelerated GSD (GSD-A) B=(L+H)/2 • “Smart” Initial Point F(B) <P? • Binary search to locate initial point H=B L=B • Total search time is reduced to a fraction H-L>1? • Initial Point: All bitwidths have the same initial value Initial=L • GSD: Each bitwidth is calculated individually GDS

  26. Optimization Results (1) Result Comparison (P = 5%)

  27. Optimization Result (2) • IEEE Format Data • Variable Bitwidth • Total Bitwidth253 • Total Bitwidth136 • Output Error0 • Output Error5% Error=0 Error=5% Optimize Bitwidths

  28. Future Work • Validate the optimized bitwidths • C++ floating-point library supporting variable bitwidth • VHDL Variable precision floating-point component library, developed by Rapid Prototyping Lab at Northeastern University, available under GPL at http://www.ece.neu.edu/groups/rpl/projects/floatingpoint/ • Improve error models • Propagation error models and rounding error models • Singularity issues • Integrate in high level synthesis flow • IEEE 1076.3 working group: variable bitwidth floating-point for synthesis

  29. Conclusion (1) • Variable bitwidth FP computing is viable • Model-based bitwidth optimization has advantages over simulation-based searching • A methodology of FP precision modeling has been developed • The precision model predicts output error and can be used for bit-width optimization

  30. Conclusion (2) • A customized optimization algorithm, Grid Steepest Descent (GSD), has been developed • Search acceleration techniques have been applied to GSD • Optimized bitwidths for a given precision target can be found quickly • Sum of the optimized bitwidths is significantly smaller than that of standard IEEE format

More Related