Skip to content

adds wandb loging of metrics #676

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

Merged
merged 4 commits into from
Apr 23, 2025
Merged

adds wandb loging of metrics #676

merged 4 commits into from
Apr 23, 2025

Conversation

NathanHB
Copy link
Member

No description provided.

@HuggingFaceDocBuilderDev
Copy link
Collaborator

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Member

@clefourrier clefourrier left a comment

Choose a reason for hiding this comment

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

LGTM but you need to update the doc on logging

if self.should_push_results_to_tensorboard:
self.push_to_tensorboard(
results=self.metrics_logger.metric_aggregated, details=self.details_logger.compiled_details
)

def push_to_wandb(self, results_dict: dict, details_datasets: dict) -> None:
self.wandb_run.log(
{**results_dict["results"]},
Copy link
Member

@anton-l anton-l Apr 17, 2025

Choose a reason for hiding this comment

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

Can we log some additional data here like checkpoint_num or consumed_tokens? For the custom X axis like so

image

Copy link
Member

Choose a reason for hiding this comment

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

We can probably pass it from nanotron_model, since these metrics are implementation-specific

Copy link
Member Author

Choose a reason for hiding this comment

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

not sure what you mean by that ? what's checkpoint_num and is consumed_tokens the total amount of tokens used as input ?

Copy link
Member

Choose a reason for hiding this comment

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

I mean just arbitrary step counters coming from somewhere else, e.g. we can implement consumed_tokens (consumed_train_samples*seq_len) in nanotron_model.py

def push_to_wandb(self, results_dict: dict, details_datasets: dict) -> None:
self.wandb_run.log(
{**results_dict["results"]},
)
Copy link
Member

@anton-l anton-l Apr 17, 2025

Choose a reason for hiding this comment

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

nit: IIUC and the metrics are logged as custom|mmlu:astronomy|0/acc_norm , we can .replace(':', '/') to get custom|mmlu/astronomy|0/acc_norm.
Otherwise wandb creates tons of collapsible sections for every subset of the benchmark, instead of just one section for custom|mmlu with all the metrics inside.
image

@NathanHB NathanHB merged commit 989f5f5 into main Apr 23, 2025
5 checks passed
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.

4 participants