Merged
Conversation
karinazad
reviewed
Jul 2, 2025
|
|
||
| assert outputs[0].device == model.device | ||
|
|
||
| @pytest.mark.skip( |
karinazad
approved these changes
Jul 2, 2025
ncfrey
added a commit
that referenced
this pull request
Jul 7, 2025
* rope tests * skip test --------- Co-authored-by: freyn6 <freyn6@gene.com>
ncfrey
added a commit
that referenced
this pull request
Jul 7, 2025
* rope tests * skip test --------- Co-authored-by: freyn6 <freyn6@gene.com>
ncfrey
added a commit
that referenced
this pull request
Jul 7, 2025
* rope tests (#134) * rope tests * skip test --------- Co-authored-by: freyn6 <freyn6@gene.com> * update tokenizer * updates * save results * real layers * fix layers * Update uv.lock after merge --------- Co-authored-by: freyn6 <freyn6@gene.com>
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.
This pull request introduces enhancements to rotary embedding functionality, including a CPU fallback implementation, improved handling of flash attention availability, and comprehensive tests for the rotary embedding module. The most important changes are the addition of CPU-based rotary embedding methods, conditional fallback for environments without CUDA or flash attention, and new test cases to validate functionality and positional encoding behavior.
Enhancements to rotary embedding functionality:
apply_rotary_emb_cpuandapply_rotary_emb_unpad_cpumethods to enable rotary embedding on CPU for unpadded sequences. These methods ensure compatibility in environments without CUDA or flash attention. (src/lobster/model/modern_bert/_rotary.py, [1] [2]apply_rotary_emb_unpadto use the CPU fallback implementation when CUDA or flash attention is unavailable. (src/lobster/model/modern_bert/_rotary.py, src/lobster/model/modern_bert/_rotary.pyR219-R222)Improvements to testing:
UnpaddedRotaryEmbeddingand ensure positional encoding behavior. These tests check output correctness, device compatibility, and positional invariance. (tests/lobster/model/modern_bert/test_rotary.py, tests/lobster/model/modern_bert/test_rotary.pyR1-R144)tests/lobster/model/modern_bert/test_rotary.py, tests/lobster/model/modern_bert/test_rotary.pyR1-R144)Documentation update:
README.mdto include a new command for resolving flash attention installation issues during setup. (README.md, README.mdR87-R89)