NVIDIA / NVIDIA/apex

make autograd.grad at DDP model

Open
#457 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
9k
Forks
1.5k
Avg merge
2d 4h
Merged PRs (30d)
3

Description

Can I use torch.autograd.grad between loss and apex DDP model.parameters during training(after wrapping the model with DDP)?

I'm working on implement gradNorm on apex DDP model.
For that, I need to get a gradient between loss and model parameters each iteration.

When I use multi-GPU, my code is stuck at the time when it accesses model parameter.
I'm not sure it is caused by accessing model parameter or autograd.
At using single GPU, everything is working fine except training time. :)

If autograd is not working with apex DDP model (same as torch DDP),
Or if is there any way to using autograd between loss and model parameter during training time,
Please let me know, Thanks.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no source file or test. Start by reproducing the multi-GPU hang with torch.autograd.grad on an apex DDP model and model.parameters, then inspect the apex DDP entry point and compare it with single-GPU behavior. Done means identifying whether parameter access or autograd causes the hang and documenting a confirmed compatible approach or a reproducible failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
distributed-systems, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.