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

ND4J/SameDiff: ND4JIllegalStateException "argument uses outdated workspace pointer" in SameDiff graph used in a ComputationGraph #7120

Closed
SchmaR opened this issue Feb 6, 2019 · 2 comments

Comments

@SchmaR
Copy link

SchmaR commented Feb 6, 2019

Issue Description

Hi,
I'm on the current snapshot build and get an ND4JIllegalStateException when I fit a ComputationGraph which contains a loss function which is written using SameDiff. I create one SameDiff graph and want to reuse it for every iteration by passing the new values via placeholders into it.

Here is a test setup which causes the exception: https://gist.github.com/SchmaR/e4d697a2ca4309bef2a2e80a05771523
Here is a "minimal example" of the loss function: https://gist.github.com/SchmaR/c8577e9e546e63b5263f43a27ba3f7a1

Stacktrace
Exception in thread "main" org.nd4j.linalg.exception.ND4JIllegalStateException: Op [add] X argument uses outdated workspace pointer from workspace [WS_LAYER_WORKING_MEM]
All open workspaces: [WS_LAYER_WORKING_MEM, test, WS_ALL_LAYERS_ACT]
For more details, see the ND4J User Guide: nd4j.org/userguide#workspaces-panic
    at org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner.checkWorkspace(DefaultOpExecutioner.java:286)
    at org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner.checkForWorkspaces(DefaultOpExecutioner.java:296)
    at org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner.profilingHookIn(DefaultOpExecutioner.java:356)
    at org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.exec(NativeOpExecutioner.java:1585)
    at org.nd4j.autodiff.samediff.internal.InferenceSession.getOutputs(InferenceSession.java:371)
    at org.nd4j.autodiff.samediff.internal.InferenceSession.getOutputs(InferenceSession.java:28)
    at org.nd4j.autodiff.samediff.internal.AbstractSession.output(AbstractSession.java:244)
    at org.nd4j.autodiff.samediff.SameDiff.exec(SameDiff.java:10433)
    at org.nd4j.autodiff.samediff.SameDiff.execAll(SameDiff.java:10398)

Version Information

Please indicate relevant versions, including, if relevant:

  • Deeplearning4j version: nd4j-api-1.0.0-20190131.150707-14381
  • platform information: Ubuntu 18.10, 64 Bit, Intel I7
  • CUDA version
  • NVIDIA driver version

Contributing

If I can help to figure out what's going wrong let me know.

Aha! Link: https://skymindai.aha.io/features/ND4J-82

@AlexDBlack
Copy link
Contributor

Thanks for reporting and for the code to reproduce the issue.
The problem was that SameDiff wasn't properly set up to work when executing in an external workspace (which is the case when executing inside a DL4J layer or ILossFunction for example).
That has been resolved here: #7124
The fix should be available in snapshots in a few hours.

@lock
Copy link

lock bot commented Mar 9, 2019

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 Mar 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants