Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix dpo crash in transformers 4.48 #1750

Open
wants to merge 1 commit into
base: transformers_future
Choose a base branch
from

Conversation

sywangyi
Copy link
Collaborator

@sywangyi sywangyi commented Feb 6, 2025

What does this PR do?

Fixes # (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

@sywangyi sywangyi requested a review from regisss as a code owner February 6, 2025 02:51
@sywangyi
Copy link
Collaborator Author

sywangyi commented Feb 6, 2025

pytest tests/test_examples.py::MultiCardDPOExampleTester::test_dpo_llama-7b_multi_card -v -s
crash is
[rank4]: Traceback (most recent call last):
[rank4]: File "/workspace/wangyi/optimum-habana/examples/trl/dpo.py", line 257, in
[rank4]: train_result = dpo_trainer.train()
[rank4]: File "/workspace/wangyi/optimum-habana/optimum/habana/transformers/trainer.py", line 599, in train
[rank4]: return inner_training_loop(
[rank4]: File "/workspace/wangyi/optimum-habana/optimum/habana/transformers/trainer.py", line 1063, in _inner_training_loop
[rank4]: tr_loss_step = self.training_step(model, inputs, num_items_in_batch)
[rank4]: File "/workspace/wangyi/optimum-habana/optimum/habana/transformers/trainer.py", line 1632, in training_step
[rank4]: loss = self.compute_loss(model, inputs, num_items_in_batch=num_items_in_batch)
[rank4]: TypeError: DPOTrainer.compute_loss() got an unexpected keyword argument 'num_items_in_batch'

@emascarenhas
Copy link
Contributor

LGTM.

@libinta libinta added run-test Run CI for PRs from external contributors transformers_future labels Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-test Run CI for PRs from external contributors transformers_future
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants