Skip to content

Commit

Permalink
Merge branch 'develop' into fix/2433
Browse files Browse the repository at this point in the history
  • Loading branch information
cwpearson authored Dec 2, 2024
2 parents 735c72a + 78f4efd commit 5933e67
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 138 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/at2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ jobs:
uses: ./.github/workflows/spr.yml
with:
kokkos_version: 4.5.00
volta70:
uses: ./.github/workflows/volta70.yml
with:
kokkos_version: 4.5.00
# All these ran on sogpu01, which has been repurposed
# volta70:
# uses: ./.github/workflows/volta70.yml
# with:
# kokkos_version: 4.5.00
149 changes: 75 additions & 74 deletions .github/workflows/bdw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,86 +261,87 @@ jobs:
working-directory: kokkos-kernels/build
run: ctest --output-on-failure -V --timeout 3600

PR_BDW_CLANG1001_THREADS_SERIAL_LEFT_REL:
name: PR_BDW_CLANG1001_THREADS_SERIAL_LEFT_REL
runs-on: [kk-env-llvm-10.0.1-latest]
# this job ran on sogpu01 which is now used for another purpose
# PR_BDW_CLANG1001_THREADS_SERIAL_LEFT_REL:
# name: PR_BDW_CLANG1001_THREADS_SERIAL_LEFT_REL
# runs-on: [kk-env-llvm-10.0.1-latest]

steps:
- name: checkout_kokkos_kernels
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: kokkos-kernels
# steps:
# - name: checkout_kokkos_kernels
# uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# with:
# path: kokkos-kernels

- name: checkout_kokkos
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: kokkos/kokkos
ref: ${{ inputs.kokkos_version }}
path: kokkos
# - name: checkout_kokkos
# uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# with:
# repository: kokkos/kokkos
# ref: ${{ inputs.kokkos_version }}
# path: kokkos

- name: configure_kokkos
run: |
mkdir -p kokkos/{build,install}
cd kokkos/build
cmake \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_CXX_FLAGS="-O3 -Wall -Wunused-parameter -Wshadow -pedantic -Werror -Wsign-compare -Wtype-limits -Wuninitialized" \
-DCMAKE_EXE_LINKER_FLAGS= \
-DCMAKE_INSTALL_PREFIX=$PWD/../install \
-DKokkos_ENABLE_SERIAL=ON \
-DKokkos_ENABLE_THREADS=ON \
-DKokkos_ARCH_BDW=ON \
-DKokkos_ENABLE_TESTS=OFF \
-DKokkos_ENABLE_EXAMPLES=OFF \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DCMAKE_CXX_STANDARD=17 \
-DBUILD_SHARED_LIBS=OFF \
-DKokkos_ENABLE_DEPRECATION_WARNINGS=OFF \
-DKokkos_ENABLE_DEPRECATED_CODE_4=OFF \
-DKokkos_ENABLE_DEPRECATION_WARNINGS=OFF \
..
# - name: configure_kokkos
# run: |
# mkdir -p kokkos/{build,install}
# cd kokkos/build
# cmake \
# -DCMAKE_CXX_COMPILER=clang++ \
# -DCMAKE_CXX_FLAGS="-O3 -Wall -Wunused-parameter -Wshadow -pedantic -Werror -Wsign-compare -Wtype-limits -Wuninitialized" \
# -DCMAKE_EXE_LINKER_FLAGS= \
# -DCMAKE_INSTALL_PREFIX=$PWD/../install \
# -DKokkos_ENABLE_SERIAL=ON \
# -DKokkos_ENABLE_THREADS=ON \
# -DKokkos_ARCH_BDW=ON \
# -DKokkos_ENABLE_TESTS=OFF \
# -DKokkos_ENABLE_EXAMPLES=OFF \
# -DCMAKE_VERBOSE_MAKEFILE=ON \
# -DCMAKE_CXX_EXTENSIONS=OFF \
# -DCMAKE_CXX_STANDARD=17 \
# -DBUILD_SHARED_LIBS=OFF \
# -DKokkos_ENABLE_DEPRECATION_WARNINGS=OFF \
# -DKokkos_ENABLE_DEPRECATED_CODE_4=OFF \
# -DKokkos_ENABLE_DEPRECATION_WARNINGS=OFF \
# ..

