Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into jgfouca/block_sp…
Browse files Browse the repository at this point in the history
…trsv2

* upstream/develop:
  Make sure clang is using a newer GCC on weaver (kokkos#2289)
  cmake: add CMake language support for CUDA/HIP (kokkos#2173)
  Sparse - coo2csr: deactivating test on PVC (kokkos#2290)
  Bump ossf/scorecard-action from 2.3.3 to 2.4.0 (kokkos#2287)
  Bump github/codeql-action from 3.25.13 to 3.25.15 (kokkos#2288)
  Add big reformat commits to ignore revs for blame (kokkos#2286)
  Bump step-security/harden-runner from 2.8.1 to 2.9.0 (kokkos#2283)
  Bump github/codeql-action from 3.25.12 to 3.25.13 (kokkos#2284)
  .github/workflows: Auto trigger AT2 ci upon review (kokkos#2243)
  A couple platforms do not correctly handle static complexes
  • Loading branch information
jgfouca committed Aug 3, 2024
2 parents 270a72a + f437879 commit 6c9bc4c
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 30 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@
# git blame --ignore-revs-file=.git-blame-ignore-revs $file
#
# List skips here:
985c3a9e7343c2f612560024cae4d968f800c8ac
0ffb820881335beb0e78463c19988a0c61044705
3 changes: 3 additions & 0 deletions .github/workflows/bdw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
- '**/*.py'
- 'docs/**'
types: [ opened, reopened, synchronize ]
pull_request_review:
types:
- submitted

permissions:
contents: none
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit

Expand All @@ -44,7 +44,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@4fa2a7953630fd2f3fb380f21be14ede0169dd4f # v3.25.12
uses: github/codeql-action/init@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
with:
languages: c-cpp
# If you wish to specify custom queries, you can do so here or in a config file.
Expand Down Expand Up @@ -100,6 +100,6 @@ jobs:
run: make -j2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@4fa2a7953630fd2f3fb380f21be14ede0169dd4f # v3.25.12
uses: github/codeql-action/analyze@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
with:
category: "/language:c-cpp"
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/h100.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
- '**/*.py'
- 'docs/**'
types: [ opened, reopened, synchronize ]
pull_request_review:
types:
- submitted

permissions:
contents: none
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/mi210.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
- '**/*.py'
- 'docs/**'
types: [ opened, reopened, synchronize ]
pull_request_review:
types:
- submitted

permissions:
contents: none
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit

Expand All @@ -43,7 +43,7 @@ jobs:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
with:
results_file: results.sarif
results_format: sarif
Expand Down Expand Up @@ -73,6 +73,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@4fa2a7953630fd2f3fb380f21be14ede0169dd4f # v3.25.12
uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
with:
sarif_file: results.sarif
3 changes: 3 additions & 0 deletions .github/workflows/spr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on: workflow_dispatch
# - '**/*.py'
# - 'docs/**'
# types: [ opened, reopened, synchronize ]
#pull_request_review:
# types:
# - submitted

permissions:
contents: none
Expand Down
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@ ELSE()
IF (NOT KOKKOSKERNELS_HAS_TRILINOS AND NOT KOKKOSKERNELS_HAS_PARENT)
# This is a standalone build
FIND_PACKAGE(Kokkos REQUIRED)
IF(Kokkos_COMPILE_LANGUAGE)
ENABLE_LANGUAGE(${Kokkos_COMPILE_LANGUAGE})
IF(Kokkos_COMPILE_LANGUAGE STREQUAL CUDA)
SET(CMAKE_CUDA_ARCHITECTURES ${Kokkos_CUDA_ARCHITECTURES})
ENDIF()
IF(Kokkos_COMPILE_LANGUAGE STREQUAL HIP)
SET(CMAKE_HIP_ARCHITECTURES ${Kokkos_HIP_ARCHITECTURES})
ENDIF()
ENDIF()
IF(${Kokkos_VERSION} VERSION_GREATER_EQUAL "4.2.00")
MESSAGE(STATUS "Found Kokkos version ${Kokkos_VERSION} at ${Kokkos_DIR}")
IF((${Kokkos_VERSION} VERSION_GREATER "4.3.99"))
Expand Down
11 changes: 11 additions & 0 deletions cmake/kokkoskernels_tribits.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ ENDIF()
IF(PARSE_SOURCES)
LIST(REMOVE_DUPLICATES PARSE_SOURCES)
ENDIF()
IF(Kokkos_COMPILE_LANGUAGE)
FOREACH(source ${PARSE_SOURCES})
SET_SOURCE_FILES_PROPERTIES(${source} PROPERTIES LANGUAGE ${Kokkos_COMPILE_LANGUAGE})
ENDFOREACH()
ENDIF()

ADD_LIBRARY(
${LIBRARY_NAME}
Expand Down Expand Up @@ -151,6 +156,12 @@ IF (IS_ENABLED)
SOURCES ${PARSE_SOURCES}
TESTONLYLIBS ${PARSE_TESTONLYLIBS})
ELSE()
# Set the correct CMake language on all source files for this exe
IF(Kokkos_COMPILE_LANGUAGE)
FOREACH(source ${PARSE_SOURCES})
SET_SOURCE_FILES_PROPERTIES(${source} PROPERTIES LANGUAGE ${Kokkos_COMPILE_LANGUAGE})
ENDFOREACH()
ENDIF()
ADD_EXECUTABLE(${EXE_NAME} ${PARSE_SOURCES})
#AJP, BMK altered:
IF(KOKKOSKERNELS_ENABLE_TESTS_AND_PERFSUITE)
Expand Down
2 changes: 1 addition & 1 deletion scripts/cm_test_all_sandia
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ elif [ "$MACHINE" = "weaver" ]; then
SKIP_HWLOC=True

GCC93_MODULE_TPL_LIST="cmake/3.23.1,<COMPILER_NAME>/<COMPILER_VERSION>,openblas/0.3.20/gcc/9.3.0,gcc/9.3.0"
CLANG13_MODULE_TPL_LIST="cmake/3.23.1,<COMPILER_NAME>/<COMPILER_VERSION>,openblas/0.3.20/gcc/9.3.0,cuda/10.1.243"
CLANG13_MODULE_TPL_LIST="cmake/3.23.1,<COMPILER_NAME>/<COMPILER_VERSION>,openblas/0.3.20/gcc/9.3.0,cuda/10.1.243,gcc/9.3.0"

BASE_MODULE_LIST="cmake/3.23.1,<COMPILER_NAME>/<COMPILER_VERSION>"
# Cuda/11 modules available rhel8 queue (rhel8 OS); gcc/8.3.1 load by default
Expand Down
14 changes: 14 additions & 0 deletions sparse/unit_test/Test_Sparse_coo2crs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ void doAllCoo2Crs(size_t m, size_t n) {
}

TEST_F(TestCategory, sparse_coo2crs) {
#if defined(KOKKOS_ENABLE_SYCL)
if constexpr (std::is_same_v<typename TestDevice::execution_space, Kokkos::Experimental::SYCL>) {
std::cout << "Not running coo2csr on SYCL execution space" << std::endl;
return;
}
#endif

uint64_t ticks = std::chrono::high_resolution_clock::now().time_since_epoch().count() % UINT32_MAX;
std::srand(ticks);

Expand Down Expand Up @@ -241,6 +248,13 @@ TEST_F(TestCategory, sparse_coo2crs) {
}

TEST_F(TestCategory, sparse_coo2crs_staticMatrix_edgeCases) {
#if defined(KOKKOS_ENABLE_SYCL)
if constexpr (std::is_same_v<typename TestDevice::execution_space, Kokkos::Experimental::SYCL>) {
std::cout << "Not running coo2csr on SYCL execution space" << std::endl;
return;
}
#endif

int m = 4;
int n = 4;
long long staticRow[16]{0, 1, 3, 2, 3, 2, 2, 2, 0, 0, 0, 1, 2, 0, 3, 0};
Expand Down
41 changes: 19 additions & 22 deletions sparse/unit_test/Test_Sparse_sptrsv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ struct SptrsvTest {

using range_policy_t = Kokkos::RangePolicy<execution_space>;

static inline const scalar_t ZERO = scalar_t(0);
static inline const scalar_t ONE = scalar_t(1);

static std::vector<std::vector<scalar_t>> get_5x5_ut_ones_fixture() {
std::vector<std::vector<scalar_t>> A = {{1.00, 0.00, 1.00, 0.00, 0.00},
{0.00, 1.00, 0.00, 0.00, 1.00},
Expand Down Expand Up @@ -147,7 +144,7 @@ struct SptrsvTest {
// known_lhs
ValuesType known_lhs("known_lhs", nrows);
// Create known solution lhs set to all 1's
Kokkos::deep_copy(known_lhs, ONE);
Kokkos::deep_copy(known_lhs, scalar_t(1));

// Solution to find
ValuesType lhs("lhs", nrows);
Expand All @@ -156,7 +153,7 @@ struct SptrsvTest {
ValuesType rhs("rhs", nrows);

Crs triMtx("triMtx", nrows, nrows, nnz, values, row_map, entries);
KokkosSparse::spmv("N", ONE, triMtx, known_lhs, ZERO, rhs);
KokkosSparse::spmv("N", scalar_t(1), triMtx, known_lhs, scalar_t(0), rhs);

return std::make_tuple(triMtx, lhs, rhs);
}
Expand Down Expand Up @@ -199,7 +196,7 @@ struct SptrsvTest {
Kokkos::parallel_reduce(range_policy_t(0, lhs.extent(0)), ReductionCheck(lhs), sum);
EXPECT_EQ(sum, lhs.extent(0));

Kokkos::deep_copy(lhs, ZERO);
Kokkos::deep_copy(lhs, scalar_t(0));

kh.destroy_sptrsv_handle();
}
Expand Down Expand Up @@ -273,8 +270,8 @@ struct SptrsvTest {
Kokkos::deep_copy(Uvalues, hUvalues);

Crs mtxU("mtxU", nrows, nrows, nnz_sp, Uvalues, Urowptr, Ucolind);
Kokkos::deep_copy(B, ONE);
KokkosSparse::spmv("N", ONE, mtxU, B, ZERO, X);
Kokkos::deep_copy(B, scalar_t(1));
KokkosSparse::spmv("N", scalar_t(1), mtxU, B, scalar_t(0), X);
}
}

Expand Down Expand Up @@ -318,23 +315,23 @@ struct SptrsvTest {
// values
// first column (first supernode)
hUvalues(0) = FIVE;
hUvalues(1) = ZERO;
hUvalues(1) = scalar_t(0);
// second column (first supernode)
hUvalues(2) = ONE;
hUvalues(2) = scalar_t(1);
hUvalues(3) = FIVE;
// third column (second supernode)
hUvalues(4) = FIVE;
hUvalues(5) = ONE;
hUvalues(6) = ZERO;
hUvalues(5) = scalar_t(1);
hUvalues(6) = scalar_t(0);
// fourth column (third supernode)
hUvalues(7) = FIVE;
hUvalues(8) = ONE;
hUvalues(8) = scalar_t(1);
// fifth column (fourth supernode)
hUvalues(9) = FIVE;
hUvalues(10) = ZERO;
hUvalues(11) = ONE;
hUvalues(12) = ONE;
hUvalues(13) = ONE;
hUvalues(10) = scalar_t(0);
hUvalues(11) = scalar_t(1);
hUvalues(12) = scalar_t(1);
hUvalues(13) = scalar_t(1);

// store Ut in crsmat
host_graph_t static_graph(hUrowind, hUcolptr);
Expand Down Expand Up @@ -386,7 +383,7 @@ struct SptrsvTest {
Kokkos::deep_copy(Lvalues, hLvalues);

Crs mtxL("mtxL", nrows, nrows, nnz_sp, Lvalues, Lcolptr, Lrowind);
KokkosSparse::spmv("T", ONE, mtxL, X, ZERO, B);
KokkosSparse::spmv("T", scalar_t(1), mtxL, X, scalar_t(0), B);
}
}

Expand Down Expand Up @@ -417,7 +414,7 @@ struct SptrsvTest {
// > solve
ValuesType b("b", nrows);
Kokkos::deep_copy(b, B);
Kokkos::deep_copy(X, ZERO);
Kokkos::deep_copy(X, scalar_t(0));
sptrsv_solve(&khL, &khU, X, b);
Kokkos::fence();

Expand Down Expand Up @@ -473,7 +470,7 @@ struct SptrsvTest {
// > solve
ValuesType b("b", nrows);
Kokkos::deep_copy(b, B);
Kokkos::deep_copy(X, ZERO);
Kokkos::deep_copy(X, scalar_t(0));
sptrsv_solve(&khLd, &khUd, X, b);
Kokkos::fence();

Expand Down Expand Up @@ -554,15 +551,15 @@ struct SptrsvTest {
// known_lhs
ValuesType known_lhs("known_lhs", nrows);
// Create known solution lhs set to all 1's
Kokkos::deep_copy(known_lhs, ONE);
Kokkos::deep_copy(known_lhs, scalar_t(1));

// Solution to find
lhs_v[i] = ValuesType("lhs", nrows);

// A*known_lhs generates rhs: rhs is dense, use spmv
rhs_v[i] = ValuesType("rhs", nrows);

KokkosSparse::spmv("N", ONE, triMtx, known_lhs, ZERO, rhs_v[i]);
KokkosSparse::spmv("N", scalar_t(1), triMtx, known_lhs, scalar_t(0), rhs_v[i]);
Kokkos::fence();

// Create handle
Expand Down

0 comments on commit 6c9bc4c

Please sign in to comment.