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

Updates logging to include Async Task Ids. #216

Merged
merged 2 commits into from
Jan 24, 2024

Conversation

blester125
Copy link
Collaborator

This PR adds new logging handler classes for Stream (console) and File output that can add async task ids to the logging message. This makes debugging eaiser and lets us group logging messages based on parameter name without needing to pass the actual parameter around all the time.

Additionally, the logging configuration has been unified across all our provided scripts and the env var GIT_THETA_LOG_LEVEL can be used to control the level of the logs.

Currently, this all still works by configuring the root logger, eventually we should move to a named logger and only configure that one. That will allow us to do things like log to console and file at different levels.

I also changed the default value for GIT_THETA_UPDATE_PATH as the default was triggering an extra smudge, even when using dense updates.

This PR adds new logging handler classes for Stream (console) and File
output that can add async task ids to the logging message. This makes
debugging eaiser and lets us group logging messages based on parameter
name without needing to pass the actual parameter around all the time.

Additionally, the logging configuration has been unified across all our
provided scripts and the env var `GIT_THETA_LOG_LEVEL` can be used to
control the level of the logs.

Currently, this all still works by configuring the root logger,
eventually we should move to a named logger and only configure that one.
That will allow us to do things like log to console and file at
different levels.
git_theta/updates/dense.py Outdated Show resolved Hide resolved
git_theta/updates/dense.py Outdated Show resolved Hide resolved
@@ -73,14 +73,15 @@ def __get__(self, obj, objtype=None):
class EnvVarConstants:
CHECKPOINT_TYPE = EnvVar(name="GIT_THETA_CHECKPOINT_TYPE", default="pytorch")
UPDATE_TYPE = EnvVar(name="GIT_THETA_UPDATE_TYPE", default="dense")
UPDATE_DATA_PATH = EnvVar(name="GIT_THETA_UPDATE_DATA_PATH", default="update.pt")
UPDATE_DATA_PATH = EnvVar(name="GIT_THETA_UPDATE_DATA_PATH", default="")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why doesn't this get a default anymore?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Basically, when an update is done with side loaded information (like a sparse or lora update), the on-disk/working checkpoint doesn't change, but the checkout in the git history does (it has the side loaded information in it). This causes false positives when you run git status. As such, we include a check for side-loaded information in some of our scripts that will write the updated version to disk so that git doesn't detect a diff.

With the default value, git-theta was always triggering that extra write, even in a dense update where the result is overwriting the model with the same values.

So removing this default value skips that extra smudge in cases where there isn't any side-loaded information.

@blester125 blester125 merged commit eaeb338 into r-three:main Jan 24, 2024
21 checks passed
@blester125 blester125 deleted the feat/async-logging branch January 24, 2024 17:46
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.

2 participants