GitHub user mpjlu opened a pull request:

    [SPARK-21624]optimzie RF communicaiton cost

    ## What changes were proposed in this pull request?
    The implementation of RF is bound by either the cost of statistics 
computation on workers or by communicating the sufficient statistics.
    This PR will focus on optimizing communication cost.
    The statistics are stored in allStats:
    `  private var allStats: Array[Double] = new Array[Double](allStatsSize)`
    In real use case, the size of allStats is very large, and it can be very 
sparse, especially on the nodes that near the leave of the tree. 
    It is better to change allStats from Array to SparseVector before shufffle.
    My tests show the communication is down by about **50% to 90%** with this 
    Test cases: 
    1000 features * 200Bins* 2 label, 
    1000 features * 50Bins * 2label
    10000 features * 200Bins * 2 label
    featureSubsetStrategy: auto, 0.2, 0.1
    All test cases with the config: spark.shuffle.compress=true.
    ## How was this patch tested?
    The exist UT

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

    $ git pull optRFcomm

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 #18904
commit 35d1f244f918bd8ea7fe7fdf10796a64e7a62fc9
Author: Peng Meng <>
Date:   2017-08-10T07:19:59Z

    optimzie RF communicaiton cost


If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to