小编Tux*_*uxa的帖子

pytorch 中的推理时间和 TFLOPS

我目前正在研究使用 torch.autograd.profiler 使用两个不同 GPU 的不同 CNN 模型的半精度推理时间

  • Nvidia RTX 2080 Ti ( 26.90 TFLOPS ) - 在本地完成(更好的 CPU)
  • Nvidia T4 ( 65.13 TFLOPS ) - 在云端完成

令我惊讶的是 2080 Ti明显更快(时间的一半或更短),与批量大小、输入分辨率和架构无关,尽管它的 TFLOPS不到一半

有谁知道为什么?

import torch
import segmentation_models_pytorch as smp # pip install git+https://github.com/qubvel/segmentation_models.pytorch

runs = 10
res = 512
bs = 8
is_half = True

m = smp.Unet(encoder_name='resnet101', encoder_weights=None)
m.eval()
m.cuda()
m.half()

t = torch.rand((bs, 3, res, res)).cuda()
t = t.half()

if is_half:
    m.half() …
Run Code Online (Sandbox Code Playgroud)

profiler gpu inference pytorch

5
推荐指数
0
解决办法
457
查看次数

标签 统计

gpu ×1

inference ×1

profiler ×1

pytorch ×1