Skip to content

Instantly share code, notes, and snippets.

@XinDongol
XinDongol / profile_pyt.md
Last active March 28, 2022 11:26
How to profile your pytorch codes

Inside profiler

import torch
import torchvision.models as models

model = models.densenet121(pretrained=True)
x = torch.randn((1, 3, 224, 224), requires_grad=True)

with torch.autograd.profiler.profile(use_cuda=True) as prof:
    model(x)
@wangruohui
wangruohui / Install NVIDIA Driver and CUDA.md
Last active February 20, 2025 01:42
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS