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 issues with resumption testing #144

Merged
merged 5 commits into from
May 13, 2024
Merged

Conversation

tomMcGrath
Copy link
Contributor

@tomMcGrath tomMcGrath commented May 13, 2024

Description

The test test_save_load_and_resume_checkpoint was erroneously passing because of an incorrect comparion. Fixing this comparison exposed a further error in the test: the train context defined by build_train_ctx defined in the test file didn't conform to the behaviour of _build_train_context and was generating incorrect results which caused the fixed test to fail.

This PR fixes the incorrect comparison, changes the testing train context builder to use the real context builder plus some minor overrides to enable testing, and removes an unused attribute from L1Scheduler that was causing comparisons to fail.

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.)

Copy link

codecov bot commented May 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.20%. Comparing base (eba3f4e) to head (060180a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #144      +/-   ##
==========================================
- Coverage   72.21%   72.20%   -0.02%     
==========================================
  Files          17       17              
  Lines        1814     1813       -1     
  Branches      295      295              
==========================================
- Hits         1310     1309       -1     
  Misses        432      432              
  Partials       72       72              

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

@jbloomAus
Copy link
Owner

thanks for catching this! really appreciate it!

@jbloomAus jbloomAus merged commit 085d04f into jbloomAus:main May 13, 2024
7 checks passed
jbloomAus pushed a commit that referenced this pull request May 15, 2024
* Adds state_dict to L1Scheduler

* investigating test failure

* fix: Fix issues with resumption testing (#144)

* fix always-true comparison in train context testing

* set default warmup steps to zero

* remove unused type attribute from L1Scheduler

* update training tests to use real context builder

* add docstring for build_train_ctx

* 2.1.2

Automatically generated by python-semantic-release

* Adds state_dict to L1Scheduler

* investigating test failure

---------

Co-authored-by: github-actions <[email protected]>
tom-pollak pushed a commit to tom-pollak/SAELens that referenced this pull request Oct 22, 2024
* fix always-true comparison in train context testing

* set default warmup steps to zero

* remove unused type attribute from L1Scheduler

* update training tests to use real context builder

* add docstring for build_train_ctx
tom-pollak pushed a commit to tom-pollak/SAELens that referenced this pull request Oct 22, 2024
…oomAus#143)

* Adds state_dict to L1Scheduler

* investigating test failure

* fix: Fix issues with resumption testing (jbloomAus#144)

* fix always-true comparison in train context testing

* set default warmup steps to zero

* remove unused type attribute from L1Scheduler

* update training tests to use real context builder

* add docstring for build_train_ctx

* 2.1.2

Automatically generated by python-semantic-release

* Adds state_dict to L1Scheduler

* investigating test failure

---------

Co-authored-by: github-actions <[email protected]>
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