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

[core] remove wandb dependency #92

Merged
merged 5 commits into from
Jan 19, 2023

Conversation

younesbelkada
Copy link
Contributor

What does this PR do ?

This PR removes wandb dependency for trl

wandb run of this branch: https://wandb.ai/distill-bloom/trl/runs/360f7cdc?workspace=user-

cc @lvwerra

@younesbelkada younesbelkada mentioned this pull request Jan 18, 2023
26 tasks
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jan 18, 2023

The documentation is not available anymore as the PR was closed or merged.

wandb_logs.update(stats)
wandb_logs["env/reward_mean"] = torch.mean(rewards).cpu().numpy()
wandb_logs["env/reward_std"] = torch.std(rewards).cpu().numpy()
wandb_logs["env/reward_dist"] = rewards.cpu().numpy()
wandb.log(wandb_logs)
self.accelerator.log(wandb_logs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since the user can select other frameworks (e.g. tensorboard) we should also log if we are not using wandb. maybe that whole block can be wandb agnostic, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, based on your suggestion I proposed dc8cda2 , here is the corresponding log: https://wandb.ai/distill-bloom/trl/runs/baw84iyv?workspace=user-

@younesbelkada younesbelkada requested a review from lvwerra January 18, 2023 14:57
Copy link
Member

@lvwerra lvwerra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! have you tried some other logging

@younesbelkada
Copy link
Contributor Author

Thanks! I will give it a try with tensorboard and merge if there is no issue

@younesbelkada
Copy link
Contributor Author

I can confirm everything works fine (single & multi-GPU with wandb and with tensorboard) after 37aa98e for tensorboard, since I made some non-minor modifications could you have a second look? 🙏 thanks

Copy link
Member

@lvwerra lvwerra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one minor comment and then we can merge I think :)

config = PPOConfig(
model_name="lvwerra/gpt2-imdb",
learning_rate=1.41e-5,
log_with="wandb",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we remove wandb as a main dependency i think we should not use it as a default. otherwise it will fail if you use the ppo trainer out of the box. what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes makes sense!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be now addressed in d3f9231 !

@younesbelkada younesbelkada merged commit e954fa0 into huggingface:main Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants