Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libtorch性能问题调研 #30

Open
gemfield opened this issue Apr 7, 2021 · 4 comments
Open

libtorch性能问题调研 #30

gemfield opened this issue Apr 7, 2021 · 4 comments

Comments

@gemfield
Copy link
Contributor

gemfield commented Apr 7, 2021

测试步骤和方法

使用https://zhuanlan.zhihu.com/p/363319763 中的:

  • "PyTorch resnet50 benchmark步骤"
  • "LibTorch resnet50 benchmark步骤"

注意:MLab HomePod 1.0中的PyTorch版本为1.8.1

测试模型:resnet50

环境

宿主机OS:Ubuntu 20.04
软件环境:MLab HomePod 1.0
CPU:Intel(R) Core(TM) i9-9820X CPU @ 3.30GHz
GPU:NVIDIA GTX 2080ti
GPU驱动:NVIDIA-SMI 450.102.04 Driver Version: 450.102.04 CUDA Version: 11.0

测试场景 CPU利用率 内存(GB) GPU利用率 显存(GB) 线程数
C++ libtorch ~105% ~4.1 100% ~3.7 25
PyTorch ~132% ~3.9 ~95% ~9 32

input shape = 224x224

测试场景 forward time(ms)
C++ libtorch 3.950
PyTorch 6.4478

input shape = 640x640

测试场景 forward time(ms)
C++ libtorch 11.242
PyTorch 10.4656

input shape = 1280x720

测试场景 forward time(ms)
C++ libtorch 24.678
PyTorch 20.8056

input shape = 1280x1280

测试场景 forward time(ms)
C++ libtorch 38.094
PyTorch 37.6037
@gemfield
Copy link
Contributor Author

gemfield commented Apr 7, 2021

测试模型:retinaface(backbone: resnet50)

环境

宿主机OS:Ubuntu 20.04
软件环境:MLab HomePod 1.0
CPU:Intel(R) Core(TM) i9-9820X CPU @ 3.30GHz
GPU:NVIDIA GTX 2080ti
GPU驱动:NVIDIA-SMI 450.102.04 Driver Version: 450.102.04 CUDA Version: 11.0

测试场景 CPU利用率 内存(GB) GPU利用率 显存(GB) 线程数
C++ libtorch ~105% ~4.1 100% ~3.8 25
PyTorch ~170% ~4.1 ~99% ~10 32

input shape = 224x224

测试场景 forward time(ms)
C++ libtorch 6.640
PyTorch 11.3491

input shape = 640x640

测试场景 forward time(ms)
C++ libtorch 16.899
PyTorch 13.5242

input shape = 1280x720

测试场景 forward time(ms)
C++ libtorch 33.532
PyTorch 24.9352

input shape = 1280x1280

测试场景 forward time(ms)
C++ libtorch 50.001
PyTorch 44.2599

@DeepVAC DeepVAC deleted a comment from buptlihang Apr 13, 2021
@gemfield
Copy link
Contributor Author

测试模型:ResNet50 CPU

环境

宿主机OS:Ubuntu 20.04
软件环境:MLab HomePod 1.0
CPU:Intel(R) Core(TM) i9-9820X CPU @ 3.30GHz
RAM: 64G

测试场景 CPU利用率 内存(GB) 线程数
C++ libtorch ~1001% ~5.5 32
PyTorch ~978% ~11.3 32

input shape = 224x224

测试场景 forward time(ms)
C++ libtorch 26.988
PyTorch 40.2075

input shape = 640x640

测试场景 forward time(ms)
C++ libtorch 167.991
PyTorch 231.1375

input shape = 1280x720

测试场景 forward time(ms)
C++ libtorch 419.165
PyTorch 520.6793

input shape = 1280x1280

测试场景 forward time(ms)
C++ libtorch 862.972
PyTorch 1014.6398

@liweizheng0528
Copy link

请问你的libtorch和cuda版本是多少,我在ubuntu20.04+libtorch1.9.0+cuda11.1上torch::cuda::is_available()返回false,是什么原因呢?

@atztao
Copy link

atztao commented Apr 8, 2022

这个库的大小大该占多少空间

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants