Skip to content

Conversation

mivanit
Copy link
Contributor

@mivanit mivanit commented Aug 28, 2025

NOTE: re-opening #986 but with docs in the name so that the proper tests run

TODOs

  • update pyproject.toml
  • update makefile
  • test everything
  • update github actions
    • checks.yml
    • release.yml (changed this, but quite unsure whether what I did is a good idea. needs review for sure)
  • update README.md
  • update contributing.md
  • update .devcontainer/devcontainer.json and .devcontainer/Dockerfile to use uv instead of poetry. not sure how to do this
    • I think in the dockerfile we can probably set rid of installing/updating system python as uv should handle this automatically?
  • using uv breaks pip install inside notebooks
    • added a new "notebooks" group for those deps
    • shouldn't we be avoiding using torchtyping, and use jaxtyping instead?
    • shouldn't linters be catching unused imports?

Description

Poetry can be quite slow for dependency resolution and environment setup. uv is much faster and has rapidly become the new standard.

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Screenshots

image
Tool Lockfile Real time (s)
Poetry present 33.265
Poetry absent 43.167
uv present 0.232
uv absent 0.578
raw timing data All installs are tested with a warm cache (everything downloaded) and the virtual environment absent.

poetry

lockfile present:

$ poetry env remove ...
$ time poetry install
real    0m33.265s
user    0m49.167s
sys     0m9.027s

lockfile absent:

$ poetry env remove ...
$ rm poetry.lock
$ time poetry install
real    0m43.167s
user    0m59.352s
sys     0m9.196s

uv

lockfile present:

$ rm -rf .venv
$ time uv sync
real    0m0.232s
user    0m0.203s
sys     0m0.721s

lockfile absent:

$ rm -rf .venv
$ rm poetry.lock
$ time uv sync
real    0m0.578s
user    0m0.586s
sys     0m0.908s

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have not rewritten tests relating to key interfaces which would affect backward compatibility

jmole and others added 22 commits July 8, 2025 15:15
Update link to Streamlit tutorial and guide.

Co-authored-by: Bryce Meyer <[email protected]>
* add static to gitignore

* making a meaningless change to see if tests pass at all

* making a meaningless change to see if tests pass at all

* add interactive table static html only

adding things one at a time to see what causes things to break

* run poetry update with no changes to deps

* revert lockfile change

* add tiktoken >=0.7.0 to group docs

* add dep muutils >=0.6.15 to group docs

* add improved interactive table generation

we still generate a plain markdown table

code is from the old PR: https://github.com/mivanit/TransformerLens/blob/add-better-model-properties-table/docs/make_docs.py
which is in turn a modified version of https://github.com/mivanit/transformerlens-model-table

* fix format -- missing trailing newline

* fix type hints for compatibility

* fix torch device meta in make docs script, also improved hot reload

* TEMPORARY: allow_except when getting models to deal with mixtral HF_TOKEN issue

* added simple test for get_model_info

* context manager for controlling device, tests were breaking due to default device meta

* formatted with wrong version of black, oops

* fix path to generated model_properties_table

* fix md table header, add title in yaml frontmatter

* add line to frontmatter yaml, re-run tests bc huggingface down?

* do not allow exceptions when getting models

* re-run poetry lock

* attempt fix lockfile

* re-run poetry lock

---------

Co-authored-by: Bryce Meyer <[email protected]>
also update tiktoken dep for 3.13 compatibility
- torchtyping causes various issues if it's imported
- presumably jaxtyping should be used instead??
- othello GPT notebook doesn't actually use the imported TT
  - shouldn't a linter/formatter catch this sort of unused import?
Configure pytest to include project root in Python path, enabling
`from tests.foo import bar`
style imports, which were broken by switching to uv
@mivanit mivanit changed the base branch from main to dev-3.x August 28, 2025 23:39
@mivanit
Copy link
Contributor Author

mivanit commented Aug 28, 2025

ok, looks like nearly everything is passing! The few tests still failing:

remaining TODOs:

  • assistance needed in updating .devcontainer/devcontainer.json and .devcontainer/Dockerfile
  • careful review of changes to release.yml would be appreciated
  • wait for tests to be passing on dev-3.x, merge into add-uv, and then all tests should pass?

@mivanit
Copy link
Contributor Author

mivanit commented Aug 29, 2025

looks like building docs is failing due to a lack of a huggingface token secret?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants