-
Notifications
You must be signed in to change notification settings - Fork 609
feat(pt): add descriptor name & parameter numbers output & gpu name (only for cuda) & Capitalise some infos #5140
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -721,6 +721,45 @@ def warm_up_linear(step: int, warmup_steps: int) -> float: | |
| self.profiling = training_params.get("profiling", False) | ||
| self.profiling_file = training_params.get("profiling_file", "timeline.json") | ||
|
|
||
| # Log model summary info (descriptor type and parameter count) | ||
| if self.rank == 0: | ||
| self._log_model_summary() | ||
|
|
||
| def _log_model_summary(self) -> None: | ||
| """Log model summary information including descriptor type and parameter count.""" | ||
|
|
||
| def get_descriptor_type(model: Any) -> str: | ||
| """Get the descriptor type name from model.""" | ||
| # Standard models have get_descriptor method | ||
| if hasattr(model, "get_descriptor"): | ||
| descriptor = model.get_descriptor() | ||
| return descriptor.serialize()["type"].upper() | ||
| # ZBL models: descriptor is in atomic_model.models[0] | ||
| if hasattr(model, "atomic_model") and hasattr(model.atomic_model, "models"): | ||
| dp_model = model.atomic_model.models[0] | ||
| if hasattr(dp_model, "descriptor"): | ||
| return ( | ||
| dp_model.descriptor.serialize()["type"].upper() + " (with ZBL)" | ||
| ) | ||
| return "UNKNOWN" | ||
|
|
||
| def count_parameters(model: Any) -> int: | ||
| """Count the total number of trainable parameters.""" | ||
| return sum(p.numel() for p in model.parameters()) | ||
|
OutisLi marked this conversation as resolved.
|
||
|
|
||
| if not self.multi_task: | ||
| desc_type = get_descriptor_type(self.model) | ||
| num_params = count_parameters(self.model) | ||
| log.info(f"Descriptor: {desc_type}") | ||
| log.info(f"Model params: {num_params / 1e6:.3f} M") | ||
| else: | ||
| # For multi-task, log each model's info | ||
| for model_key in self.model_keys: | ||
| desc_type = get_descriptor_type(self.model[model_key]) | ||
| num_params = count_parameters(self.model[model_key]) | ||
| log.info(f"Descriptor [{model_key}]: {desc_type}") | ||
| log.info(f"Model params [{model_key}]: {num_params / 1e6:.3f} M") | ||
|
Comment on lines
+728
to
+761
|
||
|
|
||
| def run(self) -> None: | ||
| fout = ( | ||
| open( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.