Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a84f920
Replace buffer tracking with serialization inspection
devreal Nov 8, 2024
7db597c
Use parsec_data_discard to safely destroy parsec_data_t
devreal Nov 11, 2024
ae656c4
Restrict calls to buffer_apply() to serializable types
devreal Nov 11, 2024
13b6aa6
static_assert that device task output value types are serializable
devreal Nov 11, 2024
3cce7a8
Remove static assert
devreal Nov 12, 2024
356ade0
Attempt at a boost serialization frontend for buffer_apply
devreal Nov 12, 2024
099baef
Using ttg::Buffer requires MADNESS serialization
devreal Nov 12, 2024
079b694
Fix usage of smart-pointer for buffers
devreal Nov 12, 2024
659746e
Bring back Buffer::reset(n) needed for serialization
devreal Nov 13, 2024
42d041f
Remove exception from empty_allocator::deallocate()
devreal Nov 13, 2024
1295bac
Fix serialization and remove split metadata from MatrixTile
devreal Nov 15, 2024
bcde59a
Rename BufferInspectorArchive to BufferVisitorArchive
devreal Nov 15, 2024
1bf4b11
Bump PaRSEC commit sha to point to a branch with parsec_data_discard()
devreal Nov 15, 2024
671024f
Fix usage of Allocator in MatrixTile
devreal Nov 18, 2024
0429c7e
Bring back scopes on Buffer construction
devreal Nov 18, 2024
281fec3
Buffer: handle constness in connection with smart pointers
devreal Nov 18, 2024
1effdc1
Add missing parsec_data.h to install list
devreal Nov 19, 2024
5e7d765
Buffer: in-place construct data_copy_type in construct callback
devreal Nov 19, 2024
04b67fd
Protect parsec data buffer inspection against empty buffers
devreal Nov 19, 2024
3e66f28
Add missing include in madness backend
devreal Dec 23, 2024
819be34
ParSEC: Templatize derived device ops check
devreal Dec 23, 2024
03cf233
Use smart pointer for buffer in device chain benchmark
devreal Dec 23, 2024
bf86552
Another attempt at fixing CRTP usage in device map setter
devreal Dec 23, 2024
32c8200
Fix chain device test by removing the non-move path
devreal Dec 23, 2024
36a0d23
SPMM: pass shared_ptr to buffer
devreal Jan 6, 2025
86f6124
Merge branch 'master' into serialize-buffer-query
devreal Jan 6, 2025
2b8fce9
Merge branch 'master' into serialize-buffer-query
devreal Jan 15, 2025
cf0347c
Default to MADNESS serialization with PaRSEC backend
devreal Jan 16, 2025
19f06b4
SPMM: Add madness serialization to DeviceTensor
devreal Jan 17, 2025
65a61f0
Comment out Boost::serialization dependency
devreal Jan 18, 2025
75b8a49
Condition serialization_boost-parsec on TTG_PARSEC_USE_BOOST_SERIALIZ…
devreal Jan 18, 2025
317bd7c
Don't install boost from apt/brew
devreal Jan 18, 2025
8df7142
Boost::type_index is required by the PaRSEC backend
devreal Jan 18, 2025
4ecf4e4
boost_iostreams install fails unless it's built via dependence on a p…
evaleev Jan 22, 2025
8186846
Revert "Comment out Boost::serialization dependency"
devreal Jan 22, 2025
b440287
CI: don't specify C++ standard
devreal Jan 22, 2025
87d0055
Remove use of Boost::typeindex
devreal Jan 22, 2025
4e6943b
More fun with Boost serialization
devreal Jan 22, 2025
914cc3d
Look for CUDA 12, not 12.6
devreal Jan 27, 2025
f44407c
PaRSEC: fix handling of Buffer::scope() for empty buffers
devreal Jan 29, 2025
b502ac8
PaRSEC: don't inline data in device tasks
devreal Jan 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,14 @@ jobs:
-DMPIEXEC_PREFLAGS='--bind-to;none;--allow-run-as-root'
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install
-DTTG_EXAMPLES=ON
-DCMAKE_CXX_STANDARD=20

steps:
- uses: actions/checkout@v4

- name: Install prerequisite MacOS packages
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew install ninja boost eigen open-mpi bison ccache
brew install ninja eigen open-mpi bison ccache
echo "MPIEXEC=/opt/homebrew/bin/mpiexec" >> $GITHUB_ENV

- name: Install prerequisites Ubuntu packages
Expand All @@ -59,7 +58,7 @@ jobs:
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main"
sudo apt-get update
sudo apt-get -y install ninja-build g++-12 liblapack-dev libboost-dev libboost-serialization-dev libboost-random-dev libeigen3-dev openmpi-bin libopenmpi-dev libtbb-dev ccache flex bison cmake doxygen
sudo apt-get -y install ninja-build g++-12 liblapack-dev libeigen3-dev openmpi-bin libopenmpi-dev libtbb-dev ccache flex bison cmake doxygen
echo "MPIEXEC=/usr/bin/mpiexec" >> $GITHUB_ENV

