Discussion:
[eigen] Searchable "issues" repository
a***@fitzgibbon.ie
2018-04-05 14:54:29 UTC
Permalink
It's great to see discussions like the MKL sparse one below, but may I make a meta-point that it would be very valuable to have it in an "issues" format, as is available on github e.g. https://github.com/JuliaLang/julia/issues/9147

Is it an option to do this for Eigen? Would it be [another] prod towards moving to github?


-----Original Message-----
From: Edward Lam <***@sidefx.com>
Sent: 05 April 2018 14:32
To: ***@lists.tuxfamily.org
Subject: Re: [eigen] Intel (R) MKL IE SpBLAS support in Eigen


Would it be useful to incorporate lambda's into the interface to avoid begin/end pairs? So from the user side, we would write code like this instead:

1) Analyze and run

SimplicialLDLT<MklSparseMatrix<double>> llt(A);
int it = 0;
for (int it = 0; ...; ++it) {
if (it == 0)
llt.matrixL().sparseAnalyzeAndRun(100, [&] { llt.solve(b); });
else
llt.solve(b);
// ...
}

2) Analyze only

SimplicialLDLT<MklSparseMatrix<double>> llt(A);
llt.matrixL().sparseAnalyze(100, [&] { llt.solve(b); });
// and solve as usual

For more complicated algorithms, one can always outline the lambda and pass it into the analysis.

Cheers,
-Edward
Thank you for opening this discussion on the public mailing list.
So let's discuss about the public API, which currently is not very
(i1) - Storing MKL's handle in SparseMatrix breaks ABI and does not
sounds very generic.
(i2) - which operations are going to be analyzed/optimized,
(i3) - and specify the 'expected_calls' parameter.
(e.g., non-linear optimization, eigenvalues, ...)
SimplicialLDLT<SparseMatrix<double> > llt(A);
while(...) {
...
x = llt.solve(b);
...
}
Here the triangular L factor is going to be used for triangular and
transposed-triangular solves dozens to hundreds of time but only the
user of SimplicialLDLT knowns that, not SimplicialLDLT, nor
SparseMatrix. Moreover, the user does not own the SparseMatrix that we
want to analyze/optimize for. Other patterns are likely easier to handle, so let's focus on it for now.
Regarding (i1), I would suggest to introduce a new type, say
MklSparseMatrix<> that would enhance SparseMatrix<> through
MklSparseMatrix::beginAnalysis(Index expected_calls) const { // turn
*this to compressed mode // create handle // store expected_calls //
enable recording mode }
MklSparseMatrix::endAnalysis() const { // disable recording mode //
[optional] call mkl_sparse_optimize }
All states in MklSparseMatrix would be mutable.
Between a pair of beginAnalysis/endAnalysis each call to a supported
operation would trigger calls to mkl_sparse_set_*_hint()/mkl_sparse_optimize.
Optionally, we could even add a "dryrun" mode for which no operation
would be performed, only calls to mkl_sparse_set_*_hint() and then
mkl_sparse_optimize would be called in endAnalysis(). This way
mkl_sparse_optimize() would be called only once.
SimplicialLDLT<MklSparseMatrix<double> > llt(A); int it=0;
while(...) {
...
if(it==0) llt.matrixL().beginAnalysis(100); x = llt.solve(b);
if(it==0) llt.matrixL().endAnalysis(); ...
++it;
}
SimplicialLDLT<MklSparseMatrix<double> > llt(A);
llt.matrixL().beginAnalysis(100, DryRun); x = llt.solve(b); //
permutation and division by the diagonal matrix D would still be
performed, but calls to actual triangular solves would be by-passed
llt.matrixL().endAnalysis();
while(...) {
...
x = llt.solve(b);
...
}
If someone directly deal with the factor L, then we could follow the
SimplicialLLT<SparseMatrix<double> > llt(A);
MklSparseMatrix L(llt.matrixL());
L.beginAnalysis(100,DryRun);
y = L.triangularView<Lower>() * x;
L.endAnalysis();
while(...) {
...
y = L.triangularView<Lower>() * x;
...
}
This design in quite general and expendable to any sparse-optimizers,
even built-in ones in the future.
In contrast to the current proposal, only selected operations would be
passed to MKL (need to use a MklSparseMatrix + begin/end recording phase).
What do you think?
gael
On Tue, Apr 3, 2018 at 11:39 PM, Zhukova, Maria
Hello Eigen community,
My name is Maria Zhukova and I’m a software development engineer at Intel ®
MKL Sparse team.
My team is interested in contributing into Eigen, so I’ve investigated our
Eigen support different operations for sparse matrices stored in CSR and CSC
format which can be implemented on a basis of IE SpBLAS kernels (please,
refer to
https://software.intel.com/en-us/mkl-developer-reference-c-inspector-executor-sparse-blas-routines
<https://software.intel.com/en-us/mkl-developer-reference-c-inspector-executor-sparse-blas-routines>
for the general idea of interfaces)
, basically we want to implement calls to our IE SpBLAS into next
operations:____
SparseMatrix + SparseMatrix (mkl_sparse_?_add)
SparseMatrix * DenseVector (mkl_sparse_?_mv)____
SparseMatrix * DenseMatrix
(mkl_sparse_?_mm)____
SparseMatrix * SparseMatrix (mkl_sparse_spmm),
and Triangular solve (mkl_sparse_?_trsv).____
I’ve already started with implementation of sparse_time_dense_impl_mkl
kernel which is based on mkl_sparse_?_mv (included in patch).____
*#include <Eigen/SpBLASSupport> *<-- *NEW:* IE SpBLAS include
module ____
void main () {
SparseMatrix<double, RowMajor> A;
Matrix<double, Dynamic, 1> x, y;
A.makeCompressed(); /* Convert matrix A into CSR/CSC format */
*A.createSparseHandle();*/* *NEW*: is used to create handle required for all
IE SpBLAS routines */____
// support of IE SpBLAS is here
y = beta*y + alpha*A*x; /* call to mkl_sparse_?_mv with operation =
SPARSE_OPERATION_NON_TRANSPOSE */
y = beta*y + alpha*A.transpose()*x; /* call to mkl_sparse_?_mv with
operation = SPARSE_OPERATION_TRANSPOSE */
y = beta*y + alpha*A.adjoint()*x; /* call to mkl_sparse_?_mv with operation
= SPARSE_OPERATION_CONJUGATE_TRANSPOSE */____
*A.destroySparseHandle();* /* *NEW*: is used to delete created handle */
}____
__ __
I’ve attached a draft patch including all necessary changes and would like
to hear your feedback.
Please, let me know if you have any questions and comments.____
__ __
Best regards,
Maria____
__ __
__ __
__ __
Christoph Hertzberg
2018-04-05 19:38:26 UTC
Permalink
Post by a***@fitzgibbon.ie
It's great to see discussions like the MKL sparse one below, but may I make a meta-point that it would be very valuable to have it in an "issues" format, as is available on github e.g. https://github.com/JuliaLang/julia/issues/9147
Is it an option to do this for Eigen? Would it be [another] prod towards moving to github?
Maybe even some kind of database which prioritizes and categorizes bugs
and allows to express dependencies between bugs, like this:

