Comments (2)
Hello @nhanph!
No, the removal is not useless. If you check contents of python_model.bin
immediately after this line:
trlx/trlx/trainer/accelerate_base_trainer.py
Line 309 in bcd237f
model.save_pretrained
with heads_only=True
, only value heads will be kept there.
>>> list(before_deletion_state_dict.keys())[:32]
['v_head.0.weight', 'v_head.0.bias', 'v_head.2.weight', 'v_head.2.bias', 'base_model.model.transformer.wte.weight', 'base_model.model.transformer.wpe.weight', 'base_model.model.transformer.h.0.ln_1.weight', 'base_model.model.transformer.h.0.ln_1.bias', 'base_model.model.transformer.h.0.attn.c_attn.weight', 'base_model.model.transformer.h.0.attn.c_attn.bias', 'base_model.model.transformer.h.0.attn.c_attn.lora_A.default.weight', 'base_model.model.transformer.h.0.attn.c_attn.lora_B.default.weight', 'base_model.model.transformer.h.0.attn.c_proj.weight', 'base_model.model.transformer.h.0.attn.c_proj.bias', 'base_model.model.transformer.h.0.ln_2.weight', 'base_model.model.transformer.h.0.ln_2.bias', 'base_model.model.transformer.h.0.mlp.c_fc.weight', 'base_model.model.transformer.h.0.mlp.c_fc.bias', 'base_model.model.transformer.h.0.mlp.c_proj.weight', 'base_model.model.transformer.h.0.mlp.c_proj.bias', 'base_model.model.transformer.h.1.ln_1.weight', 'base_model.model.transformer.h.1.ln_1.bias', 'base_model.model.transformer.h.1.attn.c_attn.weight', 'base_model.model.transformer.h.1.attn.c_attn.bias', 'base_model.model.transformer.h.1.attn.c_attn.lora_A.default.weight', 'base_model.model.transformer.h.1.attn.c_attn.lora_B.default.weight', 'base_model.model.transformer.h.1.attn.c_proj.weight', 'base_model.model.transformer.h.1.attn.c_proj.bias', 'base_model.model.transformer.h.1.ln_2.weight', 'base_model.model.transformer.h.1.ln_2.bias', 'base_model.model.transformer.h.1.mlp.c_fc.weight', 'base_model.model.transformer.h.1.mlp.c_fc.bias']
>>> list(after_save_pretrained_state_dict.keys())[:32]
['v_head.0.weight', 'v_head.0.bias', 'v_head.2.weight', 'v_head.2.bias']
from trlx.
Thank you @maxreciprocate , I got the point about saving model's value head now.
My original question is from my observation when running ILQL training script that I see a pytorch_model.bin
with the size comparable with the original model so I suspect that the base model is also saved. Is there somewhere that the heads_only
flag is set to true during checkpointing when using peft_config
as I cannot find it set anywhere?
from trlx.
Related Issues (20)
- Unable to load the trained model to do the inference HOT 8
- Memory occupy with multi GPUs Training HOT 1
- Unable to load and run inference on finetuned Alpaca model HOT 7
- Increasing max new tokens for generation arguments lead to errors HOT 3
- How to train LLaMA2 on the summarize_rlhf example?
- How to generate reward-labeled dataset
- `position_ids` error in accelerate PPO trainer HOT 3
- Problem with LLama training with LoRA HOT 3
- TypeError: reward_fn() got an unexpected keyword argument 'tokenizer' HOT 1
- multigpu support for summarization ppo example HOT 3
- Support parallel reward_fn in PPO training
- resume_from_checkpoint doesn't work HOT 1
- Issue since most recent transformers update HOT 1
- Multi-GPU training errors with peft HOT 1
- Attention mask when calculating log ratio for PPO
- when i use trlx ppotrainer train a model llama 13b model, but saved huggingface mode ,but when it inference , it has some strange keys ,and the inference result did not show ,it also have no error , it seems the result disapper HOT 1
- MPT is not working
- Runtime error when running examples (ilql_sentiments_t5.py) HOT 2
- Integration of Self-Play Fine-Tuning (SPIN) Method for Enhancing Large Language Models
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 trlx.