mmdeploy icon indicating copy to clipboard operation
mmdeploy copied to clipboard

Why is mmdeploy much faster than mmseg

Open jyang68sh opened this issue 2 years ago • 9 comments

Hi I appreciate your great work! I have utilized mmdeploy for grid sampler for my model.

However, when I do inference speed test. For STDC2, on mmseg I got FPS around 170. On mmdeply, I got FPS around 300.

They have the same config file, same weights, and same resolution.

Could anyone explain to me? Thanks

jyang68sh avatar Aug 04 '22 03:08 jyang68sh

How do you test a model with mmseg?

If you use tools/test.py or test/profile.py to test a model on mmdeply, it only count the model inference time, preprocess and postprocess` are not take into account.  

irexyc avatar Aug 04 '22 06:08 irexyc

Hi. I used mmseg tools/benchmark.py to get the speed with mmseg.

For mmdeploy, I used tools/test.py --speed-test option to get the speed.

I think both scripts only counts the model inference time. That's why I am confused.

jyang68sh avatar Aug 04 '22 06:08 jyang68sh

Could you post your test command?

lvhan028 avatar Aug 05 '22 02:08 lvhan028

Could you post your test command?

Sure.

CUDA_VISIBLE_DEVICES=2 python tools/test.py xspace/1_apps/mmdeploy/configs/mmseg/segmentation_tensorrt_static-512x1024.py xspace/work_dirs/stdc2_cityscapes/stdc2_512x1024_80k_cityscapes.py --model xspace/work_dirs/stdc2_standards/end2end.engine --speed-test

@lvhan028

Thanks!

jyang68sh avatar Aug 05 '22 02:08 jyang68sh

@lvhan028 Sorry to bother. Is there any updates?

jyang68sh avatar Aug 08 '22 10:08 jyang68sh

@jyang68sh
Sorry for late reply, the difference is mainly due to the different backend (pytorch vs tensorrt).

I test this config on 2070s.

With benchmark.py, the qps is 53.90. If we set rescale to False, the qps will be 66.3 For test.py in mmdeploy, my test result is 101.37.

irexyc avatar Aug 18 '22 04:08 irexyc

@jyang68sh Sorry for late reply, the difference is mainly due to the different backend (pytorch vs tensorrt).

I test this config on 2070s.

With benchmark.py, the qps is 53.90. If we set rescale to False, the qps will be 66.3 For test.py in mmdeploy, my test result is 101.37.

@irexyc Thanks for your reply. I will verify this config on my end and give you a feedback. Thanks!

jyang68sh avatar Aug 18 '22 05:08 jyang68sh

Hi, @jyang68sh Is there any update?

lvhan028 avatar Aug 25 '22 01:08 lvhan028

Hi, @jyang68sh Is there any update?

Hi, Sorry for the late reply.

my machine was used for another series of experiments. I will have an update once the experiments were finished.

jyang68sh avatar Aug 25 '22 04:08 jyang68sh