-
Notifications
You must be signed in to change notification settings - Fork 8
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
#2240: Add Rabenseifner
and Recursive doubling
allreduce algorithms for ObjGroup
#2272
base: develop
Are you sure you want to change the base?
#2240: Add Rabenseifner
and Recursive doubling
allreduce algorithms for ObjGroup
#2272
Conversation
17cfcbd
to
16da9e7
Compare
Results of running allreduce on std::vector<int32_t> with 65536 elements
|
Results of running allreduce on std::vector<int32_t> with 2 elems
|
53da893
to
e3fa49b
Compare
Still missing:
|
Rabenseifner
and Recursive doubling
allreduce algorithms for ObjGroup
Rabenseifner
and Recursive doubling
allreduce algorithms for ObjGroup
80d6712
to
f01bad5
Compare
Regarding the issue with the If users want to use their custom wrapper, then they should provide #include <vector>
#ifdef VT_KOKKOS_ENABLED
#include <Kokkos_Core.hpp>
#endif
template <typename Container>
class DataHandler {
public:
using Scalar = float;
static size_t size(const Container& data);
static Scalar& at(Container& data, size_t idx);
static void set(Container& data, size_t idx, const Scalar& value);
static Container split(Container& data, size_t start, size_t end);
};
template <typename T>
class DataHandler<std::vector<T>> {
public:
using Scalar = T;
static size_t size(const std::vector<T>& data) { return data.size(); }
static T at(const std::vector<T>& data, size_t idx) { return data[idx]; }
static T& at(std::vector<T>& data, size_t idx) { return data[idx]; }
static void set(std::vector<T>& data, size_t idx, const T& value) {
data[idx] = value;
}
static std::vector<T> split(std::vector<T>& data, size_t start, size_t end) {
return std::vector<T>{data.begin() + start, data.begin() + end};
}
};
#ifdef VT_KOKKOS_ENABLED
template <typename T, typename... Props>
class DataHandler<Kokkos::View<T*, Props...>> {
public:
static size_t size(const Kokkos::View<T*, Props...>& data) {
return data.extent(0);
}
static T at(const Kokkos::View<T*, Props...>& data, size_t idx) {
return data(idx);
}
static T& at(Kokkos::View<T*, Props...>& data, size_t idx) {
return data(idx);
}
static void
set(Kokkos::View<T*, Props...>& data, size_t idx, const T& value) {
data(idx) = value;
}
};
#endif // VT_KOKKOS_ENABLED |
Let's go with the |
…I for various data types
f7e0f45
to
ec6751d
Compare
…nd fix compile issues realted to using Kokkos::View for allreduce
Fixes #2240