Skip to content

Wire total_weights into ML Diagnostics metrics - #474

Open
richaguptaa17 wants to merge 1 commit into
AI-Hypercomputer:mainfrom
richaguptaa17:mldiag-metric-weights
Open

Wire total_weights into ML Diagnostics metrics#474
richaguptaa17 wants to merge 1 commit into
AI-Hypercomputer:mainfrom
richaguptaa17:mldiag-metric-weights

Conversation

@richaguptaa17

Copy link
Copy Markdown
Contributor
  • Pass the existing num_model_parameters calculation into record_scalar_metrics(..., total_weights=num_model_parameters) across all trainers (Stable Diffusion, SDXL, Flux, Wan, and DreamBooth). This populates the total_weights card in Google Cloud ML Diagnostics.
  • Remove the redundant metric_types import and if/else branching. Standardize _METRICS_TO_MANAGED directly on canonical string literals, matching the SDK's internal representation.

- Wire total_weights into telemetry:
  Pass the existing `num_model_parameters` calculation into
  `record_scalar_metrics(..., total_weights=num_model_parameters)` across
  all trainers (Stable Diffusion, SDXL, Flux, Wan, and DreamBooth).
  This populates the total_weights card in Google Cloud ML
  Diagnostics.
- Remove the redundant `metric_types` import and `if/else` branching.
  Standardize `_METRICS_TO_MANAGED` directly on canonical string literals,
  matching the SDK's internal representation.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request simplifies metric reporting by removing the dependency on metric_types from google_cloud_mldiagnostics and directly mapping internal metrics to canonical string names. It also removes the gradient norm metric and updates several trainers (including base_wan, dreambooth, flux, sdxl, and stable_diffusion) to explicitly pass total_weights=num_model_parameters when recording scalar metrics. Corresponding updates were made to the documentation and tests. There are no review comments, so I have no feedback to provide.

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.

1 participant