DeepLearning.scala icon indicating copy to clipboard operation
DeepLearning.scala copied to clipboard

Wrong result in nd4j's CUDA backend

Open Atry opened this issue 8 years ago • 2 comments

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

Atry avatar Nov 16 '17 08:11 Atry

nd4j-bug.log

Atry avatar Nov 16 '17 08:11 Atry

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

Atry avatar Nov 16 '17 08:11 Atry