http://eigen.tuxfamily.org/bz/

I agree though that it is always difficult to decide when discussions
should be made on the mailing list, and when they are too specific and
should be made on bugzilla. Maybe the SparseMKL feature request would be
worth moving to bugzilla.

OTOH, there is not that much traffic on this mailing list anyway,
besides a lengthy discussion from time to time ...


Cheers,
Christoph
--
Dr.-Ing. Christoph Hertzberg

Besuchsadresse der Nebengeschäftsstelle:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany

Postadresse der Hauptgeschäftsstelle Standort Bremen:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 1
28359 Bremen, Germany

Tel.: +49 421 178 45-4021
Zentrale: +49 421 178 45-0
E-Mail: ***@dfki.de

Weitere Informationen: http://www.dfki.de/robotik
-----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
(Vorsitzender) Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
USt-Id.Nr.: DE 148646973
Steuernummer: 19/672/50006
-----------------------------------------------------------------------
a***@fitzgibbon.ie
2018-04-05 19:48:24 UTC
Permalink
I know, it's a very friendly list, and I like having it in my inbox 😊

But you know... it's a bit... not very modern, nor is bugzilla. And I'm an old guy...

And it feels like it's been a while since anyone suggested moving the project to github, so, er: should we move to github? [takes cover]


-----Original Message-----
From: Christoph Hertzberg <***@informatik.uni-bremen.de>
Sent: 05 April 2018 20:38
To: ***@lists.tuxfamily.org
Subject: Re: [eigen] Searchable "issues" repository
Post by a***@fitzgibbon.ie
It's great to see discussions like the MKL sparse one below, but may I
make a meta-point that it would be very valuable to have it in an
"issues" format, as is available on github e.g.
https://github.com/JuliaLang/julia/issues/9147
Is it an option to do this for Eigen? Would it be [another] prod towards moving to github?
Maybe even some kind of database which prioritizes and categorizes bugs and allows to express dependencies between bugs, like this:

