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/11/15 01:09:38 UTC

[GitHub] nswamy closed pull request #13258: Java Benchmark failure

nswamy closed pull request #13258: Java Benchmark failure
URL: https://github.com/apache/incubator-mxnet/pull/13258
 
 
   

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/.gitignore b/scala-package/.gitignore
index 0f860e62836..6aa4da6b1cf 100644
--- a/scala-package/.gitignore
+++ b/scala-package/.gitignore
@@ -1,5 +1,8 @@
 .flattened-pom.xml
 core/src/main/scala/org/apache/mxnet/NDArrayAPIBase.scala
 core/src/main/scala/org/apache/mxnet/NDArrayBase.scala
+core/src/main/scala/org/apache/mxnet/javaapi/NDArrayBase.scala
 core/src/main/scala/org/apache/mxnet/SymbolAPIBase.scala
 core/src/main/scala/org/apache/mxnet/SymbolBase.scala
+examples/scripts/infer/images/
+examples/scripts/infer/models/
diff --git a/scala-package/examples/src/main/java/org/apache/mxnetexamples/javaapi/benchmark/JavaBenchmark.java b/scala-package/examples/src/main/java/org/apache/mxnetexamples/javaapi/benchmark/JavaBenchmark.java
index 2fd9fd5f7cb..4a6bb2dd38b 100644
--- a/scala-package/examples/src/main/java/org/apache/mxnetexamples/javaapi/benchmark/JavaBenchmark.java
+++ b/scala-package/examples/src/main/java/org/apache/mxnetexamples/javaapi/benchmark/JavaBenchmark.java
@@ -67,7 +67,7 @@ private static void printStatistics(long[] inferenceTimesRaw, String metricsPref
 
     }
 
-    private static List<Context> getContext()  {
+    private static List<Context> bindToDevice()  {
         List<Context> context = new ArrayList<Context>();
         if (System.getenv().containsKey("SCALA_TEST_ON_GPU") &&
                 Integer.valueOf(System.getenv("SCALA_TEST_ON_GPU")) == 1) {
@@ -101,14 +101,7 @@ public static void main(String[] args) {
                 System.err.println("Model name not found! " + modelName);
                 System.exit(1);
         }
-        List<Context> context = getContext();
-        if (System.getenv().containsKey("SCALA_TEST_ON_GPU") &&
-                Integer.valueOf(System.getenv("SCALA_TEST_ON_GPU")) == 1) {
-            context.add(Context.gpu());
-        } else {
-            context.add(Context.cpu());
-        }
-
+        List<Context> context = bindToDevice();
         long[] result = new long[model.numRun];
         model.preProcessModel(context);
         if (runBatch) {


 

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