|
1 | 1 |
|
2 | | -(A) |
3 | | -I have something else that would be useful for someone to do. I don't anymore want the function "CopyToMat", that copies from CUDA to regular matrix, to exist. I want the "CopyFromMat" function of Matrix to have this functionality. (it already exists but just calls CopyToMat; the implementation should be put directly in CopyFromMat, and the implementation should be done in cu-matrix.cc even though it's a member-function of MatrixBase<Real>.). The same change should be done in the other classes, e.g. vector, spmatrix, packedmatrix, tpmatrix, if applicable. Make sure the whole Kaldi project compiles and tests. |
4 | | - |
5 | | -CopyToMat was originally introduced because I didn't want the Matrix classes to "know about" the cudamatrix/ directory, for dependency reasons, but I got around the problem by putting forward declarations of the Cu* classes in the matrix/ dir, and declaring the corresponding methods in the Matrix dir but implementing them in cudamatrix/. So now there is no need for CopyToMat. |
| 2 | +- To Matrix and CuMatrix, add a function |
6 | 3 |
|
| 4 | +(A) |
| 5 | + Need to improve the efficiency of |
| 6 | + (i) TraceMatMat (for CuMatrix) |
| 7 | + (ii) CuMatrix::AddDiagMatMat |
| 8 | + (iii) CuVector::Sum(); |
7 | 9 |
|
8 | 10 | (B) |
| 11 | + |
| 12 | + // Make a matrix symmetric by either copying the lower to upper triangle |
| 13 | + // copying upper to lower, taking the mean, or taking the mean and checking |
| 14 | + // it was already almost symmetric. You can test it by making sure that |
| 15 | + // it behaves the same as the SpMatrix CopyFromMat function, e.g. first |
| 16 | + // calling Symmetrize with a particular argument "t" and then creating an SpMatrix |
| 17 | + // from the matrix with kTakeMeanAndCheck, should give the same result as |
| 18 | + // initializing the SpMatrix with the original matrix and "t". kTakeMeanAndCheck |
| 19 | + // means set to the mean, but check they were approximately equal; see the SpMatrix |
| 20 | + // code for how to implement it (in fact, the code can be based on the same code |
| 21 | + // in SpMatrix::CopyFrommat). |
| 22 | + void Symmetrize(SpCopyType symmetrize_type); |
| 23 | + |
| 24 | + // This function should call dsymm (it can, arbitrarily, add to the lower triangle), |
| 25 | + // and then Symmetrize(kTakeLower). Before calling dsymm we should check that |
| 26 | + // the original matrix is approximately symmetric: we can do #ifdef KALDI_PARANOID, |
| 27 | + // Symmetrize(kTakeMeanAndCheck). #endif. |
| 28 | + void SymmetricAddMatMat(Real alpha, const Matrix<Real> &A, MatrixTransposeType transA, |
| 29 | + const Matrix<Real> &B, MatrixTransposeType transB, Real beta); |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | +(C) |
9 | 35 | The functions in CuMath.h that say "this needs documentation" need documentation |
10 | 36 | (i.e. comments saying what the functions do). Someone would need to look at |
11 | 37 | the code and figure out what the functions do (it's not my code). Please look |
|
0 commit comments