Integrate Modified AC-SpGEMM / GALATIC#26
Integrate Modified AC-SpGEMM / GALATIC#26richardlett wants to merge 12 commits intogunrock:masterfrom
Conversation
There was a problem hiding this comment.
Nice work! I was able to successfully build and everything works. Tested that this does get the correct result for the testcase in Issue #20. I also tested compilation time compared to before this PR. Small increase from 5min to 6min, which isn't something to worry about.
Mainly have nitpicks (minor issues) below.
| @@ -1,6 +1,6 @@ | |||
| [submodule "ext/moderngpu"] | |||
| path = ext/moderngpu | |||
| url = https://ctcyang@github.com/ctcyang/moderngpu.git | |||
There was a problem hiding this comment.
nitpick: Do you mind changing both of these submodule URLs to a consistent format such as https://github.com/ctcyang/moderngpu.git and https://github.com/richardlett/GALATIC.git?
There was a problem hiding this comment.
changed them both to ssh as that will be more universal until repo is public (automatically uses your ssh-key)
| #define GRAPHBLAS_BACKEND_CUDA_SPGEMM_HPP_ | ||
|
|
||
|
|
||
| #include "../../../ext/GALATIC/include/dCSR.cuh" |
There was a problem hiding this comment.
I'm not a big fan of relative path includes that are dependent on a file being in the right folder. Could you add the galatic directory "GALATIC/include" to the CMakeLists.txt includes?
Something else that would be nice to have is a single file helper file in GALATIC that includes all helper files part of your public interface. Then we can just have a one-liner #include "galatic.cuh". This will let you iterate on GALATIC really quickly, for example add new include + source files or change naming of files in your repo, without breaking GALATIC's dependencies (e.g. graphblast).
Some examples for how to do that are "cub.cuh", ModernGPU's "moderngpu.cuh" and "graphblast.hpp".
There was a problem hiding this comment.
Thanks for pointing this out! You can tell I don't have the most experience with C++ :p
There was a problem hiding this comment.
I feel that way about myself too, but most important thing is to code lots and learn something new every day =P
| #ifndef GRAPHBLAS_BACKEND_CUDA_SPGEMM_HPP_ | ||
| #define GRAPHBLAS_BACKEND_CUDA_SPGEMM_HPP_ | ||
|
|
||
|
|
There was a problem hiding this comment.
nitpick: stylistic thing - I like having only single-spaced lines between lines with code, so could you get rid of all the newline spacing? 1-line gaps are fine, so don't worry about those.
| &B->sparse_, desc)); | ||
| else { | ||
| if (s_mode != GrB_GALATIC) { | ||
| std::cout << R"(Unknown mode (Options are: "cusspare2" and "galatic"; defaulting to galatic)" << std::endl; |
There was a problem hiding this comment.
nitpick: fix typo cusspare2 -> cusparse2
|
|
||
| #include "graphblas/backend/cuda/sparse_matrix.hpp" | ||
|
|
||
|
|
There was a problem hiding this comment.
nit: get rid of empty line
| #include <iostream> | ||
| #include <vector> | ||
|
|
||
|
|
There was a problem hiding this comment.
nit: get rid of empty lines
| matrixToGalatic(A, leftInputMatrixGPU); | ||
| matrixToGalatic(B, rightInputMatrixGPU); | ||
|
|
||
|
|
There was a problem hiding this comment.
nit: get rid of extra lines and the rest in this file.
ctcyang
left a comment
There was a problem hiding this comment.
Thanks for making the formatting changes! Added a few minor comments, but in general looks good to me!
| #set( CUDA_CUBLAS_LIBRARY "$ENV{CUDA_HOME}/lib64/libcublas.so" ) | ||
| set( CUDA_CUSPARSE_LIBRARY "$ENV{CUDA_HOME}/lib64/libcusparse.so" ) | ||
| #FILE( GLOB_RECURSE PROJ_SOURCES graphblas/*.cu ../graphblas/*.cpp ) | ||
| #FILE( G LOB_RECURSE PROJ_SOURCES graphblas/*.cu ../graphblas/*.cpp ) |
| else { | ||
| if (s_mode != GrB_GALATIC) { | ||
| std::cout << R"(Unknown mode (Options are: "cusspare2" and "galatic"; defaulting to galatic)" << std::endl; | ||
| std::cout << R"(Unknown mode (Options are: "cuspare2" and "galatic"; defaulting to galatic)" << std::endl; |
| [submodule "ext/moderngpu"] | ||
| path = ext/moderngpu | ||
| url = https://ctcyang@github.com/ctcyang/moderngpu.git | ||
| url = git@github.com:ctcyang/moderngpu.git |
There was a problem hiding this comment.
nit: Kind of a personal preference thing, but could you change these to use HTTPS verification rather than SSH? I usually don't have ssh-key installed, so I typically use HTTPS.
I've tried with HTTPS and for people with access to GALATIC private repo, then so long as that they enter my Github login + pw, it lets them pull in the submodule.
| #include "../../../ext/GALATIC/include/dCSR.cuh" | ||
| #include "../../../ext/GALATIC/include/SemiRingInterface.h" | ||
| #include "../../../ext/GALATIC/source/device/Multiply.cuh" | ||
| #include <GALATIC/GALATICMinimumIncludes.cuh> |
There was a problem hiding this comment.
Do you mind changing this to #include "GALATICMinimumIncludes.cuh"? According to the Google C++ style guide, typically nonsystem headers use the quotation marks instead of angled brackets.
That way, the PROJ_INCLUDES can be set( PROJ_INCLUDES "./" "ext/moderngpu/include" "ext/GALATIC"), so it's easier for someone trying to install graphblast to debug for example when PROJ_INCLUDES can't find the GALATIC folder.
There was a problem hiding this comment.
Whoops, bad inference made me think that was for files that were resolved based on relative path to current file -I!
|
Sorry for delay, that should do it! |
ctcyang
left a comment
There was a problem hiding this comment.
LGTM aside from a few nitpicks. I'm happy to merge this when GALATIC becomes public, so give me a heads up when!
| # needed for cudamalloc | ||
| set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") | ||
| set(CMAKE_CXX_FLAGS "-fpermissive -g -m64 -std=c++11" ) | ||
| set(CMAKE_CXX_FLAGS "-fpermissive -g -std=c++14" ) |
There was a problem hiding this comment.
nit: one space instead of two between -g and -std=c++14
|
|
||
| # Includes | ||
| INC += -I$(MGPU_DIR) -I$(CUB_DIR) -I$(BOOST_DIR) -I$(GRB_DIR) | ||
| INC += -I$(MGPU_DIR) -I$(BOOST_DIR) -I$(GRB_DIR) |
There was a problem hiding this comment.
nit: one space instead of two between MGPU_DIR and BOOST_DIR
| C->csc_initialized_ = false; | ||
| return GrB_SUCCESS; | ||
| } | ||
| // Shallow copy graphblast sparsematrix -> Galatic dCSR format |
There was a problem hiding this comment.
nit: please add a newline between following template function and above function.
|
@ctcyang Will be great if examples will be also updated |
GALATIC repo isn't public yet, draft PR. Don't accept
Notes:
--expt-relaxed-constexprnow required. We can remove this with a hack, if need be.512 thread AC-SpGEMM/GALATIC version differs in most parameters due to large shared memory because # of threads, otherwise stuck with defaults. May have issues with merging -- needs testing.