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

Log more dpo metrics #610

Merged
merged 17 commits into from Mar 4, 2024
Merged

Log more dpo metrics #610

merged 17 commits into from Mar 4, 2024

Conversation

maxjeblick
Copy link
Contributor

This PR logs more metrics for DPO training (in particular cross entropy loss).

I refactored train.py a bit, it is now also possible to automatically log additional metrics/losses by adding them to the model's output dictionary using additional_log_ prefix (e.g. outputs["additional_log_chosen_rewards"] = ...)

Related to #594

Copy link
Collaborator

@pascal-pfeiffer pascal-pfeiffer left a comment

Choose a reason for hiding this comment

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

Thanks a lot @maxjeblick
Super helpful to have more metrics logged. Ideally, we would also want to show them in the UI, but having them on neptune and in the log files, is already much better.

Please have another look on the path change for the gpt_templates. I believe this slipped into your PR somehow. Otherwise, looks good to me!

Comment on lines 321 to 325
prompt_template_directory = os.path.join(
os.path.dirname(__file__), "../../prompts"
)
self._possible_values["metric_gpt_template"] = possible_values.String(
values=(f.split(".")[0] for f in os.listdir("prompts"))
values=(f.split(".")[0] for f in prompt_template_directory)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why this change? It fails, as the path is relative to the root app dir.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, will check. Reason for the change is to resolve prompts directory w.r.t. llm_studio/python_configs/text_causal_language_modeling_config.py to be able to run tests with root directory == directory where test is running (this is the default in PyCharm when a test is started within the code editor).

train.py Show resolved Hide resolved
Copy link
Collaborator

@pascal-pfeiffer pascal-pfeiffer left a comment

Choose a reason for hiding this comment

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

Thanks again, lgtm!

@maxjeblick maxjeblick merged commit 40219d3 into main Mar 4, 2024
5 checks passed
@maxjeblick maxjeblick deleted the max/log_more_dpo_metrics branch March 4, 2024 09:44
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.

None yet

2 participants