Evaluating Mixed-Precision Tuning on a Per-Function Basis
Mixed-precision tuning is the process of tuning the precision of variables in programs to enhance performance. This is done while adhering to some kind of error threshold, to maintain accuracy. Most tools currently, typically work on the granularity of variables, meaning that for each program, every variable is considered for a change in precision. These tools do this automatically by utilizing search techniques to optimize the search, since a brute-force approach is not viable. Even then, these tools take a long time to tune programs due to the amount of configurations. This thesis introduces mixed-precision tuning at a per-function granularity, to analyze how effective it is compared to per-variable granularity tuning. This is important since a program typically has significantly fewer functions than variables, thus naturally reduce the search space. To implement this, an LLVM pass was developed that downcasts specified functions, including all variables and operations inside of the function, except for arrays. Automating this process involved writing a Python script that supplied configurations to the LLVM pass. We found that the amount of time it takes to finish a full tuning pipeline is around 65-78 times faster, when running each configuration 5 times. However, the performance gain varied significantly, ranging from a maximum of 22.7% improvement to a 35.08% slowdown. These findings suggest that mixed-precision tuning at a per-function granularity shows promise, but future work is needed — particularly in handling arrays — since these introduce a lot of casting overhead that can negate performance gains.
Publication Details
- Journal
- KTH Publication Database DiVA (KTH Royal Institute of Technology)
- Published
- 2025-01-01
- Primary Topic
- IoT and Edge/Fog Computing
- Type
- article
- Field-Weighted Citation Impact
- 0.00