ai-safety-foundation / sparse_autoencoder

Sparse Autoencoder for Mechanistic Interpretability
https://ai-safety-foundation.github.io/sparse_autoencoder/
MIT License
173 stars 39 forks source link

Save checkpoints in a run-specific dir with config file. #152

Open HoagyC opened 9 months ago

HoagyC commented 9 months ago

This changes pipeline.py so that checkpoints from a run are saved in a folder labelled by the starting time of the run. It also saves a json with the config in the file.

Also adds the git hash to the saved config file so that we can trace which version of the code a model was run with.

alan-cooney commented 9 months ago

We could also use the release version of sparse_autoencoder? Might be a bit more readable (and would also work for anyone who pip installs the lib). This can then be set in the checkpoint metadata

Note this would need to setup https://setuptools-git-versioning.readthedocs.io/en/v1.13.5/index.html

alan-cooney commented 9 months ago

Let me know what you think - happy to sort the merge conflicts myself afterwards btw

HoagyC commented 9 months ago

Hey, been looking into this, seems like I can use importlib.metadata.version? Might be wrong somehow but setuptools integration with Poetry seems fiddly.