-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[MXNET-1249] Fix Object Detector Performance with GPU #13522
Conversation
@@ -94,13 +94,13 @@ class ObjectDetector(modelPathPrefix: String, | |||
def objectDetectWithNDArray(input: IndexedSeq[NDArray], topK: Option[Int]) | |||
: IndexedSeq[IndexedSeq[(String, Array[Float])]] = { | |||
|
|||
val predictResult = predictor.predictWithNDArray(input)(0) | |||
val predictResult = predictor.predictWithNDArray(input)(0).asInContext(Context.cpu()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, can we apply this to ImageClassifier
class as well ?
Maybe this can provide a speed boost there as well ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same nitpick I had on imageclassifier. A comment explaining this wouldn't hurt since it's not obvious why we're doing this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok to me. 💯 🥇
Please also add comments where you are the parArray. That's a nice optimization that might not be very obvious while reading the code :)
scala-package/infer/src/main/scala/org/apache/mxnet/infer/Classifier.scala
Show resolved
Hide resolved
@@ -94,13 +94,13 @@ class ObjectDetector(modelPathPrefix: String, | |||
def objectDetectWithNDArray(input: IndexedSeq[NDArray], topK: Option[Int]) | |||
: IndexedSeq[IndexedSeq[(String, Array[Float])]] = { | |||
|
|||
val predictResult = predictor.predictWithNDArray(input)(0) | |||
val predictResult = predictor.predictWithNDArray(input)(0).asInContext(Context.cpu()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same nitpick I had on imageclassifier. A comment explaining this wouldn't hurt since it's not obvious why we're doing this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…icense file" (#13558) * Revert "Chi_square_check for discrete distribution fix (#13543)" This reverts commit cf6e8cb. * Revert "Updated docs for randint operator (#13541)" This reverts commit e0ff3c3. * Revert "Simplifications and some fun stuff for the MNIST Gluon tutorial (#13094)" This reverts commit 8bbac82. * Revert "Fix #13521 (#13537)" This reverts commit f6b4665. * Revert "Add a retry to qemu_provision (#13551)" This reverts commit f6f8401. * Revert "[MXNET-769] Use MXNET_HOME in a tempdir in windows to prevent access denied due t… (#13531)" This reverts commit bd8e0f8. * Revert "[MXNET-1249] Fix Object Detector Performance with GPU (#13522)" This reverts commit 1c8972c. * Revert "Fixing a 404 in the ubuntu setup doc (#13542)" This reverts commit cb0db29. * Revert "Bumped minor version from 1.4.0 to 1.5.0 on master, updated License file (#13478)" This reverts commit 40db619.
* Reduce post processing time * fix ssd * fix the CI * add comments
…icense file" (apache#13558) * Revert "Chi_square_check for discrete distribution fix (apache#13543)" This reverts commit cf6e8cb. * Revert "Updated docs for randint operator (apache#13541)" This reverts commit e0ff3c3. * Revert "Simplifications and some fun stuff for the MNIST Gluon tutorial (apache#13094)" This reverts commit 8bbac82. * Revert "Fix apache#13521 (apache#13537)" This reverts commit f6b4665. * Revert "Add a retry to qemu_provision (apache#13551)" This reverts commit f6f8401. * Revert "[MXNET-769] Use MXNET_HOME in a tempdir in windows to prevent access denied due t… (apache#13531)" This reverts commit bd8e0f8. * Revert "[MXNET-1249] Fix Object Detector Performance with GPU (apache#13522)" This reverts commit 1c8972c. * Revert "Fixing a 404 in the ubuntu setup doc (apache#13542)" This reverts commit cb0db29. * Revert "Bumped minor version from 1.4.0 to 1.5.0 on master, updated License file (apache#13478)" This reverts commit 40db619.
Description
Found Object Detector contains performance problem with GPU which is slower than CPU. The root cause is the long time taken in the post-processing.
@piyushghai @andrewfayres @zachgk
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.