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

Add log_every_n_steps in training #523

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

gyin94
Copy link
Contributor

@gyin94 gyin94 commented Jun 17, 2024

Background:

  • This would be useful for fine tuning that has few hundred steps to log more frequently to see the loss pattern

@@ -150,6 +150,9 @@ class Config(Module.Config):
# An optional recorder for measuring common metrics like step time.
recorder: Optional[InstantiableConfig[measurement.Recorder]] = None

# The frequency of logging during training.
log_every_n_steps: Optional[int] = None
Copy link
Contributor Author

@gyin94 gyin94 Jun 17, 2024

Choose a reason for hiding this comment

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

did not set log_every_n_steps: int = 100 to avoid a large amount of config.txt update. If we think it makes more sense, we can also change it

@gyin94 gyin94 force-pushed the log.step branch 2 times, most recently from 4268b70 to 08dfc09 Compare June 17, 2024 07:55
@@ -150,6 +150,9 @@ class Config(Module.Config):
# An optional recorder for measuring common metrics like step time.
recorder: Optional[InstantiableConfig[measurement.Recorder]] = None

# The frequency of logging during training. By default, it will use 100.
log_every_n_steps: Optional[int] = None
Copy link
Contributor

Choose a reason for hiding this comment

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

How about taking a function config instead of an int? This will allow users to set

cfg.logging_steps = config_for_function(every_n_steps).set(n=100, additional=list(range(5)) + [max_step])

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I would prefer a simple int for my use case of printing step time every step.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe both a function and a simple int are allowed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants