Skip to content
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

Kokkos + KokkosKernels Promotion To 4.3.0 (Test) #12863

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
35 changes: 35 additions & 0 deletions packages/kokkos-kernels/.readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
2 changes: 1 addition & 1 deletion packages/kokkos-kernels/BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ endif()
* KokkosKernels_LAPACK_ROOT: PATH
* Location of LAPACK install root.
* Default: None or the value of the environment variable LAPACK_ROOT if set
* KokkosKernels_LINALG_OPT_LEVEL: BOOL
* KokkosKernels_LINALG_OPT_LEVEL: BOOL **DEPRECATED**
* Optimization level for KokkosKernels computational kernels: a nonnegative integer. Higher levels result in better performance that is more uniform for corner cases, but increase build time and library size. The default value is 1, which should give performance within ten percent of optimal on most platforms, for most problems.
* Default: 1
* KokkosKernels_MAGMA_ROOT: PATH
Expand Down
8 changes: 0 additions & 8 deletions packages/kokkos-kernels/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,6 @@

### Bug Fixes:

- Use CRS matrix sort, instead of Kokkos::sort on each row [\#1553](https://github.com/kokkos/kokkos-kernels/pull/1553)
- Change template type for StaticCrsGraph in BsrMatrix [\#1531](https://github.com/kokkos/kokkos-kernels/pull/1531)
- Remove listing of undefined TPL deps [\#1568](https://github.com/kokkos/kokkos-kernels/pull/1568)
- Fix using SpGEMM with nonstandard scalar type, with MKL enabled [\#1591](https://github.com/kokkos/kokkos-kernels/pull/1591)
Expand Down Expand Up @@ -865,13 +864,6 @@
- Nightly test failure: spgemm unit tests failing on White \(Power8\) [\#780](https://github.com/kokkos/kokkos-kernels/issues/780)
- supernodal does not build with UVM enabled [\#633](https://github.com/kokkos/kokkos-kernels/issues/633)

## [3.1.01](https://github.com/kokkos/kokkos-kernels/tree/3.1.01) (2020-05-04)
[Full Changelog](https://github.com/kokkos/kokkos-kernels/compare/3.1.00...3.1.01)

** Fixed bugs:**

- KokkosBatched QR PR breaking nightly tests [\#691](https://github.com/kokkos/kokkos-kernels/issues/691)

## [3.1.00](https://github.com/kokkos/kokkos-kernels/tree/3.1.00) (2020-04-14)
[Full Changelog](https://github.com/kokkos/kokkos-kernels/compare/3.0.00...3.1.00)

Expand Down
23 changes: 16 additions & 7 deletions packages/kokkos-kernels/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ SET(KOKKOSKERNELS_TOP_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR})
SET(KOKKOSKERNELS_TOP_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})

SET(KokkosKernels_VERSION_MAJOR 4)
SET(KokkosKernels_VERSION_MINOR 2)
SET(KokkosKernels_VERSION_PATCH 1)
SET(KokkosKernels_VERSION_MINOR 3)
SET(KokkosKernels_VERSION_PATCH 0)
SET(KokkosKernels_VERSION "${KokkosKernels_VERSION_MAJOR}.${KokkosKernels_VERSION_MINOR}.${KokkosKernels_VERSION_PATCH}")

#Set variables for config file
Expand Down Expand Up @@ -127,13 +127,13 @@ ELSE()
IF (NOT KOKKOSKERNELS_HAS_TRILINOS AND NOT KOKKOSKERNELS_HAS_PARENT)
# This is a standalone build
FIND_PACKAGE(Kokkos REQUIRED)
IF((${Kokkos_VERSION} VERSION_EQUAL "4.1.00") OR (${Kokkos_VERSION} VERSION_GREATER_EQUAL "4.2.00"))
IF((${Kokkos_VERSION} VERSION_EQUAL "4.1.00") OR (${Kokkos_VERSION} VERSION_GREATER_EQUAL "4.3.0"))
MESSAGE(STATUS "Found Kokkos version ${Kokkos_VERSION} at ${Kokkos_DIR}")
IF((${Kokkos_VERSION} VERSION_GREATER "4.2.99"))
IF((${Kokkos_VERSION} VERSION_GREATER "4.3.99"))
MESSAGE(WARNING "Configuring with Kokkos ${Kokkos_VERSION} which is newer than the expected develop branch - version check may need update")
ENDIF()
ELSE()
MESSAGE(FATAL_ERROR "Kokkos Kernels ${KokkosKernels_VERSION} requires 4.1.00, 4.2.00, 4.2.01 or develop")
MESSAGE(FATAL_ERROR "Kokkos Kernels ${KokkosKernels_VERSION} requires 4.1.00, 4.2.00, 4.2.1, 4.3.0 or develop")
ENDIF()
ENDIF()

Expand All @@ -156,9 +156,16 @@ ELSE()
KOKKOSKERNELS_ADD_OPTION_AND_DEFINE(
LINALG_OPT_LEVEL
KOKKOSLINALG_OPT_LEVEL
"Optimization level for KokkosKernels computational kernels: a nonnegative integer. Higher levels result in better performance that is more uniform for corner cases, but increase build time and library size. The default value is 1, which should give performance within ten percent of optimal on most platforms, for most problems. Default: 1"
"DEPRECATED. Optimization level for KokkosKernels computational kernels: a nonnegative integer. Higher levels result in better performance that is more uniform for corner cases, but increase build time and library size. The default value is 1, which should give performance within ten percent of optimal on most platforms, for most problems. Default: 1"
"1")

if (KokkosKernels_LINALG_OPT_LEVEL AND NOT KokkosKernels_LINALG_OPT_LEVEL STREQUAL "1")
message(WARNING "KokkosKernels_LINALG_OPT_LEVEL is deprecated!")
endif()
if(KokkosKernels_KOKKOSLINALG_OPT_LEVEL AND NOT KokkosKernels_KOKKOSLINALG_OPT_LEVEL STREQUAL "1")
message(WARNING "KokkosKernels_KOKKOSLINALG_OPT_LEVEL is deprecated!")
endif()

# Enable experimental features of KokkosKernels if set at configure
# time. Default is no.
KOKKOSKERNELS_ADD_OPTION_AND_DEFINE(
Expand Down Expand Up @@ -375,8 +382,10 @@ ELSE()
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC MKL)
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC CUBLAS)
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC CUSPARSE)
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC CUSOLVER)
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC ROCBLAS)
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC ROCSPARSE)
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC ROCSOLVER)
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC METIS)
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC ARMPL)
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC MAGMA)
Expand Down Expand Up @@ -425,7 +434,7 @@ ELSE()
IF (KOKKOSKERNELS_ALL_COMPONENTS_ENABLED)
IF (KokkosKernels_ENABLE_PERFTESTS)
MESSAGE(STATUS "Enabling perf tests.")
KOKKOSKERNELS_ADD_TEST_DIRECTORIES(perf_test)
add_subdirectory(perf_test) # doesn't require KokkosKernels_ENABLE_TESTS=ON
ENDIF ()
IF (KokkosKernels_ENABLE_EXAMPLES)
MESSAGE(STATUS "Enabling examples.")
Expand Down
8 changes: 4 additions & 4 deletions packages/kokkos-kernels/CheckHostBlasReturnComplex.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ FUNCTION(CHECK_HOST_BLAS_RETURN_COMPLEX VARNAME)

