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

doEvaluation should employ MemoryWorkspace for the output INDArray #6279

Closed
stolsvik opened this issue Aug 26, 2018 · 3 comments · Fixed by #6295
Closed

doEvaluation should employ MemoryWorkspace for the output INDArray #6279

stolsvik opened this issue Aug 26, 2018 · 3 comments · Fixed by #6295

Comments

@stolsvik
Copy link

I had problems running out of memory during evaluation. Turns out that a standard FF network explicitly does not use a workspace in doEvaluation when creating the output INDArray and then invoking evaluation.eval(..) - that is, the outputOfLayerDetached has the outputWorkspace set to null. This leads this the resulting INDArray to be "garbage-collector scoped", and I could by running watch on nvidia-smi see the memory building up (being consumed) while running through a quite large test dataset - and then getting a memory exception (since the GC didn't run during the entire loop).

By reimplementing the doEvaluation and invoking System.gc() in the loop, I avoided this, and getting zero buildup of memory - but obviously got a massive performance hit.

However, by instead reimplementing doEvaluation to employ a Memory WS, giving the ws to the outputOfLayerDetached (but still scopeOutOfWorkspaces(..) when invoking ROC.eval(..)), I got zero build-up of memory during that loop, and without any performance hit.

@AlexDBlack AlexDBlack self-assigned this Aug 27, 2018
@AlexDBlack
Copy link
Contributor

Yes, thanks for flagging, we definitely need to add this.
We might need "output in specified workspace" for RNN timestep too, for the split timeseries evaluation case.

@AlexDBlack AlexDBlack added this to the DL4J/Arbiter/DataVec Next Steps milestone Aug 27, 2018
@AlexDBlack
Copy link
Contributor

Thanks for the issue - added here: #6295
Should be merged soon.

AlexDBlack added a commit that referenced this issue Aug 29, 2018
* #6283 Fix BaseDatasetIterator (MnistDataSetIterator) with specified numExamples

* Test condition fix

* #6279 MultiLayerNetwork.doEvaluation output array workspace use

* #6279 ComputationGraph.doEvaluation output array workspace use

* One round of URL javadoc fixes
@lock
Copy link

lock bot commented Sep 28, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Sep 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants