While working on #2606 I've noticed that RewardProfiler corries some obsolete code.
-
wandb.Histogram is computed and then always discarded. describe_dataframe builds a
histogram row for every numeric column, and every exit path strips it: prepare_for_serialization drops histogram* keys, and the primitive_types filter in
rollout_collection / rollout_reverification excludes non-primitives. Also, it looks like wandb is used here for no good reason.
-
prepare_for_serialization matches startswith("histogram"), not "histogram/", so a
custom metric named histogram_bins from a compute_metrics_fn is silently dropped.
-
prepare_for_serialization is now effectively a no-op if the histogram row goes away; decide
whether it stays as a guard for custom metrics or is removed from its four call sites.
While working on #2606 I've noticed that
RewardProfilercorries some obsolete code.wandb.Histogramis computed and then always discarded.describe_dataframebuilds ahistogramrow for every numeric column, and every exit path strips it:prepare_for_serializationdropshistogram*keys, and theprimitive_typesfilter inrollout_collection/rollout_reverificationexcludes non-primitives. Also, it looks likewandbis used here for no good reason.prepare_for_serializationmatchesstartswith("histogram"), not"histogram/", so acustom metric named
histogram_binsfrom acompute_metrics_fnis silently dropped.prepare_for_serializationis now effectively a no-op if the histogram row goes away; decidewhether it stays as a guard for custom metrics or is removed from its four call sites.