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

Change default batch_size for finetuning to max_batch_size for a model #189

Merged
merged 9 commits into from
Sep 25, 2024

Conversation

artek0chumak
Copy link
Contributor

Issue #ENG-10437

I added a logic to request limits for hyperparameters for a requested model. If a user does not specify hyperparameters, togther-python will change it to recommended values.

@@ -55,7 +58,7 @@ def create(
n_evals (int, optional): Number of evaluation loops to run. Defaults to 0.
n_checkpoints (int, optional): Number of checkpoints to save during fine-tuning.
Defaults to 1.
batch_size (int, optional): Batch size for fine-tuning. Defaults to 32.
batch_size (int, optional): Batch size for fine-tuning. Defaults to auto.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
batch_size (int, optional): Batch size for fine-tuning. Defaults to auto.
batch_size (int, optional): Batch size for fine-tuning. Defaults to max.

Comment on lines +109 to +124
else:
if model_limits.full_training is None:
raise ValueError(
"Full training is not supported for the selected model."
)
Copy link
Member

Choose a reason for hiding this comment

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

It looks like you have duplicated validation logic here and in cli/finetune.py. Maybe it's best to extract it to a function, call it in cli/finetune.py and reraise the exception as click.BadParameter if necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This logic is mostly for mypy -- it will error out that full_training is None in the following lines without this check

@orangetin orangetin merged commit f13c7a1 into main Sep 25, 2024
12 of 13 checks passed
@orangetin orangetin deleted the artem/auto-batch-size branch September 25, 2024 20:58
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.

5 participants