nanoGPT
nanoGPT copied to clipboard
Log the config params to wandb
This PR logs the parameters living on the global scope as a config to W&B. This is a greedy solution, as the parameters live on the global scope. I do that by checking which params are JSON serializable and filtering out the stuff that starts with dunder:
def guess_config(d):
"Grab config from globals"
f = dict(filter(lambda e: not str(e[0]).startswith("__") and is_jsonable(e[1]), d.items()))
return f
I put everything into a utils.py file, but you can bring them in. You can see the logged config on the overview tab now.
- Another small change, I defaulted the
wandb_entityto None, this way, runs will go to the current logged user.

Thank you for the entity None tip. I do want to do this but I think I have to first figure out what config solution I'm happy with. I think a lot of people are understandably bothered by the config in globals(), haha. Will think on it today. This would then eliminate need for a new utils file too, and get rid of my poor man's configurator lines of code.
Thanks! We can log everything tidily to W&B if you put any configuration manager.
This is now supported and implemented by guessing the args using something similar:
config_keys = [k for k,v in globals().items() if not k.startswith('_') and isinstance(v, (int, float, bool, str))]
not proud of it but it works for now. closing this one.