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.
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
[models] Microsoft Phi 1.5 #1664
[models] Microsoft Phi 1.5 #1664
Changes from 12 commits
e7d81f5
6f3b8e9
7a38f33
2343963
6cd07e9
7781e60
2fec6af
70c8e03
505b5f3
0f730b8
1f664ec
be4b546
eeb4da4
0e408cf
4856e5d
f6942b5
6b7db71
8f97e39
de30260
bb1455c
6f7389b
4db31e4
029d77e
ee3419b
387f970
fccc70b
c098c1d
7ca6b73
09d8234
34d9adc
ab21cd9
ed1f59b
7b802b5
341ce91
f262f28
675130f
654322f
de09db6
b2d4587
8f2610d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, why is the
inv_freq
here different from the one in our RotaryEmbedding? According to this line, the code looks the same.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I also thought so until I checked the weight:
inv_freq
fromRotaryEmbedding
loaded_weight
ofrotary_emb.inv_freq
But even more surprising is that after I copied the cached weight, the output on
Test 4
was still different. However, @Linzecong says that it might be an issue of fp16 linkThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some investigations, I found that the issue is because
inv_freq
is stored in FP16 in the weight checkpoint (I guess it is calculated in FP32 and converted to FP16 for some reason). As we use the same logic to calculateinv_freq
, I think this slight difference should be acceptable.Can we remove the special weight loading logic for
inv_freq
and use our current implementation instead?