http://eigen.tuxfamily.org/bz/

I agree though that it is always difficult to decide when discussions should be made on the mailing list, and when they are too specific and should be made on bugzilla. Maybe the SparseMKL feature request would be worth moving to bugzilla.

OTOH, there is not that much traffic on this mailing list anyway, besides a lengthy discussion from time to time ...


Cheers,
Christoph
--
Dr.-Ing. Christoph Hertzberg

Besuchsadresse der Nebengeschäftsstelle:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany

Postadresse der Hauptgeschäftsstelle Standort Bremen:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 1
28359 Bremen, Germany

Tel.: +49 421 178 45-4021
Zentrale: +49 421 178 45-0
E-Mail: ***@dfki.de

Weitere Informationen: http://www.dfki.de/robotik
-----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
(Vorsitzender) Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
USt-Id.Nr.: DE 148646973
Steuernummer: 19/672/50006
-----------------------------------------------------------------------
Christoph Hertzberg
2018-04-05 21:21:31 UTC
Permalink
Post by a***@fitzgibbon.ie
I know, it's a very friendly list, and I like having it in my inbox 😊
But you know... it's a bit... not very modern, nor is bugzilla. And I'm an old guy...
And it feels like it's been a while since anyone suggested moving the project to github, so, er: should we move to github? [takes cover]
At least we do have an official github mirror for some time now :)
https://github.com/eigenteam/eigen-git-mirror/

IMO, the main difference between mercurial/bitbucket and git/github is a
question of convenience (way more people use the latter today). There
aren't really big functional differences. Issues on bitbucket were
disabled many years ago, because back at the time they lacked too many
features (which is why the bugzilla-tracker was started).
And if I remember correctly, mercurial was chosen instead of git,
because when Eigen migrated from subversion, svn2git failed to properly
import the repository at that time (I was not active in
Eigen-development at that time, though).

I think the biggest "issue" with migrating to github now would be to
migrate all the "issues" from bugzilla (and keep all existing
attachments, links, subscriptions, etc).

Just some historical context, I don't intend to start any religion wars,
Christoph
Post by a***@fitzgibbon.ie
-----Original Message-----
Sent: 05 April 2018 20:38
Subject: Re: [eigen] Searchable "issues" repository
Post by a***@fitzgibbon.ie
It's great to see discussions like the MKL sparse one below, but may I
make a meta-point that it would be very valuable to have it in an
"issues" format, as is available on github e.g.
https://github.com/JuliaLang/julia/issues/9147
Is it an option to do this for Eigen? Would it be [another] prod towards moving to github?
http://eigen.tuxfamily.org/bz/
I agree though that it is always difficult to decide when discussions should be made on the mailing list, and when they are too specific and should be made on bugzilla. Maybe the SparseMKL feature request would be worth moving to bugzilla.
OTOH, there is not that much traffic on this mailing list anyway, besides a lengthy discussion from time to time ...
Cheers,
Christoph
--
Dr.-Ing. Christoph Hertzberg

Besuchsadresse der Nebengeschäftsstelle:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany

Postadresse der Hauptgeschäftsstelle Standort Bremen:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 1
28359 Bremen, Germany

Tel.: +49 421 178 45-4021
Zentrale: +49 421 178 45-0
E-Mail: ***@dfki.de

Weitere Informationen: http://www.dfki.de/robotik
-----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
(Vorsitzender) Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
USt-Id.Nr.: DE 148646973
Steuernummer: 19/672/50006
-----------------------------------------------------------------------
Peter
2018-04-05 20:17:26 UTC
Permalink
Dear All,
Post by a***@fitzgibbon.ie
OTOH, there is not that much traffic on this mailing list anyway, besides a lengthy discussion from time to time ...
in addition, even those lengthy discussions are often valuable and interesting to read.
I'm pretty sure I would miss them, if I don't get them pushed in my inbox.

Best regards,
Peter
Gael Guennebaud
2018-04-05 21:05:37 UTC
Permalink
On Thu, Apr 5, 2018 at 9:38 PM, Christoph Hertzberg <
Post by Christoph Hertzberg
I agree though that it is always difficult to decide when discussions
should be made on the mailing list, and when they are too specific and
should be made on bugzilla. Maybe the SparseMKL feature request would be
worth moving to bugzilla.
bugzilla is good to discuss bugs, patches, and implementation details, but
only Christoph, myself, and the author of the issue will follow the
discussion. So when it's about the design of the public API, I think it is
better to have a larger audience.

gael
Loading...