Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure that load_from_pretrained config typing is correct #97

Closed
wants to merge 1 commit into from

Conversation

chanind
Copy link
Collaborator

@chanind chanind commented Apr 21, 2024

Description

This PR makes use of the type information on the LanguageModelSAERunnerConfig dataclass, along with the typeguard package to ensure that when loading an existing config from JSON, that all fields in the config have types which match the types specified in the config. Fields which don't match are removed. This PR also adds a test to ensure that all fields in the config loaded from pretrained in the session loader have types which match what is specified in the config.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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

You have tested formatting, typing and unit tests (acceptance tests not currently in use)

  • I have run make check-ci to check format and linting. (you can run make format to format code if needed.)

Performance Check.

If you have implemented a training change, please indicate precisely how performance changes with respect to the following metrics:

  • L0
  • CE Loss
  • MSE Loss
  • Feature Dashboard Interpretability

Please links to wandb dashboards with a control and test group.

Copy link

codecov bot commented Apr 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.47%. Comparing base (c1d9cbe) to head (7d49cf7).
Report is 1 commits behind head on main.

❗ Current head 7d49cf7 differs from pull request most recent head b0f4454. Consider uploading reports for the commit b0f4454 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #97      +/-   ##
==========================================
- Coverage   64.11%   58.47%   -5.64%     
==========================================
  Files          17       17              
  Lines        1761     1440     -321     
  Branches      289      239      -50     
==========================================
- Hits         1129      842     -287     
+ Misses        568      547      -21     
+ Partials       64       51      -13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jbloomAus
Copy link
Owner

@chanind sorry for not merging sooner. Feel free resolve the conflicts and merge!

@chanind chanind force-pushed the test-load-from-pretrained-fields branch from 7d49cf7 to 9e927f1 Compare May 7, 2024 12:37
@chanind chanind force-pushed the test-load-from-pretrained-fields branch from 9e927f1 to b0f4454 Compare May 7, 2024 12:41
@jbloomAus
Copy link
Owner

is this stale?

@chanind
Copy link
Collaborator Author

chanind commented May 30, 2024

closing for now, will reopen if it makes sense

@chanind chanind closed this May 30, 2024
@chanind chanind deleted the test-load-from-pretrained-fields branch May 30, 2024 17:26
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