-
Notifications
You must be signed in to change notification settings - Fork 15
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
TriSolver (dist): move sorting permutation from CPU to GPU #1118
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
92c0076
WIP: add i5b for local permutation + adapt local permutation to deal
albestro 46c6190
switch to col vector for permutations indices
albestro 8cd03c0
WIP: adapt also for GPU
albestro de3d218
drop permuteJustLocal custom implementation
albestro 0085d57
WIP: requirements change to use public API of permute with distribute…
albestro 78b652a
use public API of permute in tridiagonal solver
albestro 76415a8
simplified version of applyPermutationsOnCPU
albestro f89feca
minor changes and doc
albestro 60bf9e6
integrate doc
albestro 3a87a30
test for local permutation on distributed matrix
albestro a70d6da
bug fix and minor improvement to assert
albestro 3556723
add also gpu test
albestro 9044f06
add test also for row permutations (cpu and gpu)
albestro 16fd6f7
bug fix for row permutation
albestro 05f7269
add anoter test-case
albestro 9a8afa0
revert change to fix warnings
albestro 27fdb60
fix another warning
albestro e76b3bc
fix also the other assertion
albestro f06b0fa
refactor and drop old applyPermutationOnCPU with splits
albestro dd8c4ec
yet another warning fix
albestro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ namespace dlaf::permutations { | |
/// perms[i_begin:i_end]. | ||
/// | ||
/// @param perms is the index map of permutations represented as a tiled column vector. Indices are in | ||
/// the range [0, n) where `n` is the size of the submatrix (i.e. the indices are local to the | ||
/// the range [0, n) where `n` is the local size of the submatrix (i.e. the indices are local to the | ||
/// submatrix, they are not global). Only tiles whose row tile coords are in the range | ||
/// [i_begin,i_end) are accessed in read-only mode. | ||
/// @pre @p perms is not distributed | ||
|
@@ -37,7 +37,6 @@ namespace dlaf::permutations { | |
/// | ||
/// @param mat_in is the input matrix. Only tiles whose both row and col tile coords are in | ||
/// the range [i_begin,i_end) are accessed in read-only mode. | ||
/// @pre @p mat_in is not distributed | ||
/// @pre @p mat_in has size (N x N) | ||
/// @pre @p mat_in has blocksize (NB x NB) | ||
/// @pre @p mat_in has tilesize (NB x NB) | ||
|
@@ -51,15 +50,14 @@ template <Backend B, Device D, class T, Coord coord> | |
void permute(SizeType i_begin, SizeType i_end, Matrix<const SizeType, D>& perms, | ||
Matrix<const T, D>& mat_in, Matrix<T, D>& mat_out) { | ||
DLAF_ASSERT(matrix::local_matrix(perms), perms); | ||
DLAF_ASSERT(matrix::local_matrix(mat_in), mat_in); | ||
DLAF_ASSERT(matrix::local_matrix(mat_out), mat_out); | ||
DLAF_ASSERT(matrix::same_process_grid(mat_in, mat_out), mat_in, mat_out); | ||
|
||
// Note: | ||
// These are not implementation constraints, but more logic constraints. Indeed, these ensure that | ||
// the range [i_begin, i_end] is square in terms of elements (it would not make sense to have it square | ||
// in terms of number of tiles). Moreover, by requiring mat_in and mat_out matrices to have the same | ||
// shape, it is ensured that range [i_begin, i_end] is actually the same on both sides. | ||
Comment on lines
55
to
59
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. Constraints should be revised (in a different PR). |
||
DLAF_ASSERT(square_size(mat_in), mat_in); | ||
DLAF_ASSERT(matrix::square_size(mat_in), mat_in); | ||
DLAF_ASSERT(matrix::square_blocksize(mat_in), mat_in); | ||
DLAF_ASSERT(matrix::equal_size(mat_in, mat_out), mat_in); | ||
DLAF_ASSERT(matrix::equal_blocksize(mat_in, mat_out), mat_in); | ||
|
@@ -68,12 +66,17 @@ void permute(SizeType i_begin, SizeType i_end, Matrix<const SizeType, D>& perms, | |
DLAF_ASSERT(matrix::single_tile_per_block(mat_in), mat_in); | ||
DLAF_ASSERT(matrix::single_tile_per_block(mat_out), mat_out); | ||
|
||
DLAF_ASSERT(perms.size().rows() == mat_in.size().rows(), perms, mat_in); | ||
DLAF_ASSERT(perms.block_size().rows() == mat_in.block_size().rows(), mat_in, perms); | ||
|
||
// Note: | ||
// perms is a column vector with a number of elements equal to the local part of matrix involved | ||
// in the permutation, i.e. [i_begin, i_end), along coord axis | ||
DLAF_ASSERT(perms.size().cols() == 1, perms); | ||
DLAF_ASSERT(perms.blockSize().rows() == mat_in.blockSize().rows(), mat_in, perms); | ||
DLAF_ASSERT(perms.size().rows() == mat_in.distribution().local_size().template get<coord>(), perms, | ||
mat_in); | ||
|
||
DLAF_ASSERT(i_begin >= 0 && i_begin <= i_end, i_begin, i_end); | ||
DLAF_ASSERT(i_end <= perms.nrTiles().rows(), i_end, perms); | ||
DLAF_ASSERT(i_end <= mat_in.nr_tiles().rows(), i_end, perms); | ||
|
||
internal::Permutations<B, D, T, coord>::call(i_begin, i_end, perms, mat_in, mat_out); | ||
} | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
note-to-self: specify that they are local indices, while in
index_sorted_coltype
they are global indices