DeepLearning.scala
DeepLearning.scala copied to clipboard
Wrong result in nd4j's CUDA backend
Upstream bug https://github.com/deeplearning4j/nd4j/issues/2271
You can reproduce this bug in NaN-fix branch:
git clone https://github.com/ThoughtWorksInc/DeepLearning.scala.git --branch NaN-fix
cd DeepLearning.scala
sbt plugins-INDArrayLayers/testOnly com.thoughtworks.deeplearning.plugins.NaNSpec
The workaround is using single thread only:
import java.util.concurrent.Executors
import scala.concurrent.ExecutionContext
val singleThreadExecutor = Executors.newSingleThreadExecutor()
implicit val singleThreadExecutionContext = ExecutionContext.fromExecutor(singleThreadExecutor)
// Don't import the default ExecutionContext!
// import scala.concurrent.ExecutionContext.Implicits.global