-
Notifications
You must be signed in to change notification settings - Fork 513
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 EnvironmentLogger Callback #1350
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be included in the state data and logged? @eracah
Pushed an update fixing the failing checks. Let me know if it's good to go or if there's anything that needs to be changed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments and questions. Agreed with Mihir, it seems useful to incorporate this as state dict metadata instead of relying on loggers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename file to env_logging_callback
from composer.loggers import Logger | ||
|
||
|
||
class EnvironmentLoggerCallback(Callback): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to EnvironmentLoggingCallback
The collected information is logged as hyperparameters at the start of model fitting. | ||
""" | ||
|
||
PACKAGES_TO_LOG = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make private module level constant
@@ -75,6 +75,7 @@ | |||
'tenacity>=8.2.3,<9', | |||
'catalogue>=2,<3', | |||
'typer<1', | |||
'GitPython==3.1.43', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this a range?
'world_size': int(os.environ.get('WORLD_SIZE', 1)), | ||
'local_world_size': int(os.environ.get('LOCAL_WORLD_SIZE', 1)), | ||
'rank': int(os.environ.get('RANK', 0)), | ||
'local_rank': int(os.environ.get('LOCAL_RANK', 0)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get from composer instead?
} | ||
|
||
def _get_docker_info(self) -> dict[str, Any]: | ||
from mcli import sdk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this not a new dependency?
self.env_data['distributed_info'] = self._get_distributed_info() | ||
|
||
# Log the collected data | ||
logger.log_hyperparameters({'environment_data': self.env_data}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this get logged to mosaciml logger?
This is a new callback to simplify logging environment metadata for reproducibility purposes:
Main change is that GitPython now becomes a dependency. It is already a composer[dev] dependency. I was not sure if it was worth gating under a additional dependency