- name: build_and_install_kokkos
working-directory: kokkos/build
run: make -j8 install
# - name: build_and_install_kokkos
# working-directory: kokkos/build
# run: make -j8 install

- name: configure_kokkos_kernels
run: |
mkdir -p kokkos-kernels/{build,install}
cd kokkos-kernels/build
cmake \
-DCMAKE_CXX_COMPILER=clang++ \
-DKokkos_DIR=$PWD/../../kokkos/install/lib64/cmake/Kokkos \
-DCMAKE_CXX_FLAGS="-O3 -Wall -Wunused-parameter -Wshadow -pedantic -Werror -Wsign-compare -Wtype-limits -Wuninitialized" \
-DCMAKE_INSTALL_PREFIX= \
-DKokkosKernels_ENABLE_TESTS_AND_PERFSUITE=OFF \
-DKokkosKernels_ENABLE_TESTS=ON \
-DKokkosKernels_ENABLE_PERFTESTS=ON \
-DKokkosKernels_ENABLE_EXAMPLES:BOOL=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF \
-DKokkosKernels_INST_COMPLEX_DOUBLE=ON \
-DKokkosKernels_INST_DOUBLE=ON \
-DKokkosKernels_INST_ORDINAL_INT=ON \
-DKokkosKernels_INST_OFFSET_SIZE_T=ON \
-DKokkosKernels_INST_OFFSET_INT=ON \
-DKokkosKernels_INST_LAYOUTLEFT=ON \
-DKokkosKernels_ENABLE_TPL_ROCSPARSE=OFF \
-DKokkosKernels_ENABLE_TPL_ROCBLAS=OFF \
-DKokkosKernels_ENABLE_TPL_CUSOLVER=OFF \
-DKokkosKernels_ENABLE_TPL_CUSPARSE=OFF \
-DKokkosKernels_ENABLE_TPL_CUBLAS=OFF \
-DCMAKE_EXE_LINKER_FLAGS="" \
-DBUILD_SHARED_LIBS=OFF \
-DKokkosKernels_ENABLE_DOCS=OFF \
..
# - name: configure_kokkos_kernels
# run: |
# mkdir -p kokkos-kernels/{build,install}
# cd kokkos-kernels/build
# cmake \
# -DCMAKE_CXX_COMPILER=clang++ \
# -DKokkos_DIR=$PWD/../../kokkos/install/lib64/cmake/Kokkos \
# -DCMAKE_CXX_FLAGS="-O3 -Wall -Wunused-parameter -Wshadow -pedantic -Werror -Wsign-compare -Wtype-limits -Wuninitialized" \
# -DCMAKE_INSTALL_PREFIX= \
# -DKokkosKernels_ENABLE_TESTS_AND_PERFSUITE=OFF \
# -DKokkosKernels_ENABLE_TESTS=ON \
# -DKokkosKernels_ENABLE_PERFTESTS=ON \
# -DKokkosKernels_ENABLE_EXAMPLES:BOOL=ON \
# -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF \
# -DKokkosKernels_INST_COMPLEX_DOUBLE=ON \
# -DKokkosKernels_INST_DOUBLE=ON \
# -DKokkosKernels_INST_ORDINAL_INT=ON \
# -DKokkosKernels_INST_OFFSET_SIZE_T=ON \
# -DKokkosKernels_INST_OFFSET_INT=ON \
# -DKokkosKernels_INST_LAYOUTLEFT=ON \
# -DKokkosKernels_ENABLE_TPL_ROCSPARSE=OFF \
# -DKokkosKernels_ENABLE_TPL_ROCBLAS=OFF \
# -DKokkosKernels_ENABLE_TPL_CUSOLVER=OFF \
# -DKokkosKernels_ENABLE_TPL_CUSPARSE=OFF \
# -DKokkosKernels_ENABLE_TPL_CUBLAS=OFF \
# -DCMAKE_EXE_LINKER_FLAGS="" \
# -DBUILD_SHARED_LIBS=OFF \
# -DKokkosKernels_ENABLE_DOCS=OFF \
# ..

