Interfacing Ginkgo with Eigen and slow performance of gko::read #1731
-
Hi together, I'm using Ginkgo to solve very large complex sparse non-hermitian linear systems. Saving the matrices in the python script is quite fast (~3s for A), but reading them through
is insanely slow (~ 70s for A). Also reading b and writing the result are not really fast. Therefore, the majority of the computation time is consumed by I/O operations done by ginkgo. So my general question is: How can I accelerate reading large sparse matrices from disk? I employ Ginkgo in an iterative optimization setting, where I am aiming to replace the current MAGMA-based implementation. Ginkgo is indeed faster (and offers Multi-GPU for sparse matrices), but the I/O seems to make it infeasible...
Afterwards I convert the Eigen matrix into a MAGMA matrix:
This process is fast. However, I cannot manage to convert the Eigen matrix into a ginkgo matrix. Any help on how to accelerate gko::read or how to make Eigen and Ginkgo able to talk to each other would be very much appreciated. Best, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @marco-butz. Thanks for bringing up the subpar IO performance. The project you linked looks interesting. We will investigate, if it makes sense for us to also use it. auto row_ptrs_view = gko::make_array_view(exec, A.rows(), A.outerIndexPtr());
auto col_idxs = gko::make_array_view(exec, <nnz of A>, A.innerIndexPtr());
auto vals = gko::make_array_view(exec, <nnz of A>, A.valuePtr());
auto mtx = gko::matrix::Csr<ValueType>::create(exec, gko::dim<2>{A.rows(), A.cols()}, row_ptrs, col_idxs, vals); Please take note that if the data of |
Beta Was this translation helpful? Give feedback.
Hi @marco-butz. Thanks for bringing up the subpar IO performance. The project you linked looks interesting. We will investigate, if it makes sense for us to also use it.
Regarding using Eigen matrices in Ginkgo, could you specify the issues you ran into? From the snippet that you showed, it should be possible to transfer this directly to Ginkgo.
Here is how I would do that, assuming that
A.outerIndexPtr
gives the row-pointers andA.innerIndexPtr
the column indices: