This repository provides a MATLAB interface for GEMMul8 v1.1.0, enabling its use on MATLAB running on Windows.
Note
Legacy cuBLAS INT8 GEMM implementations may not be supported on newer-generation GPUs.
Installation of the latest CUDA Toolkit is therefore recommended.
-
To get the source code, execute:
git clone https://github.com/UCHINO-Yuki/GEMMul8_MATLAB
-
To build the static library of GEMMul8, execute:
cd GEMMul8_MATLAB make -j8 -
In the MATLAB Command Window, execute:
oz2_compile
-
Open
Gemmul8_MATLAB/build.batwith a text editor such as Notepad
(do not double-click, as this will execute the script).Modify the following lines according to your environment:
set CUDA_PATH="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.1" set GPU_ARCH=89
Target GPU architecture (
GPU_ARCH) can be found from CUDA GPU Compute Capability. -
Open the standard Windows Command Prompt.
-
In the Command Prompt, run the following command (replace
2022with the installed Visual Studio version if necessary):"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" -
Change the directory to the
Gemmul8_MATLABfolder.cd PATH_TO_Gemmul8_MATLAB -
To build the static library of GEMMul8, execute:
build.bat
-
In the MATLAB Command Window, execute:
oz2_compile
-
In the MATLAB Command Window, execute:
oz2_test
This will run basic functionality tests to verify correct integration of GEMMul8 with MATLAB.
The generated MATLAB function introduce non-negligible runtime overhead, including dynamic allocation and deallocation of working memory, as well as additional costs inherent to MATLAB execution and the MEX interface. Consequently, their performance is inferior to that of the native GEMMul8 library. For performance-critical workloads, direct utilization of the original GEMMul8 implementation is strongly recommended.