[core / DDP] Fix RM trainer + DDP + quantization + propagate gradient_checkpointing_kwargs in SFT & DPO#912
Merged
younesbelkada merged 14 commits intomainfrom Oct 31, 2023
Merged
Conversation
|
The documentation is not available anymore as the PR was closed or merged. |
vwxyzjn
reviewed
Oct 24, 2023
examples/scripts/reward_modeling.py
Outdated
| # Step 2: Load the dataset and pre-process it | ||
| tokenizer = AutoTokenizer.from_pretrained(args.model_name) | ||
| train_dataset = load_dataset(args.dataset_name, split="train") | ||
| train_dataset = load_dataset(args.dataset_name, split="train[:50]") |
Contributor
There was a problem hiding this comment.
Could this be not hardcoded? Maybe like split=args.split
younesbelkada
commented
Oct 30, 2023
core / DDP] Fix RM trainer + DDP + quantization core / DDP] Fix RM trainer + DDP + quantization + propagate gradient_checkpointing_kwargs
core / DDP] Fix RM trainer + DDP + quantization + propagate gradient_checkpointing_kwargscore / DDP] Fix RM trainer + DDP + quantization + propagate gradient_checkpointing_kwargs in SFT & DPO
|
The documentation is not available anymore as the PR was closed or merged. |
hijkzzz
pushed a commit
to OpenRLHF/OpenRLHF
that referenced
this pull request
Feb 5, 2024
* fix bug: generate_args-do_sample * fix gradient_checkpointing_kwargs bug see: huggingface/trl#912 and huggingface/transformers#26969 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
lapp0
pushed a commit
to lapp0/trl
that referenced
this pull request
May 10, 2024
…dient_checkpointing_kwargs` in SFT & DPO (huggingface#912) * make use of forward hooks * correctly delete attributes * fix RM DPP issues * revert unneeded changes * more fixes * fix diff * fix * propagate to SFT * Update examples/scripts/reward_modeling.py * propagate the fix on DPO trainer * add to example scripts * trigger CI
xiechengmude
pushed a commit
to xiechengmude/xDAN-RL-Training-GRPO
that referenced
this pull request
Mar 4, 2025
* fix bug: generate_args-do_sample * fix gradient_checkpointing_kwargs bug see: huggingface/trl#912 and huggingface/transformers#26969 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
yxliu-TAMU
pushed a commit
to mincheolseong/ECEN743-GRPO-Project-Proposal
that referenced
this pull request
Apr 20, 2025
…dient_checkpointing_kwargs` in SFT & DPO (huggingface#912) * make use of forward hooks * correctly delete attributes * fix RM DPP issues * revert unneeded changes * more fixes * fix diff * fix * propagate to SFT * Update examples/scripts/reward_modeling.py * propagate the fix on DPO trainer * add to example scripts * trigger CI
sg-nm
pushed a commit
to sg-nm/LMM-RL
that referenced
this pull request
Apr 21, 2025
* fix bug: generate_args-do_sample * fix gradient_checkpointing_kwargs bug see: huggingface/trl#912 and huggingface/transformers#26969 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Needs : huggingface/peft#1036 / huggingface/transformers#27020
Fixes: #891
Fixes: #835
To avoid issues with PEFT + DDP, we need to call the gradient checkpointing method with
use_reentrant=Falsethat you can pass over the argumentgradient_checkpointing_kwargsdirectly in trainer with huggingface/transformers#27020 .For users that do not have the correct transformers version they need to update transformers with the correct version to get that feature, otherwise
gradient_checkpointing_kwargswill get ignored.cc @lvwerra