Add phi tests#1372
Merged
Merged
Conversation
Collaborator
|
@TensorCruncher Great work on this. The suite shape is right and the test coverage is good. Every category from the unit-test guide is represented, and the conversion/guard/setup-testing classes are exemplary. For the two flag tests you specifically flagged:
|
Author
|
I have removed the two redundant config literal tests. Thank you for your review and kind words! |
Collaborator
|
You're welcome! Merging, it will be in the next release! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Unit test file for Phi adapter.
In light of the new guidelines for unit tests, I have made the following inclusions. Let me know if they need to be removed / changed:
Checking
test_positional_embedding_type_is_rotaryandtest_parallel_attn_mlp_is_true. The prior is tested via component mapping and architecture guards, but since it is an override, I test it none the less. For the latter as well, it overrides a default, so it is tested despite having checks in component mapping (Parallel block bridge) and architecture guards (no ln2).test_use_fast_is_falsechecks for attribute (assert adapter.cfg.use_fast is False) instead of checking dictionary in class definition. Is this acceptable?Under component mapping, we check for explicitly set flags in the adapter:
test_ln_final_use_native_layernorm_autograd_is_true,test_blocks_ln1_use_native_layernorm_autograd_is_truetest_attn_requires_attention_mask_is_truetest_attn_requires_position_embeddings_is_trueRelated to #1302
Type of change
Checklist: