NVIDIA / NVIDIA/apex

amp does not work with model parallel

Open
#670 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

Background:
In my problem, I need to compute the cost over the whole global batch, i.e., the batch-correlated cost instead of the average of sample-independent losses (like L1), for example, the negative linear correlation loss in regression problems.

I am not familiar with distributed learning, and I do not know how to implement my code to compute the batch-correlated cost instead of computing them separately on each device.

Problem:
So I turned to model parallel. Then I got the following error:

RuntimeError: Expected tensor for argument #1 'input' to have the same device as tensor for argument #2 'weight'; but device 15 does not equal 14 (while checking arguments for cudnn_convolution)

So is there any way for using both amp and model parallel?
Or is there any simple way to compute the batch-correlated cost in the distributed training?

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

Start with the PyTorch model parallel tutorial linked in the issue and reproduce the reported cudnn_convolution device-mismatch error when using AMP. A useful resolution would establish whether AMP supports model parallel here and clarify a supported approach for computing the global batch-correlated cost, or document the limitation.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.