zhanghang1989 / zhanghang1989/PyTorch-Encoding

Does encoding support multi-task losses?

Open
#235 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2k
Forks
448
PR merge metrics
No merged PRs in 30d

Description

@zhanghang1989, Hi, thanks for your nice work. Does encoding support multi-task losses? When using a single GPU, my model returns a dictionary with each key/value indicating a specific task loss.
I tried the encoding.parallel.DataParallelModel, and the return is a list of dictionary. The length of the list is equal to the number of devices. Then I apply torch.nn.parallel._functions.Gather to the output list to integrate the losses from different devices in a unified GPU device. But the experimental results are not good as thetorch.nn.DataParallelwith the same batchsize.
So Is there something I missed?

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 by inspecting encoding.parallel.DataParallelModel and the mentioned torch.nn.parallel._functions.Gather path, then compare their handling of dictionary-valued multi-task losses with torch.nn.DataParallel. Reproduce the single-GPU and multi-GPU cases described in the issue; done means the behavior is explained and any required support or limitation is covered by a verified test.

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
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.