You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Sean Owen (JIRA)" <ji...@apache.org> on 2019/01/21 01:30:00 UTC

[jira] [Commented] (SPARK-26228) OOM issue encountered when computing Gramian matrix

    [ https://issues.apache.org/jira/browse/SPARK-26228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16747603#comment-16747603 ] 

Sean Owen commented on SPARK-26228:
-----------------------------------

Yep this is a real problem. The issue is the 'zeroValue" to treeAggregate. It allocates a huge dense matrix of 0s, which must then be serialized several times. This includes a simple check to see if it's serializable, which serializes with JavaSerializer, and at some point that takes so much memory that more than 2GB of bytes are needed somewhere in a ByteArrayOutputStream and it fails. It won't matter how much memory the driver has.

I think the fix is easy; the zero value should just be null, and the seqOp and combOp can easily handle this situation. At least, I tried it locally and it works fine, and doesn't fail upfront at about a 16000x16000 Gramian. It ought to be faster too.

> OOM issue encountered when computing Gramian matrix 
> ----------------------------------------------------
>
>                 Key: SPARK-26228
>                 URL: https://issues.apache.org/jira/browse/SPARK-26228
>             Project: Spark
>          Issue Type: Improvement
>          Components: MLlib
>    Affects Versions: 2.3.0
>            Reporter: Chen Lin
>            Priority: Major
>         Attachments: 1.jpeg
>
>
> {quote}/**
>  * Computes the Gramian matrix `A^T A`.
>   *
>  * @note This cannot be computed on matrices with more than 65535 columns.
>   */
> {quote}
> As the above annotation of computeGramianMatrix in RowMatrix.scala said, it supports computing on matrices with no more than 65535 columns.
> However, we find that it will throw OOM(Request Array Size Exceeds VM Limit) when computing on matrices with 16000 columns.
> The root casue seems that the TreeAggregate writes a  very long buffer array (16000*16000*8) which exceeds jvm limit(2^31 - 1).
> Does RowMatrix really supports computing on matrices with no more than 65535 columns?
> I doubt that computeGramianMatrix has a very serious performance issue.
> Do anyone has done some performance expriments before?
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org