The MATLAB code in this repository compares different strategies to estimate the required fixed-point bit width to emulate floating-point matrix multiplication. These codes accompany a manuscript that will soon be released.
This repository contains a submodule, which will not be cloned automatically with git clone. You can clone the repository with its submodule via SSH with:
git clone -- recursive git@github.com:north-numerical-computing/fixed-point-emulation-bitwidth.gitor via HTTPS with:
git clone -- recursive https://github.com/north-numerical-computing/fixed-point-emulation-bitwidth.gitIf you have already cloned the repository, you can clone the submodule with:
git submodule update --init --recursiveRunning the code requires a recent version of MATLAB.
The accuracy experiments emulate floating-point matrix multiplication using the gemmi package, which is available as a submodule.
The MEX interface can be compiled using CMake with:
cmake -S deps/gemmi/ -Bdeps/gemmi/build
cmake --build deps/gemmi/build/The binary file this command produces must be on the MATLAB path for the accuracy experiments to work. The startup.m file, which runs automatically when MATLAB is started in this repository, will set the path correctly for gemmi to be used. By default, accuracy testing is disabled. It can be enabled by setting the variable compute_products to true.
To run all tests, use the run_tests.m MATLAB script. The figure numbers refer to the accompanying manuscript.
Each script whose name start with test_ runs a separate test. It will produce a series of heatmaps and save the data produced to a .dat file in the dat/ directory.