Repository navigation
fix(dpo): honor objective configuration in training and validation - #508
Open
JiahaoTanXX wants to merge 1 commit into
Open
JiahaoTanXX wants to merge 1 commit into
JiahaoTanXX wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
DPOConfig.ipo,beta, andlabel_smoothingwere omitted from the batches created by bothDPOPipeline.run()andval(). The worker and validation loss therefore silently used the defaults (False,0.1,0.0), even when the user selected another objective or hyperparameters. For example, a fixed preference pair configured withbeta=0.7produced loss0.644397instead of0.403186.Pass all three settings through batch metadata in training and validation. Add five CPU regression cases covering default DPO, non-default beta, label smoothing, IPO, and IPO with non-default beta. The tests execute the real driver
run()/val(),DataProtooperations, and worker loss with local cluster/model stand-ins. They check training and validation loss, reward metrics, and the training gradient against independently computed scalar expectations.Validation:
python -m pytest -q tests/pipeline/dpo/test_objective_config.py tests/utils/test_functionals.py --torch_ver 2.8.0: 9 passed.pre-commit run --files roll/pipeline/dpo/dpo_pipeline.py tests/pipeline/dpo/test_objective_config.py: all four hooks passed.git diff --check: passed.Tested on macOS CPU with Python 3.12.14, PyTorch 2.8.0, Transformers 4.57.0, and Ray 2.48.0. No model weights, Ray cluster, or full GPU/distributed training run was used.