- name: Install extra dependencies
Expand All @@ -69,7 +68,7 @@ jobs:
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt update
sudo apt install -y cuda-toolkit
echo "CUDA_BUILD_OPTS=-DENABLE_CUDA=ON -DTTG_ENABLE_CUDA=ON -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-12.6 -DCMAKE_CUDA_COMPILER=/usr/local/cuda-12.6/bin/nvcc -DCMAKE_CUDA_HOST_COMPILER=${{ matrix.cxx }}" >> $GITHUB_ENV
echo "CUDA_BUILD_OPTS=-DENABLE_CUDA=ON -DTTG_ENABLE_CUDA=ON -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-12 -DCMAKE_CUDA_COMPILER=/usr/local/cuda-12/bin/nvcc -DCMAKE_CUDA_HOST_COMPILER=${{ matrix.cxx }}" >> $GITHUB_ENV

- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ set(CMAKE_INSTALL_CMAKEDIR "lib/cmake/ttg"
########################################
#### user-defined configuration options
########################################
option(TTG_PARSEC_USE_BOOST_SERIALIZATION "Whether to select Boost serialization methods in PaRSEC backend" ON)
option(TTG_PARSEC_USE_BOOST_SERIALIZATION "Whether to select Boost serialization methods in PaRSEC backend" OFF)
option(TTG_ENABLE_CUDA "Whether to TTG will look for CUDA" OFF)
option(TTG_ENABLE_HIP "Whether to TTG will look for HIP" OFF)
option(TTG_ENABLE_LEVEL_ZERO "Whether to TTG will look for Intel oneAPI Level Zero" OFF)
Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/ExternalDependenciesVersions.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# for each dependency track both current and previous id (the variable for the latter must contain PREVIOUS)
# to be able to auto-update them

set(TTG_TRACKED_VG_CMAKE_KIT_TAG 878654d0cb1904049fbd2c37b37d5385ae897658) # provides FindOrFetchLinalgPP and "real" FindOrFetchBoost
set(TTG_TRACKED_VG_CMAKE_KIT_TAG cda539db32be6e8171f5cbebdb1a7c38d5ab4b34) # provides FindOrFetchLinalgPP and "real" FindOrFetchBoost
set(TTG_TRACKED_CATCH2_VERSION 3.5.0)
set(TTG_TRACKED_MADNESS_TAG 93a9a5cec2a8fa87fba3afe8056607e6062a9058)
set(TTG_TRACKED_PARSEC_TAG 58f8f3089ecad2e8ee50e80a9586e05ce8873b1c)
set(TTG_TRACKED_PARSEC_TAG 996dda4c0ff3120bc65385f86e999befd4b3fe7a)
set(TTG_TRACKED_BTAS_TAG c25b0a11d2a76190bfb13fa72f9e9dc3e57c3c2f)
set(TTG_TRACKED_TILEDARRAY_TAG 5944bdba3266a3fa19f1809c8e2accf3dad4d815)

Expand Down
2 changes: 2 additions & 0 deletions cmake/modules/FindOrFetchBoost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ if (TTG_PARSEC_USE_BOOST_SERIALIZATION)
serialization
iostreams
)
else()
list(APPEND BOOST_EXCLUDE_LIBRARIES iostreams) # install of this library fails unless it's already built
endif()
if (BUILD_EXAMPLES)
list(APPEND optional_components
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/FindOrFetchPARSEC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (NOT TARGET PaRSEC::parsec)

FetchContent_Declare(
PARSEC
GIT_REPOSITORY https://github.com/ICLDisco/parsec.git
GIT_REPOSITORY https://github.com/devreal/parsec-1.git
GIT_TAG ${TTG_TRACKED_PARSEC_TAG}
)
FetchContent_MakeAvailable(PARSEC)
Expand Down
68 changes: 15 additions & 53 deletions examples/matrixtile.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ inline void allocator_fini() { }
template <typename T, class AllocatorT = Allocator<T>>
class MatrixTile : public ttg::TTValue<MatrixTile<T, AllocatorT>> {
public:
using metadata_t = typename std::tuple<std::size_t, std::size_t, std::size_t>;

using buffer_t = typename ttg::Buffer<T, AllocatorT>;
using ttvalue_type = ttg::TTValue<MatrixTile<T, AllocatorT>>;

Expand All @@ -62,6 +60,10 @@ class MatrixTile : public ttg::TTValue<MatrixTile<T, AllocatorT>> {
#endif // DEBUG_TILES_VALUES
}

struct non_owning_deleter {
void operator()(T* ptr) { }
};

public:
MatrixTile() {}

Expand All @@ -73,19 +75,13 @@ class MatrixTile : public ttg::TTValue<MatrixTile<T, AllocatorT>> {
, _lda(lda)
{ }

MatrixTile(const metadata_t& metadata)
: MatrixTile(std::get<0>(metadata), std::get<1>(metadata), std::get<2>(metadata)) {}

MatrixTile(const metadata_t& metadata, T* data)
: MatrixTile(std::get<0>(metadata), std::get<1>(metadata), std::forward(data), std::get<2>(metadata)) {}

/**
* Constructor with outside memory. The tile will *not* delete this memory
* upon destruction.
*/
MatrixTile(std::size_t rows, std::size_t cols, T* data, std::size_t lda)
: ttvalue_type()
, _buffer(data, lda*cols)
, _buffer(std::unique_ptr<T[], non_owning_deleter>(data, non_owning_deleter{}), lda*cols)
, _rows(rows)
, _cols(cols)
, _lda(lda)
Expand Down Expand Up @@ -121,15 +117,6 @@ class MatrixTile : public ttg::TTValue<MatrixTile<T, AllocatorT>> {
return *this;
}

void set_metadata(metadata_t meta) {
_rows = std::get<0>(meta);
_cols = std::get<1>(meta);
_lda = std::get<2>(meta);
this->realloc();
}

metadata_t get_metadata(void) const { return metadata_t{_rows, _cols, _lda}; }

// Accessing the raw data
T* data() { return _buffer.host_ptr(); }

Expand Down Expand Up @@ -187,46 +174,21 @@ class MatrixTile : public ttg::TTValue<MatrixTile<T, AllocatorT>> {
o << " } ";
return o;
}
};

namespace ttg {

template <typename T>
struct SplitMetadataDescriptor<MatrixTile<T>> {
auto get_metadata(const MatrixTile<T>& t) { return t.get_metadata(); }

auto get_data(MatrixTile<T>& t) { return std::array<iovec, 1>({t.size() * sizeof(T), t.data()}); }

auto create_from_metadata(const typename MatrixTile<T>::metadata_t& meta) { return MatrixTile<T>(meta); }
};
template<typename Archive>
void serialize(Archive& ar, const unsigned int version) {
serialize(ar);
}

} // namespace ttg
template<typename Archive>
void serialize(Archive& ar) {
ar & _rows & _cols & _lda;
ar & buffer();
}
};

#ifdef TTG_SERIALIZATION_SUPPORTS_MADNESS
namespace madness {
namespace archive {
template <class Archive, typename T>
struct ArchiveStoreImpl<Archive, MatrixTile<T>> {
static inline void store(const Archive& ar, const MatrixTile<T>& tile) {
ar << tile.rows() << tile.cols() << tile.lda();
ar << wrap(tile.data(), tile.rows() * tile.cols());
}
};

template <class Archive, typename T>
struct ArchiveLoadImpl<Archive, MatrixTile<T>> {
static inline void load(const Archive& ar, MatrixTile<T>& tile) {
std::size_t rows, cols, lda;
ar >> rows >> cols >> lda;
tile = MatrixTile<T>(rows, cols, lda);
ar >> wrap(tile.data(), tile.rows() * tile.cols()); // MatrixTile<T>(bm.rows(), bm.cols());
}
};
} // namespace archive
} // namespace madness

static_assert(madness::is_serializable_v<madness::archive::BufferOutputArchive, MatrixTile<float>>);

#endif // TTG_SERIALIZATION_SUPPORTS_MADNESS

#endif // TTG_EXAMPLES_MATRIX_TILE_H
2 changes: 0 additions & 2 deletions examples/potrf/testing_dlauum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ int main(int argc, char **argv)
int P = std::sqrt(world.size());
int Q = (world.size() + P - 1)/P;

static_assert(ttg::has_split_metadata<MatrixTile<double>>::value);

std::cout << "Creating 2D block cyclic matrix with NB " << NB << " N " << N << " M " << M << " P " << P << std::endl;

parsec_matrix_sym_block_cyclic_t dcA;
Expand Down
2 changes: 0 additions & 2 deletions examples/potrf/testing_dpoinv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ int main(int argc, char **argv)
Q = (world.size() + P - 1)/P;
}

static_assert(ttg::has_split_metadata<MatrixTile<double>>::value);

if(verbose) {
std::cout << "Creating 2D block cyclic matrix with NB " << NB << " N " << N << " M " << M << " P " << P << std::endl;
}
Expand Down
2 changes: 0 additions & 2 deletions examples/potrf/testing_dpotrf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ int main(int argc, char **argv)
check = false;
}

static_assert(ttg::has_split_metadata<MatrixTile<double>>::value);

if (world.rank() == 0) {
std::cout << "Creating 2D block cyclic matrix with NB " << NB << " N " << N << " M " << M << " P " << P << " Q " << Q << std::endl;
}
Expand Down
2 changes: 0 additions & 2 deletions examples/potrf/testing_dtrtri.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ int main(int argc, char **argv)
check = false;
}

static_assert(ttg::has_split_metadata<MatrixTile<double>>::value);

std::cout << "Creating 2D block cyclic matrix with NB " << NB << " N " << N << " M " << M << " P " << P << std::endl;

parsec_matrix_sym_block_cyclic_t dcA;
Expand Down
Loading