Comments (4)
I attempted to train the reward model without DeepSpeed by executing
python3.9 train_reward_model_gptj.py
, but this throws the following message. How can I rectify this?RuntimeError: module must have its parameters and buffers on device cuda:0 (device_ids[0]) but found one of them on device: cpu
or
RuntimeError: module must have its parameters and buffers on device cuda:0 (device_ids[0]) but found one of them on device: cuda:1
Can you please try to use: deepspeed train_reward_model_gptj.py
?
In readme we already mentioned the way to train the reward model.
from trlx.
Hi @PhungVanDuy,
While running deepspeed train_reward_model_gptj.py
in a multiple GPU setup, some of the initial steps, such as
model = GPTRewardModel("CarperAI/openai_summarize_tldr_sft")
train_pairs = create_comparison_dataset(data_path, "train")
train_dataset = PairwiseDataset(train_pairs, tokenizer, max_length=max_length)
are being executed multiple times. How do we run the initial loading and preprocessing steps only once and then share them with all the processes?
from trlx.
Sorry for the late response!
Normally for this case, we process datasets like this if you want to process in one process and apply for another process you can check this way.
You will determine the rank of the process and then process at rank 0 then you will broadcast to another rank but need to make sure that the data you broadcast have to be pickleable like (list, tensor, dict, ...).
In this case PairwiseDataset I don't think that is straightforward if you do with this way, instead I would suggest that you process the dataset offline and save to a binary object, and load it when you train.
from trlx.
I think @PhungVanDuy's response was exhaustive on this
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 4
- 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
- Question about saving peft checkpoint HOT 2
- 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
- Multi-GPU training errors with peft
- 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
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.