Skip to content

Commit

Permalink
better tests for weight loading with refactoring (#219)
Browse files Browse the repository at this point in the history
* move better tests from PR 214 to investigate weight folding issues

[PR 214 with tokenizer updates](#214)
appears to have exposed a bug. I made some better tests on that branch,
and I'm adding them to the main branch to see if that also breaks.

* format

* update deps

* indexed tokenizer tests for save/load
  • Loading branch information
mivanit authored Aug 20, 2024
1 parent 45348cb commit 3ea9758
Show file tree
Hide file tree
Showing 4 changed files with 1,065 additions and 889 deletions.
3 changes: 2 additions & 1 deletion maze_transformer/test_helpers/assertions.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ def assert_model_output_equality(
)
if not torch.all(output_argsort_match):
raise ModelOutputArgsortEqualityError(
f"argsort not equal, {output_argsort_match.numel() - output_argsort_match.sum()} / {output_argsort_match.numel()} elements differ"
f"argsort not equal, {output_argsort_match.numel() - output_argsort_match.sum()} / {output_argsort_match.numel()} elements differ",
f"{vocab_size = }, {test_sequence_length = }",
)

# apply normalization (e.g. softmax) and check with atol v-small
Expand Down
Loading

0 comments on commit 3ea9758

Please sign in to comment.