stanford-crfm / levanter

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

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

Open mhmaqbool opened 1 month ago

mhmaqbool commented 1 month 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 1 month ago

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

mhmaqbool commented 1 month ago

Definitely. I will be happy to contribute. 👍