Comments (5)
采用这样的方式显存不够:
model_chatglm = ChatGLMForConditionalGeneration.from_pretrained(pretrained_model_name_or_path)
model_chatglm = model_chatglm.half()
采用这样的方式会报上面的错:
model_chatglm = ChatGLMForConditionalGeneration.from_pretrained(pretrained_model_name_or_path,
load_in_8bit=True,
device_map="auto"
)
from chatglm-maths.
INT8训练不太稳定,建议还是FP16。
LN很敏感,需要FP16, FP32才比较稳定。
如题,INT8仿 t10_lora_trl_train_ppo.py 加上
model = prepare_model_for_int8_training(model,
use_gradient_checkpointing=True,
output_embedding_layer_name="lm_head",
#layer_norm_names=[],
layer_norm_names=["post_attention_layernorm",
"input_layernorm",
"ln_f"
],
)
from chatglm-maths.
INT8训练不太稳定,建议还是FP16。 LN很敏感,需要FP16, FP32才比较稳定。 如题,INT8仿 t10_lora_trl_train_ppo.py 加上
model = prepare_model_for_int8_training(model, use_gradient_checkpointing=True, output_embedding_layer_name="lm_head", #layer_norm_names=[], layer_norm_names=["post_attention_layernorm", "input_layernorm", "ln_f" ], )
就是用的更新后的代码,但是不采用load_in_8bit,而是使用.half()的话,3090 24GB单卡显存会不够。┭┮﹏┭┮,请问你这个最低需要的显存是多少呀?
还有个问题想请教一下:
model_ref = create_reference_model(model)
得到的model_ref模型是什么结构的呢,可以直接用model_ref.generate()方法吗
from chatglm-maths.
额,这儿half需要30G左右吧。model_ref是基准模型不更新梯度,不要让新学习的模型结果太偏离原始回答。
from chatglm-maths.
好的好的,谢谢大佬!
再请教您两个问题可以吗:
- 使用t10_lora_trl_train_ppo.py跑出来之后,保存的bin文件应该有多大呀?我跑下来保存的只有17.5kb。
- 使用t10_toy_trl_train_ppo.py采用了load_in_8bit之后保存下来的权重只有6875.5MB,想要保存和ChatGLM原本参数量相同的bin有操作的方法吗?还是说想要和原模型参数量相同只能通过lora,然后合并adapter的方式。
from chatglm-maths.
Related Issues (12)
- 大佬有计划开发多卡训练吗 HOT 1
- 训练样本是否需要[CLS]和<|endofpiece|>? HOT 1
- 怎么使用? HOT 1
- 希望取得联系
- 老师可以共享训练好的lora吗? HOT 1
- ValueError: 150004 is not in list HOT 6
- probs is nan HOT 4
- p10_toy_trl_predict_ppo.py loading problem HOT 2
- 大佬,我想用glm生成的结果和ppo算法优化模型,可以做到吗?有啥建议不
- python3 c00_toy_lora_train_6b.py RuntimeError: Internal: [MASK] is already defined. HOT 5
- ValueError: 130004 is not in list 大佬,这是什么错误? HOT 6
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 chatglm-maths.