Skip to main content

https://github.com/zasdfgbnm/autonvtx

Project description

Install

pip install autonvtx

Usage

Write your model as usual and autonvtx(model) to your model:

import torch
import autonvtx

class Model(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.layer1 = torch.nn.Linear(5, 5)
        self.layer2 = torch.nn.Linear(5, 5)
    def forward(self, x):
        x = self.layer1(x)
        x = self.layer2(x)
        return x

m = Model().cuda()
autonvtx(m)
input_ = torch.randn(1024, 5, device='cuda')

torch.cuda.profiler.start()
for _ in range(10):
    output = m(input_)
torch.cuda.profiler.stop()

The screenshot for this would be:

Screenshot 1

It also works with existing models:

import torch
import torchvision
import autonvtx

m = torchvision.models.resnet50()
autonvtx(m)
input_ = torch.randn(10, 3, 224, 224)

torch.cuda.profiler.start()
for _ in range(10):
    output = m(input_)
torch.cuda.profiler.stop()

The screenshot for this would be:

Screenshot 2

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autonvtx-0.1.linux-x86_64.tar.gz (2.0 kB view hashes)

Uploaded source

Built Distribution

autonvtx-0.1-py3-none-any.whl (2.7 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page