stanford-crfm / levanter

Legible, Scalable, Reproducible Foundation Models with Named Tensors and Jax
https://levanter.readthedocs.io/en/latest/
Apache License 2.0
493 stars 78 forks source link

Tensorboard logging breaks if value is of the type "string" #735

Open mhmaqbool opened 5 hours ago

mhmaqbool commented 5 hours ago

I noticed that tensorboard logging causes the code to break when the value happens to be of type string. For example, if throughput/device_kind happens to be a "string", the following code breaks,

def log_summary(self, metrics: dict[str, Any]):
        for k, v in metrics.items():
            self.writer.add_scalar(k, v, global_step=None)
dlwh commented 2 hours ago

ah thanks for the catch. Any chance I could induce you to put up a PR :-)