extern \"C\" {
void F77_BLAS_MANGLE(zdotc,ZDOTC)(
std::complex<double>* result, const int* n,
const std::complex<double> x[], const int* incx,
std::complex<double>* result, const int* n,
const std::complex<double> x[], const int* incx,
const std::complex<double> y[], const int* incy);
}

Expand All @@ -49,9 +49,9 @@ int main() {
CHECK_CXX_SOURCE_RUNS("${SOURCE}" KK_BLAS_RESULT_AS_POINTER_ARG)

IF(${KK_BLAS_RESULT_AS_POINTER_ARG})
SET(VARNAME OFF)
SET(${VARNAME} OFF PARENT_SCOPE)
ELSE()
SET(VARNAME ON)
SET(${VARNAME} ON PARENT_SCOPE)
ENDIF()

ENDFUNCTION()
2 changes: 1 addition & 1 deletion packages/kokkos-kernels/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Generic badge](https://readthedocs.org/projects/pip/badge/?version=latest&style=flat)](https://kokkos-kernels.readthedocs.io/en/latest/)
[![Generic badge](https://readthedocs.org/projects/kokkos-kernels/badge/?version=latest)](https://kokkos-kernels.readthedocs.io/en/latest/)

![KokkosKernels](https://avatars2.githubusercontent.com/u/10199860?s=200&v=4)

Expand Down
24 changes: 0 additions & 24 deletions packages/kokkos-kernels/batched/KokkosBatched_Util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,18 +626,6 @@ KOKKOS_INLINE_FUNCTION auto subview_wrapper(ViewType v, IdxType1 i1,
const Trans::NoTranspose) {
return subview_wrapper(v, i1, i2, i3, layout_tag);
}
#if KOKKOS_VERSION < 40099
template <class ViewType, class IdxType1>
KOKKOS_INLINE_FUNCTION auto subview_wrapper(ViewType v, IdxType1 i1,
Kokkos::Impl::ALL_t i2,
Kokkos::Impl::ALL_t i3,
const BatchLayout::Left &layout_tag,
const Trans::Transpose) {
auto sv_nt = subview_wrapper(v, i1, i3, i2, layout_tag);

return transpose_2d_view(sv_nt, layout_tag);
}
#else
template <class ViewType, class IdxType1>
KOKKOS_INLINE_FUNCTION auto subview_wrapper(ViewType v, IdxType1 i1,
Kokkos::ALL_t i2, Kokkos::ALL_t i3,
Expand All @@ -647,7 +635,6 @@ KOKKOS_INLINE_FUNCTION auto subview_wrapper(ViewType v, IdxType1 i1,

return transpose_2d_view(sv_nt, layout_tag);
}
#endif
template <class ViewType, class IdxType1, class IdxType2, class IdxType3>
KOKKOS_INLINE_FUNCTION auto subview_wrapper(ViewType v, IdxType1 i1,
IdxType2 i2, IdxType3 i3,
Expand All @@ -671,16 +658,6 @@ KOKKOS_INLINE_FUNCTION auto subview_wrapper(
const BatchLayout::Right &layout_tag, const Trans::NoTranspose &) {
return subview_wrapper(v, i1, i2, i3, layout_tag);
}
#if KOKKOS_VERSION < 40099
template <class ViewType, class IdxType1>
KOKKOS_INLINE_FUNCTION auto subview_wrapper(
ViewType v, IdxType1 i1, Kokkos::Impl::ALL_t i2, Kokkos::Impl::ALL_t i3,
const BatchLayout::Right &layout_tag, const Trans::Transpose &) {
auto sv_nt = subview_wrapper(v, i1, i3, i2, layout_tag);

return transpose_2d_view(sv_nt, layout_tag);
}
#else
template <class ViewType, class IdxType1>
KOKKOS_INLINE_FUNCTION auto subview_wrapper(
ViewType v, IdxType1 i1, Kokkos::ALL_t i2, Kokkos::ALL_t i3,
Expand All @@ -689,7 +666,6 @@ KOKKOS_INLINE_FUNCTION auto subview_wrapper(

return transpose_2d_view(sv_nt, layout_tag);
}
#endif
template <class ViewType, class IdxType1, class IdxType2, class IdxType3>
KOKKOS_INLINE_FUNCTION auto subview_wrapper(
ViewType v, IdxType1 i1, IdxType2 i2, IdxType3 i3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,20 +366,24 @@ KOKKOS_INLINE_FUNCTION void TeamVectorHadamard1D(const MemberType &member,
/// ===========
template <>
struct SerialGesv<Gesv::StaticPivoting> {
template <typename MatrixType, typename VectorType>
template <typename MatrixType, typename XVectorType, typename YVectorType>
KOKKOS_INLINE_FUNCTION static int invoke(const MatrixType A,
const VectorType X,
const VectorType Y,
const XVectorType X,
const YVectorType Y,
const MatrixType tmp) {
#if (KOKKOSKERNELS_DEBUG_LEVEL > 0)
static_assert(Kokkos::is_view<MatrixType>::value,
"KokkosBatched::gesv: MatrixType is not a Kokkos::View.");
static_assert(Kokkos::is_view<VectorType>::value,
"KokkosBatched::gesv: VectorType is not a Kokkos::View.");
static_assert(Kokkos::is_view<XVectorType>::value,
"KokkosBatched::gesv: XVectorType is not a Kokkos::View.");
static_assert(Kokkos::is_view<YVectorType>::value,
"KokkosBatched::gesv: YVectorType is not a Kokkos::View.");
static_assert(MatrixType::rank == 2,
"KokkosBatched::gesv: MatrixType must have rank 2.");
static_assert(VectorType::rank == 1,
"KokkosBatched::gesv: VectorType must have rank 1.");
static_assert(XVectorType::rank == 1,
"KokkosBatched::gesv: XVectorType must have rank 1.");
static_assert(YVectorType::rank == 1,
"KokkosBatched::gesv: YVectorType must have rank 1.");

// Check compatibility of dimensions at run time.

Expand Down Expand Up @@ -462,20 +466,24 @@ struct SerialGesv<Gesv::StaticPivoting> {

template <>
struct SerialGesv<Gesv::NoPivoting> {
template <typename MatrixType, typename VectorType>
template <typename MatrixType, typename XVectorType, typename YVectorType>
KOKKOS_INLINE_FUNCTION static int invoke(const MatrixType A,
const VectorType X,
const VectorType Y,
const XVectorType X,
const YVectorType Y,
const MatrixType /*tmp*/) {
#if (KOKKOSKERNELS_DEBUG_LEVEL > 0)
static_assert(Kokkos::is_view<MatrixType>::value,
"KokkosBatched::gesv: MatrixType is not a Kokkos::View.");
static_assert(Kokkos::is_view<VectorType>::value,
"KokkosBatched::gesv: VectorType is not a Kokkos::View.");
static_assert(Kokkos::is_view<XVectorType>::value,
"KokkosBatched::gesv: XVectorType is not a Kokkos::View.");
static_assert(Kokkos::is_view<YVectorType>::value,
"KokkosBatched::gesv: YVectorType is not a Kokkos::View.");
static_assert(MatrixType::rank == 2,
"KokkosBatched::gesv: MatrixType must have rank 2.");
static_assert(VectorType::rank == 1,
"KokkosBatched::gesv: VectorType must have rank 1.");
static_assert(XVectorType::rank == 1,
"KokkosBatched::gesv: XVectorType must have rank 1.");
static_assert(YVectorType::rank == 1,
"KokkosBatched::gesv: YVectorType must have rank 1.");

// Check compatibility of dimensions at run time.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,9 @@ int BatchedGemmImpl(BatchedGemmHandleType *const handle, const ScalarType alpha,
case BaseKokkosBatchedAlgos::KK_SERIAL:
case BaseHeuristicAlgos::SQUARE:
case BaseTplAlgos::ARMPL:
#if KOKKOS_VERSION > 40099
assert(A.rank_dynamic() == 3 && "AViewType must have rank 3.");
assert(B.rank_dynamic() == 3 && "BViewType must have rank 3.");
assert(C.rank_dynamic() == 3 && "CViewType must have rank 3.");
#endif
break;
default:
std::ostringstream os;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ struct SerialSVDInternal {
value_type a = Kokkos::ArithTraits<value_type>::one();
value_type b = -a11 - a22;
value_type c = a11 * a22 - a21 * a21;
#if KOKKOS_VERSION >= 30699
using Kokkos::sqrt;
#else
using Kokkos::Experimental::sqrt;
#endif
value_type sqrtDet = sqrt(b * b - 4 * a * c);
e1 = (-b + sqrtDet) / (2 * a);
e2 = (-b - sqrtDet) / (2 * a);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,32 @@ struct SerialTrsm<Side::Right, Uplo::Upper, Trans::NoTranspose, ArgDiag,
}
};

template <typename ArgDiag>
struct SerialTrsm<Side::Right, Uplo::Upper, Trans::Transpose, ArgDiag,
Algo::Trsm::Unblocked> {
template <typename ScalarType, typename AViewType, typename BViewType>
KOKKOS_INLINE_FUNCTION static int invoke(const ScalarType alpha,
const AViewType &A,
const BViewType &B) {
return SerialTrsmInternalLeftLower<Algo::Trsm::Unblocked>::invoke(
ArgDiag::use_unit_diag, B.extent(1), B.extent(0), alpha, A.data(),
A.stride_0(), A.stride_1(), B.data(), B.stride_1(), B.stride_0());
}
};

template <typename ArgDiag>
struct SerialTrsm<Side::Right, Uplo::Upper, Trans::Transpose, ArgDiag,
Algo::Trsm::Blocked> {
template <typename ScalarType, typename AViewType, typename BViewType>
KOKKOS_INLINE_FUNCTION static int invoke(const ScalarType alpha,
const AViewType &A,
const BViewType &B) {
return SerialTrsmInternalLeftLower<Algo::Trsm::Blocked>::invoke(
ArgDiag::use_unit_diag, B.extent(1), B.extent(0), alpha, A.data(),
A.stride_0(), A.stride_1(), B.data(), B.stride_1(), B.stride_0());
}
};

///
/// L/U/NT
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,36 @@ struct TeamTrsm<MemberType, Side::Right, Uplo::Upper, Trans::NoTranspose,
}
};

template <typename MemberType, typename ArgDiag>
struct TeamTrsm<MemberType, Side::Right, Uplo::Upper, Trans::Transpose, ArgDiag,
Algo::Trsm::Unblocked> {
template <typename ScalarType, typename AViewType, typename BViewType>
KOKKOS_INLINE_FUNCTION static int invoke(const MemberType &member,
const ScalarType alpha,
const AViewType &A,
const BViewType &B) {
return TeamTrsmInternalLeftLower<Algo::Trsm::Unblocked>::invoke(
member, ArgDiag::use_unit_diag, B.extent(1), B.extent(0), alpha,
A.data(), A.stride_0(), A.stride_1(), B.data(), B.stride_1(),
B.stride_0());
}
};

template <typename MemberType, typename ArgDiag>
struct TeamTrsm<MemberType, Side::Right, Uplo::Upper, Trans::Transpose, ArgDiag,
Algo::Trsm::Blocked> {
template <typename ScalarType, typename AViewType, typename BViewType>
KOKKOS_INLINE_FUNCTION static int invoke(const MemberType &member,
const ScalarType alpha,
const AViewType &A,
const BViewType &B) {
return TeamTrsmInternalLeftLower<Algo::Trsm::Blocked>::invoke(
member, ArgDiag::use_unit_diag, B.extent(1), B.extent(0), alpha,
A.data(), A.stride_0(), A.stride_1(), B.data(), B.stride_1(),
B.stride_0());
}
};

///
/// L/U/NT
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,18 @@ struct Gesv {

template <typename ArgAlgo>
struct SerialGesv {
template <typename MatrixType, typename VectorType>
template <typename MatrixType, typename XVectorType, typename YVectorType>
KOKKOS_INLINE_FUNCTION static int invoke(const MatrixType A,
const VectorType X,
const VectorType Y,
const XVectorType X,
const YVectorType Y,
const MatrixType tmp);

template <typename MatrixType, typename VectorType>
[[deprecated]] KOKKOS_INLINE_FUNCTION static int invoke(
const MatrixType A, const VectorType X, const VectorType Y,
const MatrixType tmp) {
return invoke(A, X, Y, tmp);
}
};

/// \brief Team Batched GESV:
Expand Down
Loading