-
Hi, I trained the same model as the original model and only changed the datasets. When I test it On GPU, the test time of my model is similar to that of the original model, however, the time of my model tested On CPU is very larger than that of the original model. Why? |
Beta Was this translation helpful? Give feedback.
Replies: 18 comments
-
Hey, this is the MXNet Label Bot. |
Beta Was this translation helpful? Give feedback.
-
@mxnet-label-bot add [Question] |
Beta Was this translation helpful? Give feedback.
-
@xianyujie did you install the package of mxnet-cuXXmkl? http://mxnet.incubator.apache.org/versions/master/faq/perf.html#intel-cpu |
Beta Was this translation helpful? Give feedback.
-
@pengzhao-intel the mkl build brings great performance to both models, but the issue still exits. |
Beta Was this translation helpful? Give feedback.
-
Could you share the log or reproducible case for us? |
Beta Was this translation helpful? Give feedback.
-
Here, I tested the run time of different network layers on one image, I found that the problem occurred in most of the conv2_weight layers. |
Beta Was this translation helpful? Give feedback.
-
I don't find too much useful information from the log. |
Beta Was this translation helpful? Give feedback.
-
@pengzhao-intel Can you find out what the problem is? ===================The shape of the input image is (1,3,112,112)==================== |
Beta Was this translation helpful? Give feedback.
-
It makes sense because your input image size is about 10X in both H and W direction from 12 to 112. I suggest you change to MKLDNN build for the start point. |
Beta Was this translation helpful? Give feedback.
-
@pengzhao-intel I think you misunderstood the result. Take a look at the following results, different inputs have a great influence on the operation time of convolution layer, What could be the reason for this result? same image as input, get the output(pre_output1,pre_output2) from stage1_unit1_relu1 layer |
Beta Was this translation helpful? Give feedback.
-
Got it. It's interesting that the runtime is very different. Does the result of your models is correct? |
Beta Was this translation helpful? Give feedback.
-
@pengzhao-intel Yeah, I've tested it many times. Here is my test file link: |
Beta Was this translation helpful? Give feedback.
-
I've saved the pre_output1, the pre_output2, the conv1_weight, and the conv2_weight into the param file, and reload them to test. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the data and I can reproduce your issue now. Debugging now and will back to you soon.
|
Beta Was this translation helpful? Give feedback.
-
After the analysis, I think the problem is the input data is underflow so the computation is very slow.
|
Beta Was this translation helpful? Give feedback.
-
many thx, but the input data is obtained from the real data through many layers, and the results of all the real pictures are the same as above, so maybe the minimal calculation result is directly equal to 0? |
Beta Was this translation helpful? Give feedback.
-
Make sense. I will contact the MKL-DNN team and see if any improvement can be done. In a short time, please try to set the very small value to 0 :( |
Beta Was this translation helpful? Give feedback.
-
After I set the minimum value to 0, the test results of the two models are the same. same image as input, get the output(pre_output1,pre_output2) from stage1_unit1_relu1 layer |
Beta Was this translation helpful? Give feedback.
After I set the minimum value to 0, the test results of the two models are the same.
same image as input, get the output(pre_output1,pre_output2) from stage1_unit1_relu1 layer
of the two models.Then test the time of Conv layer, pre_output1 as the input of my model,
pre_output2 as the input of original model.
(0.004521, 0.004521)
The pre_output1 as the input of the two models, test the time of Conv layer
(0.004198, 0.004238)
The pre_output2 as the input of the two models, test the time of Conv layer
(0.004196, 0.004184)