deepspeedai / deepspeedai/DeepSpeed
[BUG] mutil optimizer param group
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 43.1k
- Forks
- 5k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 112
Description
hello, when I use zero2 to train model, I find if I split optimizer‘s params to 2 groups
params = {'params': []}
for module_ in model.modules():
params['params'].extend(
[p for n, p in list(module_._parameters.items())
if p is not None and n != 'bias'])
param_count = len(params['params'])
first_half = params['params'][:param_count // 2]
second_half = params['params'][param_count // 2:]
first_half = {'params': first_half}
second_half = {'params': second_half}
optimizer = torch.optim.AdamW(params=[first_half, second_half])
and I will get different gradients on the condition that the same input、the same weight and the loss comparing with not doing this
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided ZeRO-2 reproduction with the optimizer parameters in one group and then in two groups, using the same input, weights, and loss. Compare the resulting gradients and trace the optimizer parameter-group handling to identify where they diverge. Done means the gradient discrepancy is resolved or its cause is isolated with a focused regression 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
- 25/100