You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by "Andrew Palumbo (JIRA)" <ji...@apache.org> on 2017/03/26 04:15:42 UTC

[jira] [Updated] (MAHOUT-1960) Flipped sign in the SparseSparseDrmTimer.mscala causes Desnse Matrix multiplication

     [ https://issues.apache.org/jira/browse/MAHOUT-1960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Palumbo updated MAHOUT-1960:
-----------------------------------
    Description: 
In {{SparseSparseDrmTimer.mscala}} with the signature: 


 def timeSparseDRMMMul(m: Int, n: Int, s: Int, para: Int, pctDense: Double = .20, seed: Long = 1234L): Long = {


the {{pctDense}} argument indicates the percent of nonZero elements in the matrix. 

As is the code to produce a random DRM for testing is as follows:
{code}
  val drmA = drmParallelizeEmpty(m , s, para).mapBlock(){
       case (keys,block:Matrix) =>
         val R =  scala.util.Random
         R.setSeed(seed)
         val blockB = new SparseRowMatrix(block.nrow, block.ncol) 
         blockB := {x => if (R.nextDouble > pctDense) R.nextDouble else x }
       (keys -> blockB)
}
{code}
The greater than sign in line:

    blockB := {x => if (R.nextDouble > pctDense) R.nextDouble else x } 

should be a less than sign; i.e.:

     blockB := {x => if (R.nextDouble < pctDense) R.nextDouble else x } 

This incorrect sign produces matrices of Incorrect density and can cause OOM errors.
 

  was:
In {{SparseSparseDrmTimer.mscala}} with the signature: 
{code}
 def timeSparseDRMMMul(m: Int, n: Int, s: Int, para: Int, pctDense: Double = .20, seed: Long = 1234L): Long = {
{code}
the {{pctDense}} argument indicates the percent of nonZero elements in the matrix. 

As is the code to produce a random DRM for testing is as follows:

{code}
  val drmA = drmParallelizeEmpty(m , s, para).mapBlock(){
       case (keys,block:Matrix) =>
         val R =  scala.util.Random
         R.setSeed(seed)
         val blockB = new SparseRowMatrix(block.nrow, block.ncol) 
         blockB := {x => if (R.nextDouble > pctDense) R.nextDouble else x }
       (keys -> blockB)
}
{code)

The greater than sign in line:
{code}
         blockB := {x => if (R.nextDouble > pctDense) R.nextDouble else x }
{code}

 should be less than; i.e.:
{code}
         blockB := {x => if (R.nextDouble < pctDense) R.nextDouble else x }
{code}

This incorrect sign produces matrices of Incorrect density and can cause OOM errors.
 


> Flipped sign in the SparseSparseDrmTimer.mscala causes Desnse Matrix multiplication
> -----------------------------------------------------------------------------------
>
>                 Key: MAHOUT-1960
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-1960
>             Project: Mahout
>          Issue Type: Bug
>    Affects Versions: 0.13.0
>            Reporter: Andrew Palumbo
>            Assignee: Andrew Palumbo
>            Priority: Blocker
>             Fix For: 0.13.0
>
>
> In {{SparseSparseDrmTimer.mscala}} with the signature: 
>  def timeSparseDRMMMul(m: Int, n: Int, s: Int, para: Int, pctDense: Double = .20, seed: Long = 1234L): Long = {
> the {{pctDense}} argument indicates the percent of nonZero elements in the matrix. 
> As is the code to produce a random DRM for testing is as follows:
> {code}
>   val drmA = drmParallelizeEmpty(m , s, para).mapBlock(){
>        case (keys,block:Matrix) =>
>          val R =  scala.util.Random
>          R.setSeed(seed)
>          val blockB = new SparseRowMatrix(block.nrow, block.ncol) 
>          blockB := {x => if (R.nextDouble > pctDense) R.nextDouble else x }
>        (keys -> blockB)
> }
> {code}
> The greater than sign in line:
>     blockB := {x => if (R.nextDouble > pctDense) R.nextDouble else x } 
> should be a less than sign; i.e.:
>      blockB := {x => if (R.nextDouble < pctDense) R.nextDouble else x } 
> This incorrect sign produces matrices of Incorrect density and can cause OOM errors.
>  



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)