Comments (4)
I just saw that there is a "gradient_clipping" option in the config. However, setting it to 1.0, does not eliminate the gradient overflow messages. Is this expected?
from deepspeed.
Gradient overflow messages, typically at the beginning of training, are not surprising. But this should eventually stop once the dynamic loss scale has decreased to a point that allows training stability.
Are you not seeing the overflow messages stop?
from deepspeed.
Regarding to the original question, what's the purpose to disable 'max_grad_norm' for fp16?
if self.fp16_enabled() and 'max_grad_norm' in optimizer_parameters.keys():
optimizer_parameters['max_grad_norm'] = 0.0
from deepspeed.
The rationale for this was to support both the old and new ways of specifying gradient clipping. The difference is that in the old way, gradient clipping is specified as max_grad_norm parameter of the fp32 optimizer, while in the new (and more intuitive way IMHO) gradient clipping is handled in the fp16 wrapper optimizer, such as here. In summary, this logic allows the fp16 optimizers in DeepSpeed to handle both old and new gradient clipping styles.
All that said, we are thinking of ways to improve the interface and avoid this confusion, and we certainly appreciate your input on that.
from deepspeed.
Related Issues (20)
- [BUG] RuntimeError encountered when generating tokens from a DeepSpeedHybridEngine initialized with 4-bit quantization. HOT 2
- [BUG] is_zero_init_model is always False when I'm using zero_init! HOT 4
- [BUG] RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! HOT 1
- Deepspeed stage 3 hanging after 1st validation sample
- [BUG] 4-bit quantized models would repeatedly generate the same tokens when bf16.enabled is true HOT 1
- Deepspeed zero3 + qlora arise problem! Params didn't sharded first before load to each GPU!
- Install errors on Windows HOT 5
- [HELP] How to safely switch trainable parameters in ZeRO-3 stage? HOT 2
- Does deepspeed support aarch64? HOT 6
- [BUG] tortoise_tts.py fails on deepspeed/pydantic error HOT 1
- [BUG] 1 line logic issue: flipped sign/direction in `_partition_param_sec` of `partition_parameters.py`? HOT 1
- [BUG] RuntimeError encountered when generating tokens from a Meta-Llama-3-8B-Instruct model initialized with 4-bit or 8-bit quantization HOT 2
- Why doesn't deepspeed stage 3 allow a batch size of 1 with multiple GPUs?
- [BUG] File not found in autotuner cache in multi-node setting on SLURM HOT 1
- Inference with the MoE based GPT model trained by ds_pretrain_gpt_345M_MoE128.sh [BUG]
- RuntimeError: still have inflight params[BUG] HOT 1
- Install issue with setuptools 70 HOT 2
- [BUG] oneapi/ccl.hpp: No such file or directory. HOT 1
- [BUG]模型卡在trainer.train()一直不训练
- [BUG] Running llama2-7b step3 with tensor parallel and HE fails due to incompatible shapes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deepspeed.