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

feat: add torch_compile option #251

Merged
merged 1 commit into from
Jun 1, 2023

Conversation

othertea
Copy link
Contributor

This PR adds an option to use torch.compile through the appropriate argument in HuggingFace's TrainingArguments.

In my experiments, with recent versions of PyTorch and Transformers, this resulted in faster training and slightly lower GPU memory usage; more details about my experiments can be found in the discussion in #173. With this change, we can simply add torch_compile: true in the config files in chemnlp/experiments/configs under the trainer section to use torch.compile, for instance, in the following line:

per_device_eval_batch_size: 4

@othertea othertea force-pushed the feat_torch_compile branch from c0b5118 to 8b8b931 Compare May 22, 2023 05:57
@othertea othertea marked this pull request as ready for review May 30, 2023 15:26
@jackapbutler jackapbutler self-requested a review June 1, 2023 16:07
Copy link
Collaborator

@jackapbutler jackapbutler left a comment

Choose a reason for hiding this comment

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

thanks!

@jackapbutler jackapbutler merged commit 1563040 into OpenBioML:main Jun 1, 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.

2 participants