mahout-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (MAHOUT-1837) Sparse/Dense Matrix analysis for Matrix Multiplication
Date Fri, 26 Aug 2016 01:06:21 GMT


ASF GitHub Bot commented on MAHOUT-1837:

GitHub user andrewpalumbo opened a pull request:

    MAHOUT-1837: Fixed dense bug in drm/package.blockify()

    Create a `SparseRowMatrix` by default in order to keep `OOM` errors from occurring in
`blockify()` per conversation  in:
 run `densityAnalysis()` on that and convert to dense if requirements are met.

You can merge this pull request into a Git repository by running:

    $ git pull MAHOUT-1837-dense-bug

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #252
commit 5d2f5cc9746f968d0c776f869070dd9a439de9f1
Author: Andrew Palumbo <>
Date:   2016-08-26T00:58:57Z

    fixed dense bug in drm/package.blockify()


> Sparse/Dense Matrix analysis for Matrix Multiplication
> ------------------------------------------------------
>                 Key: MAHOUT-1837
>                 URL:
>             Project: Mahout
>          Issue Type: Improvement
>          Components: Math
>    Affects Versions: 0.12.0
>            Reporter: Andrew Palumbo
>            Assignee: Andrew Palumbo
>             Fix For: 0.13.0
>         Attachments: compareDensityTest.ods
> In matrix multiplication, Sparse Matrices can easily turn dense and bloat memory,  one
fully dense column and one fully dense row can cause a sparse %*% sparse operation have a
dense result.  
> There are two issues here one with a quick Fix and one a bit more involved:
>    #  in {{ABt.Scala}} use check the `MatrixFlavor` of the combiner and use the flavor
of the Block as the resulting Sparse or Dense matrix type:
> {code}
> val comb = if (block.getFlavor == MatrixFlavor.SPARSELIKE) {
>               new SparseMatrix(prodNCol, block.nrow).t
>             } else {
>               new DenseMatrix(prodNCol, block.nrow).t
>             }
> {code}
>  a simlar check needs to be made in the {{blockify}} transformation.
>    #  More importantly, and more involved is to do an actual analysis of the resulting
matrix data in the in-core {{mmul}} class and use a matrix of the appropriate Structure as
a result. 

This message was sent by Atlassian JIRA

View raw message