-
Notifications
You must be signed in to change notification settings - Fork 276
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 structured configs to hydra cli, pass cfg to runners #976
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.
This is looking great! thanks @rayg1234
src/fairchem/core/_cli_hydra.py
Outdated
class FairchemJobConfig: | ||
run_name: str = field(default_factory=lambda: uuid.uuid4().hex.upper()[0:8]) | ||
timestamp_id: str = field(default_factory=lambda: get_timestamp_uid()) | ||
run_dir: str = field(default_factory=lambda: tempfile.TemporaryDirectory().name) | ||
log_dir: str = "logs" | ||
device_type: DeviceType = DeviceType.CUDA | ||
debug: bool = False | ||
scheduler: SchedulerConfig = field(default_factory=lambda: SchedulerConfig) |
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.
The current trainer records the commit hash + version being used. Would be nice to keep that. (We technically only need the commit hash since the version has it, but no harm in keeping both)
fairchem/src/fairchem/core/trainers/base_trainer.py
Lines 142 to 143 in c162617
"commit": commit_hash, | |
"version": __version__, |
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.
let me think about where to log these, we should retain these tho they arent exactly input config params
Codecov ReportAttention: Patch coverage is
|
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.
lg @rayg1234, just a minor suggestion and question
@@ -31,6 +44,7 @@ def __init__(self, x: int, y: int): | |||
self.y = y | |||
|
|||
def run(self) -> Any: | |||
assert hasattr(self, "fairchem_config") |
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 assert ever false? seems superfluous using @property
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.
oh ya true
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.
lgtm
The new cli will be called like:
fairchemv2 --config-yml /path/to/yaml [hydra-like config overides]
This removes the old arg flags completely and moves them into FairchemJobConfig as a structured config:
Users are free to specify the either in the yaml or in the command line as they choose
in yaml:
in command line:
fairchemv2 --config-yml /path/to/yaml +job.scheduler.num_ranks_per_node=4
ie: runner.fairchem_config