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

Frequent zero consumption for nvidia device #17

Open
nikhil153 opened this issue Mar 8, 2021 · 0 comments
Open

Frequent zero consumption for nvidia device #17

nikhil153 opened this issue Mar 8, 2021 · 0 comments

Comments

@nikhil153
Copy link

I am monitoring energy consumption of a pytorch model. I am sampling several times during training loop with EnergyContext and record (code snippet below). I am noticing that there are more than half samples showing zero consumption. See attached partial log.
joules_sample.log

Any ideas?

for i, (images, labels) in enumerate(train_loader):
    # get the inputs; data is a list of [inputs, labels]
    images = images.to(device)
    labels = labels.to(device)
  
    # zero the parameter gradients
    optimizer.zero_grad()
  
    # Monitor joules sparingly
    if (i % monitor_interval) == (monitor_interval-1):
        if monitor_joules:
            # pyjoules
            with EnergyContext(handler=pd_handler, start_tag='forward') as ctx:
                # forward + backward + optimize
                outputs = model(images)
                ctx.record(tag='loss')
                loss = criterion(outputs, labels)
                ctx.record(tag='backward')  
                loss.backward()
                ctx.record(tag='step')
                optimizer.step()
                ctx.record(tag='overhead')
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

1 participant