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

Add diagonal matrix format for diagonal scaling #580

Merged
merged 19 commits into from
Aug 13, 2020

Conversation

fritzgoebel
Copy link
Collaborator

@fritzgoebel fritzgoebel commented Jul 1, 2020

For now, Diagonal can be applied to Dense and Csr.
The normal apply does row wise scaling, the right apply does column wise scaling.

@fritzgoebel fritzgoebel added is:new-feature A request or implementation of a feature that does not exist yet. mod:core This is related to the core module. mod:cuda This is related to the CUDA module. mod:openmp This is related to the OpenMP module. mod:reference This is related to the reference module. type:matrix-format This is related to the Matrix formats 1:ST:WIP This PR is a work in progress. Not ready for review. mod:hip This is related to the HIP module. labels Jul 1, 2020
@fritzgoebel fritzgoebel self-assigned this Jul 1, 2020
@yhmtsai
Copy link
Member

yhmtsai commented Jul 7, 2020

Does this pr should be merged first? After this, #563 extract_diagonal will return Diagonal not Dense

@pratikvn
Copy link
Member

I think we came to a conclusion to merge this first and make the extract diagonal return a Diagonal matrix format ?

@fritzgoebel fritzgoebel removed the 1:ST:WIP This PR is a work in progress. Not ready for review. label Jul 17, 2020
Copy link
Member

@yhmtsai yhmtsai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first part of my review

core/matrix/diagonal.cpp Outdated Show resolved Hide resolved
cuda/test/matrix/dense_kernels.cpp Outdated Show resolved Hide resolved
cuda/test/matrix/diagonal_kernels.cpp Show resolved Hide resolved
cuda/test/matrix/diagonal_kernels.cpp Outdated Show resolved Hide resolved
hip/test/matrix/dense_kernels.hip.cpp Outdated Show resolved Hide resolved
hip/test/matrix/diagonal_kernels.cpp Outdated Show resolved Hide resolved
include/ginkgo/core/matrix/diagonal.hpp Show resolved Hide resolved
include/ginkgo/core/matrix/diagonal.hpp Show resolved Hide resolved
@fritzgoebel fritzgoebel force-pushed the add_diagonal_scaling branch 2 times, most recently from bd699ea to 31d99e8 Compare July 27, 2020 09:20
@codecov
Copy link

codecov bot commented Jul 27, 2020

Codecov Report

Merging #580 into develop will decrease coverage by 0.15%.
The diff coverage is 85.84%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #580      +/-   ##
===========================================
- Coverage    93.01%   92.85%   -0.16%     
===========================================
  Files          296      303       +7     
  Lines        20660    21105     +445     
===========================================
+ Hits         19216    19598     +382     
- Misses        1444     1507      +63     
Impacted Files Coverage Δ
core/device_hooks/common_kernels.inc.cpp 0.00% <0.00%> (ø)
core/factorization/par_ict.cpp 100.00% <ø> (ø)
include/ginkgo/core/base/exception_helpers.hpp 90.90% <ø> (ø)
include/ginkgo/core/matrix/dense.hpp 97.70% <ø> (ø)
core/matrix/diagonal.cpp 64.94% <64.94%> (ø)
reference/test/matrix/diagonal_kernels.cpp 83.52% <83.52%> (ø)
omp/test/matrix/dense_kernels.cpp 99.66% <92.30%> (-0.34%) ⬇️
core/matrix/dense.cpp 99.19% <100.00%> (+0.01%) ⬆️
core/test/matrix/diagonal.cpp 100.00% <100.00%> (ø)
include/ginkgo/core/matrix/diagonal.hpp 100.00% <100.00%> (ø)
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef7a837...07a58a2. Read the comment docs.

@pratikvn pratikvn added the 1:ST:ready-for-review This PR is ready for review label Jul 31, 2020
Copy link
Member

@yhmtsai yhmtsai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. need some minor changes

