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/06/15 22:12:18 UTC

[GitHub] lanking520 commented on a change in pull request #11294: [MXNET-543][WIP]Scala Spark test

lanking520 commented on a change in pull request #11294: [MXNET-543][WIP]Scala Spark test
URL: https://github.com/apache/incubator-mxnet/pull/11294#discussion_r195873656
 
 

 ##########
 File path: scala-package/spark/src/test/scala/org/apache/mxnet/spark/MXNetGeneralSuite.scala
 ##########
 @@ -42,30 +44,38 @@ class MXNetGeneralSuite extends SharedSparkContext {
   }
 
   private def downloadTestData(): Unit = {
+    logger.info("Downloading the training data...")
     Process("wget http://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon" +
       "/dataset/mxnet-spark-test/train.txt" + " -P " + testDataDir + " -q") !
   }
 
-//  override def beforeAll(): Unit = {
-//  val tempDirFile = Files.createTempDirectory(s"mxnet-spark-test-${System.currentTimeMillis()}").
-//      toFile
-//    testDataDir = tempDirFile.getPath
-//    tempDirFile.deleteOnExit()
-//    downloadTestData()
-//  }
+  override def beforeAll(): Unit = {
+  val tempDirFile = Files.createTempDirectory(s"mxnet-spark-test-${System.currentTimeMillis()}").
+      toFile
+    testDataDir = tempDirFile.getPath
+    tempDirFile.deleteOnExit()
+    downloadTestData()
+  }
 
-  test("Dummy test on Spark") {
+  test("run spark with MLP") {
+    if (System.getenv().containsKey("SCALA_TEST_ON_GPU") &&
+      System.getenv("SCALA_TEST_ON_GPU").toInt == 1) {
+      val trainData = parseRawData(sc, s"$testDataDir/train.txt")
+      val model = buildMlp().fit(trainData)
+      assert(model != null)
+    } else {
+      logger.info("Currently not supporting CPU, skipped for now")
+    }
+  }
 
+  test("run spark with LeNet") {
+    if (System.getenv().containsKey("SCALA_TEST_ON_GPU") &&
 
 Review comment:
   Nope, GPU do have an issue

----------------------------------------------------------------
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