Outer product Sparse Matrix Matrix Multiplication
This project contains submodule, so use recursive option to download them all.
git clone --recursive [email protected]:gzxultra/OuterSpGEMM.git
make clean && make spgemm
Please make sure you have compiled the code before generating matrices.
For ER matrices, type the next command and we will generate four ER matrices for test, with fix scale(23) and edge factor {1, 2, 4, 8}, modifyscripts/gen-er.sh
if you want other parameters.
make gen-er
For R-MAT matrices, type the next command and we will generate four R-MAT matrices for test, with fix scale(10) and edge factor {1, 2, 4, 8}, modifyscripts/gen-rmat.sh
if you want other parameters.
make gen-rmat
All the test cases we will have a left matrix and a right matrix in the folder assets/
, follow the naming pattern left_{matrix_type}_{scale}_{edge}.mtx
.
Here is the general Instruction.
./bin/OuterSpGEMM text {left_matrix} {right_matrix} {output_file} {nthreads} {nblockers} {block_width}
Some example that might help.
# run OuterGpGEMM on pre-generated ER(23, 4) matrix, 48 threads, 256 blockers and width of each blocker is 128
./bin/OuterSpGEMM_hw text assets/left_er23_4.mtx assets/right_er23_4.mtx ~/product.txt 48 256 128
# run OuterGpGEMM on run time ER(18, 18) matrix, 48 threads, 256 blockers and width of each blocker is 128
./bin/OuterSpGEMM_hw gen er 18 18 48 256 128
# profile data of OuterGpGEMM on run downloaded web-Google matrix, 48 threads, 256 blockers and width of each blocker is 128
./bin/ProfileOuterSpGEMM_hw text assets/web-Google.mtx assets/web-Google.mtx ~/product.txt 48 128 128
Delete them all.
make clean