-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate Modified AC-SpGEMM / GALATIC #26
base: master
Are you sure you want to change the base?
Changes from 1 commit
b9bd4bc
179666b
5080cc3
4cb56c7
ca71c72
b9e075c
2c7bdb9
99c74ba
04138ae
50fa929
ce4a855
dac2a22
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[submodule "ext/moderngpu"] | ||
path = ext/moderngpu | ||
url = https://ctcyang@github.com/ctcyang/moderngpu.git | ||
url = git@github.com:ctcyang/moderngpu.git | ||
[submodule "ext/GALATIC"] | ||
path = ext/GALATIC | ||
url = [email protected]:richardlett/GALATIC.git |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,13 +13,13 @@ set( PROJ_PATH ${CMAKE_SOURCE_DIR}) | |
set( PROJ_OUT_PATH ${CMAKE_BINARY_DIR}) | ||
set( PROJ_HEADERS "" ) | ||
set( PROJ_LIBRARIES "" ) | ||
set( PROJ_INCLUDES "./" "ext/moderngpu/include") | ||
set( PROJ_INCLUDES "./" "ext/moderngpu/include" "ext") | ||
set( mgpu_SRC_FILES "ext/moderngpu/src/mgpucontext.cu" "ext/moderngpu/src/mgpuutil.cpp") | ||
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../bin ) | ||
#set( CUDA_CURAND_LIBRARY "$ENV{CUDA_HOME}/lib64/libcurand.so" ) | ||
#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 ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: extra tab here |
||
#FILE( GLOB_RECURSE PROJ_LIBRARIES ext/cublas1.1/*.cu ) | ||
FILE( GLOB_RECURSE PROJ_HEADERS graphblas/*.hpp) | ||
# nvcc flags | ||
|
+4 −0 | GALATICMinimumIncludes.cuh | |
+2 −1 | include/COO.cuh | |
+12 −11 | include/CSR.h | |
+2 −2 | source/device/Multiply.cuh |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,7 @@ Info mxm(Matrix<c>* C, | |
&B->sparse_, desc)); | ||
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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: cusparse2 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤦 wow |
||
} | ||
CHECK(GALATIC_spgemm(&C->sparse_, | ||
op, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,16 @@ | ||
#ifndef GRAPHBLAS_BACKEND_CUDA_SPGEMM_HPP_ | ||
#define GRAPHBLAS_BACKEND_CUDA_SPGEMM_HPP_ | ||
|
||
|
||
#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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mind changing this to That way, the PROJ_INCLUDES can be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whoops, bad inference made me think that was for files that were resolved based on relative path to current file |
||
|
||
#include "graphblas/backend/cuda/sparse_matrix.hpp" | ||
|
||
|
||
#include <cuda.h> | ||
#include <cusparse.h> | ||
|
||
#include <iostream> | ||
#include <vector> | ||
|
||
|
||
|
||
|
||
|
||
namespace graphblas { | ||
namespace backend { | ||
template <typename T> | ||
|
@@ -218,11 +210,8 @@ Info GALATIC_spgemm(SparseMatrix<c>* C, | |
matrixToGalatic(A, leftInputMatrixGPU); | ||
matrixToGalatic(B, rightInputMatrixGPU); | ||
|
||
|
||
|
||
GPUMatrixMatrixMultiplyTraits DefaultTraits; | ||
|
||
|
||
// GALATIC has its own semiring interface; | ||
// GalaticSemiring is a shim here for conversion of graphblast-style | ||
// SemiringT type. GalaticSemiring definition is above this function | ||
|
@@ -231,8 +220,6 @@ Info GALATIC_spgemm(SparseMatrix<c>* C, | |
|
||
ExecutionStats stats; | ||
try { | ||
|
||
|
||
Desc_value nt_mode; | ||
CHECK(desc->get(GrB_NT, &nt_mode)); | ||
const int num_threads = static_cast<int>(nt_mode); | ||
|
@@ -288,22 +275,18 @@ Info GALATIC_spgemm(SparseMatrix<c>* C, | |
nullizeGalaticMatrix(leftInputMatrixGPU); | ||
nullizeGalaticMatrix(rightInputMatrixGPU); | ||
|
||
|
||
if (C->h_csrRowPtr_ == NULL) | ||
C->h_csrRowPtr_ = reinterpret_cast<Index*>(malloc((A_nrows+1)* | ||
sizeof(Index))); | ||
C->h_csrColInd_ = reinterpret_cast<Index*>(malloc(C->ncapacity_*sizeof(Index))); | ||
C->h_csrVal_ = reinterpret_cast<c*>(malloc(C->ncapacity_*sizeof(c))); | ||
|
||
|
||
C->need_update_ = true; // Set flag that we need to copy data from GPU | ||
C->csr_initialized_ = true; | ||
C->csc_initialized_ = false; | ||
return GrB_SUCCESS; | ||
} | ||
|
||
|
||
|
||
template <typename c, typename a, typename b, typename m, | ||
typename BinaryOpT, typename SemiringT> | ||
Info cusparse_spgemm(SparseMatrix<c>* C, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.