Csr<ValueType, IndexType> *result) const
{
auto exec = this->get_executor();
auto tmp = Csr<ValueType, IndexType>::create(exec, this->get_size(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to set the same strategy of result csr.

omp/matrix/diagonal_kernels.cpp Show resolved Hide resolved
}


TYPED_TEST(Diagonal, ConverstToCsr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TYPED_TEST(Diagonal, ConverstToCsr)
TYPED_TEST(Diagonal, ConvertsToCsr)

@tcojean tcojean removed mod:core This is related to the core module. mod:cuda This is related to the CUDA module. mod:hip This is related to the HIP module. labels Aug 6, 2020
Copy link
Member

@pratikvn pratikvn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a minor nit

inline void read_impl(MatrixType *mtx, const MatrixData &data)
{
// Diagonal matrices are assumed to be square.
GKO_ASSERT_EQ(data.size[0], data.size[1]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have a GKO_ASSERT_IS_SQUARE_MATRIX which throws DimensionMismatch which is better suited here. But maybe you have to add a get_size() method to MatrixData.

@sonarcloud
Copy link

sonarcloud bot commented Aug 13, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 39 Code Smells

40.2% 40.2% Coverage
2.4% 2.4% Duplication

warning The version of Java (1.8.0_121) you have used to run this analysis is deprecated and we will stop accepting it from October 2020. Please update to at least Java 11.
Read more here

@fritzgoebel fritzgoebel merged commit bb62766 into develop Aug 13, 2020
@fritzgoebel fritzgoebel deleted the add_diagonal_scaling branch August 13, 2020 07:28
@upsj upsj added 1:ST:ready-to-merge This PR is ready to merge. and removed 1:ST:ready-for-review This PR is ready for review labels Aug 13, 2020
tcojean added a commit that referenced this pull request Aug 26, 2020
Release 1.3.0 of Ginkgo.

The Ginkgo team is proud to announce the new minor release of Ginkgo version
1.3.0. This release brings CUDA 11 support, changes the default C++ standard to
be C++14 instead of C++11, adds a new Diagonal matrix format and capacity for
diagonal extraction, significantly improves the CMake configuration output
format, adds the Ginkgo paper which got accepted into the Journal of Open Source
Software (JOSS), and fixes multiple issues.

Supported systems and requirements:
+ For all platforms, cmake 3.9+
+ Linux and MacOS
  + gcc: 5.3+, 6.3+, 7.3+, all versions after 8.1+
  + clang: 3.9+
  + Intel compiler: 2017+
  + Apple LLVM: 8.0+
  + CUDA module: CUDA 9.0+
  + HIP module: ROCm 2.8+
+ Windows
  + MinGW and Cygwin: gcc 5.3+, 6.3+, 7.3+, all versions after 8.1+
  + Microsoft Visual Studio: VS 2017 15.7+
  + CUDA module: CUDA 9.0+, Microsoft Visual Studio
  + OpenMP module: MinGW or Cygwin.


The current known issues can be found in the [known issues page](https://github.com/ginkgo-project/ginkgo/wiki/Known-Issues).


Additions:
+ Add paper for Journal of Open Source Software (JOSS). [#479](#479)
+ Add a DiagonalExtractable interface. [#563](#563)
+ Add a new diagonal Matrix Format. [#580](#580)
+ Add Cuda11 support. [#603](#603)
+ Add information output after CMake configuration. [#610](#610)
+ Add a new preconditioner export example. [#595](#595)
+ Add a new cuda-memcheck CI job. [#592](#592)

Changes:
+ Use unified memory in CUDA debug builds. [#621](#621)
+ Improve `BENCHMARKING.md` with more detailed info. [#619](#619)
+ Use C++14 standard instead of C++11. [#611](#611)
+ Update the Ampere sm information and CudaArchitectureSelector. [#588](#588)

Fixes:
+ Fix documentation warnings and errors. [#624](#624)
+ Fix warnings for diagonal matrix format. [#622](#622)
+ Fix criterion factory parameters in CUDA. [#586](#586)
+ Fix the norm-type in the examples. [#612](#612)
+ Fix the WAW race in OpenMP is_sorted_by_column_index. [#617](#617)
+ Fix the example's exec_map by creating the executor only if requested. [#602](#602)
+ Fix some CMake warnings. [#614](#614)
+ Fix Windows building documentation. [#601](#601)
+ Warn when CXX and CUDA host compiler do not match. [#607](#607)
+ Fix reduce_add, prefix_sum, and doc-build. [#593](#593)
+ Fix find_library(cublas) issue on machines installing multiple cuda. [#591](#591)
+ Fix allocator in sellp read. [#589](#589)
+ Fix the CAS with HIP and NVIDIA backends. [#585](#585)

Deletions:
+ Remove unused preconditioner parameter in LowerTrs. [#587](#587)

Related PR: #625
tcojean added a commit that referenced this pull request Aug 27, 2020
The Ginkgo team is proud to announce the new minor release of Ginkgo version
1.3.0. This release brings CUDA 11 support, changes the default C++ standard to
be C++14 instead of C++11, adds a new Diagonal matrix format and capacity for
diagonal extraction, significantly improves the CMake configuration output
format, adds the Ginkgo paper which got accepted into the Journal of Open Source
Software (JOSS), and fixes multiple issues.

Supported systems and requirements:
+ For all platforms, cmake 3.9+
+ Linux and MacOS
  + gcc: 5.3+, 6.3+, 7.3+, all versions after 8.1+
  + clang: 3.9+
  + Intel compiler: 2017+
  + Apple LLVM: 8.0+
  + CUDA module: CUDA 9.0+
  + HIP module: ROCm 2.8+
+ Windows
  + MinGW and Cygwin: gcc 5.3+, 6.3+, 7.3+, all versions after 8.1+
  + Microsoft Visual Studio: VS 2017 15.7+
  + CUDA module: CUDA 9.0+, Microsoft Visual Studio
  + OpenMP module: MinGW or Cygwin.


The current known issues can be found in the [known issues page](https://github.com/ginkgo-project/ginkgo/wiki/Known-Issues).


Additions:
+ Add paper for Journal of Open Source Software (JOSS). [#479](#479)
+ Add a DiagonalExtractable interface. [#563](#563)
+ Add a new diagonal Matrix Format. [#580](#580)
+ Add Cuda11 support. [#603](#603)
+ Add information output after CMake configuration. [#610](#610)
+ Add a new preconditioner export example. [#595](#595)
+ Add a new cuda-memcheck CI job. [#592](#592)

Changes:
+ Use unified memory in CUDA debug builds. [#621](#621)
+ Improve `BENCHMARKING.md` with more detailed info. [#619](#619)
+ Use C++14 standard instead of C++11. [#611](#611)
+ Update the Ampere sm information and CudaArchitectureSelector. [#588](#588)

Fixes:
+ Fix documentation warnings and errors. [#624](#624)
+ Fix warnings for diagonal matrix format. [#622](#622)
+ Fix criterion factory parameters in CUDA. [#586](#586)
+ Fix the norm-type in the examples. [#612](#612)
+ Fix the WAW race in OpenMP is_sorted_by_column_index. [#617](#617)
+ Fix the example's exec_map by creating the executor only if requested. [#602](#602)
+ Fix some CMake warnings. [#614](#614)
+ Fix Windows building documentation. [#601](#601)
+ Warn when CXX and CUDA host compiler do not match. [#607](#607)
+ Fix reduce_add, prefix_sum, and doc-build. [#593](#593)
+ Fix find_library(cublas) issue on machines installing multiple cuda. [#591](#591)
+ Fix allocator in sellp read. [#589](#589)
+ Fix the CAS with HIP and NVIDIA backends. [#585](#585)

Deletions:
+ Remove unused preconditioner parameter in LowerTrs. [#587](#587)

Related PR: #627
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1:ST:ready-to-merge This PR is ready to merge. is:new-feature A request or implementation of a feature that does not exist yet. mod:all This touches all Ginkgo modules. type:matrix-format This is related to the Matrix formats
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants