Comments (6)
我用deepspeed-chat官方代码跑的时候,如果不加ptx loss,会有一定概率导致actor训着训着输出就变成空的,加了以后(而且它默认的ptx_coef非常大)就不会有这个问题,而且效果也还可以。分两次backward的做法我也在它的代码里看到了,我先试一下引入看能不能跑通吧。
from openrlhf.
这个BUG是由 DeepSpeed 造成的,他们一直没有修复
见 microsoft/DeepSpeed#627
一种trick的解决方法是 ptx loss 和 ppo loss 分两次backward(有兴趣可以尝试下 提交 MR 需要注意的点是 两次 backward 会破坏 deepspeed 的 accumulated 次数计算,所以又要加一个trick补丁)
我暂时没有修这个的原因是 由于一般大家没有预训练数据 很少会用 ptx
from openrlhf.
其实就是 gradient checkpoint 和 两条路径的backward 冲突了,如果你模型小的话 关掉gradient checkpoint 也能跑
from openrlhf.
改了就可以跑了:
self.strategy.backward(self.ptx_coef * ptx_loss, self.actor, self.actor_optim)
# actor_loss = ptx_loss * self.ptx_coef + raw_actor_loss
额外的trick补丁是指什么呢
from openrlhf.
已经修正
from openrlhf.
ptx_coef好像没用上
from openrlhf.
Related Issues (20)
- AssertionError: backward pass is invalid for module in evaluation mode HOT 9
- Support hybird-model in Ray PPO
- Version0.0.1: Release the first development version HOT 1
- fixing Typo HOT 1
- Error occurred when loading datasets from disk HOT 5
- Local dataset: Please perform appropriate preprocessing on your local data set.
- Scale rlhf to 100B models HOT 1
- DeepSpeed Training and Inference HOT 2
- Implement Re-max
- Inquiry regarding the feasibility of fine-tuning LLaMA2-7B with a single A100 HOT 4
- [Severity] High similarity with Colossal-AI HOT 4
- Discussion on our 1st release. HOT 1
- feature: add api support for hosting a reward model HOT 5
- Add pipeline module to support more scientific comparative experiments and research
- 问一下,huggingface提供的checkpoint为pt文件,如何转成大模型常见的.bin HOT 4
- Loading RM ckpt bug: AttributeError: 'NoneType' object has no attribute 'load' HOT 3
- 为什么速度回比deepspeed chat快4倍这么多 HOT 3
- baichuan2-13b-base作为actor RuntimeError: CUDA error: device-side assert triggered HOT 5
- Support KTO HOT 1
- High Memory Usage HOT 5
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 openrlhf.