deepspeedai / deepspeedai/DeepSpeed
[BUG]clip gradient not working
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 43.1k
- Forks
- 5k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 112
Description
Describe the bug
Hello, I used accelerate+deepspeed zero3 for distributed grpo training with 8 A800.
For clipping gradient: I set max_grad_norm=1.0 in training arguments and set gradient_clipping=1.0 in deepspeed3.yaml.
When training, many of the printed grad_norm values are greater than 1.0。
It seems that the above parameters do not work.
Expected behavior
I think the grad_norm values should be less than max_grad_norm (or gradient_clipping)
System info (please complete the following information):
trl 0.16.0
deepspeed 0.15.4
accelerate 0.34.0
pytorch 2.5.1
transformers 0.49.0
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 reproducing the report with the listed TRL, DeepSpeed, Accelerate, PyTorch, and Transformers versions using ZeRO-3 and the two clipping settings. Compare the printed grad_norm values with the actual clipping behavior; this issue is done when the discrepancy is explained or corrected and the expected behavior is covered by a 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