You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/08/01 20:22:06 UTC

[GitHub] nswamy closed pull request #11863: Reduced test to 3 epochs and made gpu only

nswamy closed pull request #11863: Reduced test to 3 epochs and made gpu only
URL: https://github.com/apache/incubator-mxnet/pull/11863
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/scala-package/examples/src/test/scala/org/apache/mxnetexamples/multitask/MultiTaskSuite.scala b/scala-package/examples/src/test/scala/org/apache/mxnetexamples/multitask/MultiTaskSuite.scala
index dab97701909..b86f6751e45 100644
--- a/scala-package/examples/src/test/scala/org/apache/mxnetexamples/multitask/MultiTaskSuite.scala
+++ b/scala-package/examples/src/test/scala/org/apache/mxnetexamples/multitask/MultiTaskSuite.scala
@@ -44,21 +44,24 @@ import scala.collection.mutable.{ArrayBuffer, ListBuffer}
   * This will run as a part of "make scalatest"
   */
 class MultiTaskSuite extends FunSuite {
-
   test("Multitask Test") {
     val logger = LoggerFactory.getLogger(classOf[MultiTaskSuite])
-    logger.info("Multitask Test...")
+    if (System.getenv().containsKey("SCALA_TEST_ON_GPU") &&
+      System.getenv("SCALA_TEST_ON_GPU").toInt == 1) {
+      logger.info("Multitask Test...")
 
-    val batchSize = 100
-    val numEpoch = 10
-    val ctx = Context.cpu()
+      val batchSize = 100
+      val numEpoch = 3
+      val ctx = Context.gpu()
 
-    val modelPath = ExampleMultiTask.getTrainingData
-    val (executor, evalMetric) = ExampleMultiTask.train(batchSize, numEpoch, ctx, modelPath)
-    evalMetric.get.foreach { case (name, value) =>
-      assert(value >= 0.95f)
+      val modelPath = ExampleMultiTask.getTrainingData
+      val (executor, evalMetric) = ExampleMultiTask.train(batchSize, numEpoch, ctx, modelPath)
+      evalMetric.get.foreach { case (name, value) =>
+        assert(value >= 0.95f)
+      }
+      executor.dispose()
+    } else {
+      logger.info("GPU test only, skipped...")
     }
-    executor.dispose()
   }
-
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services