-
Notifications
You must be signed in to change notification settings - Fork 96
Enable mixed precision dispatch in distributed matrix with ScalarCache, GenericDenseCache, and GenericVectorCache #1819
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ee2e490
Add GenericDenseCache to get different type in runtime to enable the …
yhmtsai b1e2ef1
add ScalarCache to generate different Dense scalar with different val…
yhmtsai d530b20
update format, make data private to avoid acciendental access
yhmtsai efb9c10
add cache accessor for private member to test
yhmtsai 2ae7eb9
add GenericVectorCache
yhmtsai 62891de
enable distributed matrix mixed precision
yhmtsai 36e5e52
return the vectors in init_recv_buffers and merge init and get together
yhmtsai b9d947c
fix ambiguous
yhmtsai a60e3da
ScalarCache allocate memory when it is used in the first time
yhmtsai 71c3aea
fix typo, macro, and use proper header
yhmtsai 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
"comm_pattern": "stencil", | ||
"spmv": { | ||
"csr-csr": { | ||
"storage": 11476, | ||
"storage": 11452, | ||
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. It is from DenseCache -> ScalarCache, we allocate the memory when using it. |
||
"time": 1.0, | ||
"repetitions": 1, | ||
"completed": true | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// SPDX-FileCopyrightText: 2025 The Ginkgo authors | ||
// | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
|
||
#ifndef GKO_CORE_BASE_DENSE_CACHE_ACCESSOR_HPP_ | ||
#define GKO_CORE_BASE_DENSE_CACHE_ACCESSOR_HPP_ | ||
|
||
|
||
#include <map> | ||
#include <string> | ||
|
||
#include <ginkgo/core/base/array.hpp> | ||
#include <ginkgo/core/base/dense_cache.hpp> | ||
#include <ginkgo/core/base/executor.hpp> | ||
#include <ginkgo/core/base/lin_op.hpp> | ||
|
||
|
||
namespace gko { | ||
namespace detail { | ||
|
||
|
||
// helper to access private member for testing | ||
class GenericDenseCacheAccessor { | ||
public: | ||
// access to the workspace | ||
static const array<char>& get_workspace(const GenericDenseCache& cache); | ||
}; | ||
|
||
|
||
// helper to access private member for testing | ||
class ScalarCacheAccessor { | ||
public: | ||
// access to the executor | ||
static std::shared_ptr<const Executor> get_executor( | ||
const ScalarCache& cache); | ||
|
||
// access to the value | ||
static double get_value(const ScalarCache& cache); | ||
|
||
// access to the scalars | ||
static const std::map<std::string, std::shared_ptr<const gko::LinOp>>& | ||
get_scalars(const ScalarCache& cache); | ||
}; | ||
|
||
|
||
} // namespace detail | ||
} // namespace gko | ||
|
||
|
||
#endif // GKO_CORE_BASE_DENSE_CACHE_ACCESSOR_HPP_ |
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.
because ScalarCache allocate the memory when it is first used with the type