Wire total_weights into ML Diagnostics metrics - #474
Open
richaguptaa17 wants to merge 1 commit into
Open
Conversation
- 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.
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
num_model_parameterscalculation intorecord_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.metric_typesimport andif/elsebranching. Standardize_METRICS_TO_MANAGEDdirectly on canonical string literals, matching the SDK's internal representation.