- name: build_kokkos_kernels
working-directory: kokkos-kernels/build
run: make -j8 all
# - name: build_kokkos_kernels
# working-directory: kokkos-kernels/build
# run: make -j8 all

- name: test
working-directory: kokkos-kernels/build
run: ctest --output-on-failure -V --timeout 3600
# - name: test
# working-directory: kokkos-kernels/build
# run: ctest --output-on-failure -V --timeout 3600


5 changes: 4 additions & 1 deletion sparse/impl/KokkosSparse_sptrsv_solve_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2083,7 +2083,6 @@ struct SptrsvWrap {
const std::vector<RowMapType> &row_map_v, const std::vector<EntriesType> &entries_v,
const std::vector<ValuesType> &values_v, const std::vector<RHSType> &rhs_v,
std::vector<LHSType> &lhs_v) {
// NOTE: Only support SEQLVLSCHD_RP and SEQLVLSCHD_TP1 at this moment
using nodes_per_level_type = typename TriSolveHandle::hostspace_nnz_lno_view_t;
using nodes_grouped_by_level_type = typename TriSolveHandle::nnz_lno_view_t;
using RPFunctor = FunctorTypeMacro(TriLvlSchedRPSolverFunctor, IsLower, BlockEnabled);
Expand Down Expand Up @@ -2131,6 +2130,10 @@ struct SptrsvWrap {
const int scratch_size = TPFunctor::SBlock::shmem_size(block_size, block_size);
tp = tp.set_scratch_size(0, Kokkos::PerTeam(scratch_size));
Kokkos::parallel_for("parfor_l_team", tp, tstf);
} else {
// NOTE: Only support SEQLVLSCHD_RP and SEQLVLSCHD_TP1 at this moment
auto alg_name = thandle_v[i]->return_algorithm_string();
KK_REQUIRE_MSG(false, "Algorithm " << alg_name << " does not support streams");
}
node_count_v[i] += lvl_nodes;
} // end if (lvl_nodes != 0)
Expand Down
69 changes: 13 additions & 56 deletions sparse/src/KokkosSparse_sptrsv_handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -959,69 +959,26 @@ class SPTRSVHandle {
int get_num_chain_entries() const { return this->num_chain_entries; }
void set_num_chain_entries(const int nce) { this->num_chain_entries = nce; }

void print_algorithm() {
if (algm == SPTRSVAlgorithm::SEQLVLSCHD_RP) std::cout << "SEQLVLSCHD_RP" << std::endl;
;

if (algm == SPTRSVAlgorithm::SEQLVLSCHD_TP1) std::cout << "SEQLVLSCHD_TP1" << std::endl;
;
/*
if ( algm == SPTRSVAlgorithm::SEQLVLSCHED_TP2 ) {
std::cout << "SEQLVLSCHED_TP2" << std::endl;;
std::cout << "WARNING: With CUDA this is currently only reliable with
int-int ordinal-offset pair" << std::endl;
}
*/
if (algm == SPTRSVAlgorithm::SEQLVLSCHD_TP1CHAIN) std::cout << "SEQLVLSCHD_TP1CHAIN" << std::endl;
;

if (algm == SPTRSVAlgorithm::SPTRSV_CUSPARSE) std::cout << "SPTRSV_CUSPARSE" << std::endl;
;

if (algm == SPTRSVAlgorithm::SUPERNODAL_NAIVE) std::cout << "SUPERNODAL_NAIVE" << std::endl;

if (algm == SPTRSVAlgorithm::SUPERNODAL_ETREE) std::cout << "SUPERNODAL_ETREE" << std::endl;

if (algm == SPTRSVAlgorithm::SUPERNODAL_DAG) std::cout << "SUPERNODAL_DAG" << std::endl;

if (algm == SPTRSVAlgorithm::SUPERNODAL_SPMV) std::cout << "SUPERNODAL_SPMV" << std::endl;

if (algm == SPTRSVAlgorithm::SUPERNODAL_SPMV_DAG) std::cout << "SUPERNODAL_SPMV_DAG" << std::endl;
}
inline void print_algorithm() { std::cout << return_algorithm_string() << std::endl; }

std::string return_algorithm_string() {
std::string ret_string;

if (algm == SPTRSVAlgorithm::SEQLVLSCHD_RP) ret_string = "SEQLVLSCHD_RP";

if (algm == SPTRSVAlgorithm::SEQLVLSCHD_TP1) ret_string = "SEQLVLSCHD_TP1";
/*
if ( algm == SPTRSVAlgorithm::SEQLVLSCHED_TP2 )
ret_string = "SEQLVLSCHED_TP2";
*/
if (algm == SPTRSVAlgorithm::SEQLVLSCHD_TP1CHAIN) ret_string = "SEQLVLSCHD_TP1CHAIN";

if (algm == SPTRSVAlgorithm::SPTRSV_CUSPARSE) ret_string = "SPTRSV_CUSPARSE";
switch (algm) {
case SPTRSVAlgorithm::SEQLVLSCHD_RP: ret_string = "SEQLVLSCHD_RP"; break;
case SPTRSVAlgorithm::SEQLVLSCHD_TP1: ret_string = "SEQLVLSCHD_TP1"; break;
case SPTRSVAlgorithm::SEQLVLSCHD_TP1CHAIN: ret_string = "SEQLVLSCHD_TP1CHAIN"; break;
case SPTRSVAlgorithm::SPTRSV_CUSPARSE: ret_string = "SPTRSV_CUSPARSE"; break;
case SPTRSVAlgorithm::SUPERNODAL_NAIVE: ret_string = "SUPERNODAL_NAIVE"; break;
case SPTRSVAlgorithm::SUPERNODAL_ETREE: ret_string = "SUPERNODAL_ETREE"; break;
case SPTRSVAlgorithm::SUPERNODAL_DAG: ret_string = "SUPERNODAL_DAG"; break;
case SPTRSVAlgorithm::SUPERNODAL_SPMV: ret_string = "SUPERNODAL_SPMV"; break;
case SPTRSVAlgorithm::SUPERNODAL_SPMV_DAG: ret_string = "SUPERNODAL_SPMV_DAG"; break;
default: KK_REQUIRE_MSG(false, "Unhandled sptrsv algorithm: " << static_cast<int>(algm));
}

return ret_string;
}

inline SPTRSVAlgorithm StringToSPTRSVAlgorithm(std::string &name) {
if (name == "SPTRSV_DEFAULT")
return SPTRSVAlgorithm::SEQLVLSCHD_RP;
else if (name == "SPTRSV_RANGEPOLICY")
return SPTRSVAlgorithm::SEQLVLSCHD_RP;
else if (name == "SPTRSV_TEAMPOLICY1")
return SPTRSVAlgorithm::SEQLVLSCHD_TP1;
/*else if(name=="SPTRSV_TEAMPOLICY2") return
* SPTRSVAlgorithm::SEQLVLSCHED_TP2;*/
else if (name == "SPTRSV_TEAMPOLICY1CHAIN")
return SPTRSVAlgorithm::SEQLVLSCHD_TP1CHAIN;
else if (name == "SPTRSV_CUSPARSE")
return SPTRSVAlgorithm::SPTRSV_CUSPARSE;
else
throw std::runtime_error("Invalid SPTRSVAlgorithm name");
}
};

} // namespace Experimental
Expand Down
3 changes: 0 additions & 3 deletions sparse/unit_test/Test_Sparse_sptrsv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,9 +620,6 @@ template <typename scalar_t, typename lno_t, typename size_type, typename device
void test_sptrsv_streams() {
using TestStruct = Test::SptrsvTest<scalar_t, lno_t, size_type, device>;
std::vector<SPTRSVAlgorithm> algs = {SPTRSVAlgorithm::SEQLVLSCHD_RP, SPTRSVAlgorithm::SEQLVLSCHD_TP1};
if (TestStruct::do_cusparse()) {
algs.push_back(SPTRSVAlgorithm::SPTRSV_CUSPARSE);
}

for (auto alg : algs) {
for (int nstreams = 1; nstreams <= 4; ++nstreams) {
Expand Down

0 comments on commit 5933e67

Please sign in to comment.