Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-18612][MLLIB] Delete broadcasted variable in LBFGS CostFun #16040

Closed

Conversation

AnthonyTruchet
Copy link

What changes were proposed in this pull request?

Fix a broadcasted variable leak occurring at each invocation of CostFun in L-BFGS.

How was this patch tested?

UTests + check that fixed fatal memory consumption on Criteo's use cases.

This contribution is made on behalf of Criteo S.A.
(http://labs.criteo.com/) under the terms of the Apache v2 License.

This contribution is made on behalf of Criteo S.A.
(http://labs.criteo.com/) under the terms of the Apache v2 License.
Copy link
Member

@srowen srowen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, would be good if you can look for similar instances and fix them in one pass here.

@srowen
Copy link
Member

srowen commented Nov 28, 2016

Jenkins test this please

@AnthonyTruchet
Copy link
Author

Agreed, and we might also consider making the broadcasted variable compatible with some Automatic Resource Management to avoid such leak (like https://github.com/jsuereth/scala-arm).

@srowen
Copy link
Member

srowen commented Nov 28, 2016

If that's just a Scala version of try-with-resources, it is unfortunately insufficient. It's not clear when the broadcast is actually no longer used because it may be used in computations that are computed lazily, or recomputed when something fails. Here the scope of the broadcast is clear though.

@SparkQA
Copy link

SparkQA commented Nov 28, 2016

Test build #69251 has finished for PR 16040 at commit 7aa7976.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@srowen
Copy link
Member

srowen commented Nov 30, 2016

Merged to master/2.1

@asfgit asfgit closed this in c5a64d7 Nov 30, 2016
asfgit pushed a commit that referenced this pull request Nov 30, 2016
## What changes were proposed in this pull request?

Fix a broadcasted variable leak occurring at each invocation of CostFun in L-BFGS.

## How was this patch tested?

UTests + check that fixed fatal memory consumption on Criteo's use cases.

This contribution is made on behalf of Criteo S.A.
(http://labs.criteo.com/) under the terms of the Apache v2 License.

Author: Anthony Truchet <[email protected]>

Closes #16040 from AnthonyTruchet/SPARK-18612-lbfgs-cost-fun.

(cherry picked from commit c5a64d7)
Signed-off-by: Sean Owen <[email protected]>
@AnthonyTruchet AnthonyTruchet deleted the SPARK-18612-lbfgs-cost-fun branch November 30, 2016 13:27
robert3005 pushed a commit to palantir/spark that referenced this pull request Dec 2, 2016
## What changes were proposed in this pull request?

Fix a broadcasted variable leak occurring at each invocation of CostFun in L-BFGS.

## How was this patch tested?

UTests + check that fixed fatal memory consumption on Criteo's use cases.

This contribution is made on behalf of Criteo S.A.
(http://labs.criteo.com/) under the terms of the Apache v2 License.

Author: Anthony Truchet <[email protected]>

Closes apache#16040 from AnthonyTruchet/SPARK-18612-lbfgs-cost-fun.
uzadude pushed a commit to uzadude/spark that referenced this pull request Jan 27, 2017
## What changes were proposed in this pull request?

Fix a broadcasted variable leak occurring at each invocation of CostFun in L-BFGS.

## How was this patch tested?

UTests + check that fixed fatal memory consumption on Criteo's use cases.

This contribution is made on behalf of Criteo S.A.
(http://labs.criteo.com/) under the terms of the Apache v2 License.

Author: Anthony Truchet <[email protected]>

Closes apache#16040 from AnthonyTruchet/SPARK-18612-lbfgs-cost-fun.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants