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

Correct an apparent logger output directory bug #1232

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

yutsai84
Copy link

@yutsai84 yutsai84 commented Apr 2, 2024

The name arg is hardcoded in the main branch. This pr tries to correct it by using the value parsed by thename argument.

@yutsai84 yutsai84 changed the title Correct an apparent logger output directory Correct an apparent logger output directory bug Apr 2, 2024
@rasbt
Copy link
Collaborator

rasbt commented Apr 2, 2024

Thanks for the contribution. I don't have a strong opinion on the hardcoding of name because in this case it would be the same due to the if/else name == checks but I'm okay with changing it. Wdyt @awaelchli ?

litgpt/utils.py Outdated Show resolved Hide resolved
Copy link
Contributor

@awaelchli awaelchli left a comment

Choose a reason for hiding this comment

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

Approving in case there is a strong desire for this change, but personally I vote against it (see comment below). Note that unless we expose every little configuration option in every logger it will always be opinionated and "hardcoded". But I think in the current state of LitGPT, that's also ok.

@@ -451,9 +451,9 @@ def choose_logger(
**kwargs: Any,
):
if logger_name == "csv":
return CSVLogger(root_dir=(out_dir / "logs"), name="csv", flush_logs_every_n_steps=log_interval, **kwargs)
return CSVLogger(root_dir=(out_dir / "logs"), name=name, flush_logs_every_n_steps=log_interval, **kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd like to point out that "name" that is passed in is not conceptually the same as "name" argument of the logger, it's used differently to make a simplified directory structure. And so the choice here was deliberate (by me). With the change in this PR, there will now be essentially twice the name in the directory structure, which is what I wanted to avoid.

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