-
Notifications
You must be signed in to change notification settings - Fork 6.8k
FeedForward.scala and NDArrayIter.scala leak memory by not disposing of NDArrays #10436
Comments
Any chance of having this issue bumped up? This bug renders training via Scala impossible in many cases and could be problematic for large batch decoding/inference. |
Thanks for your message! We are currently working on a draft proposal to solve this issue and send to the devlist. The disposing method currently brings a great inconvenience to users. In the past, we tried to place that into finalizer stage and it sometimes crash for unknown reasons. Will follow up with this thread with our progress. |
Great! Looking forward to it and happy to help test and/or review. |
* Fixes Scala memory leak (apache#10436) * Replaced the copy and disposed of sliced ndArray to resolve memory leak * Wrapped disposes in a finally to ensure they are called.
* Fixes Scala memory leak (apache#10436) * Replaced the copy and disposed of sliced ndArray to resolve memory leak * Wrapped disposes in a finally to ensure they are called.
* Fixes Scala memory leak (apache#10436)
Memory leak was a result of the FeedForward predict method not properly disposing of two NDArrays. This was fixed in the PR above. Issue can be closed. @nswamy |
* Fixes Scala memory leak (apache#10436)
Can this issue be closed? @milandesai @wellner |
@sandeep-krishnamurthy Please close this issue as PRs with fixes have been submitted. @milandesai @wellner Please feel free to reopen the issue if you see it again. |
Description
FeedForward.scala and NDArrayIter.scala leak memory by not disposing of NDArrays. We see the below leak warnings occur running on MXNet 1.1.0. Additionally, there is no clean way of disposing a FeedForward and its contents.
Version
MXNet 1.1.0
Error Message:
The culprit appears to be FeedForward.scala:233 and NDArrayIter:163. Additionally, it would be nice to to provide a method that disposes of a FeedForward; i.e. it disposes the symbol, executor, and aux/arg params.
The text was updated successfully, but these errors were encountered: