-
Notifications
You must be signed in to change notification settings - Fork 85
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
Llama #270
Conversation
This file contains 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
dlwh
reviewed
Aug 8, 2023
raisin
reviewed
Aug 14, 2023
Ivan-Zhou
commented
Aug 16, 2023
btw i fixed the problem in latest haliax. You should still make them static
fields, but you won't get an error there
…On Wed, Aug 16, 2023 at 7:58 AM Ivan Zhou ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/levanter/models/llama.py
<#270 (comment)>
:
> + residual = x
+ x = self.ln_2(x)
+ mlp_output = self.mlp(x)
+ output = residual + mlp_output
+ return output
+
+
+class LlamaTransformer(StateDictSerializationMixin, eqx.Module):
+ config: LlamaConfig = eqx.static_field()
+ layers: Stacked[LlamaDecoderLayer]
+ ln_f: hnn.LayerNorm
+
+ @staticmethod
+ def init(config: LlamaConfig, *, key) -> "LlamaTransformer":
+ # TODO: here it reports an error that is related to _get_rotary_emb() in LlamaAttention
+ # TypeError: Output from batched function Axis(name='head_size', size=4) with type <class 'haliax.axis.Axis'> is not a valid JAX type
Will make a try
—
Reply to this email directly, view it on GitHub
<#270 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAACLIKWRMRODVFPZROCRK3XVTN3BANCNFSM6AAAAAA3BRV53M>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
dlwh
requested changes
Aug 28, 2023
Co-authored-by: David Hall <[email protected]>
Co-authored-by: David Hall <[email protected]>
Co-authored-by: David Hall <[email protected]>
Co-authored-by: David Hall <[email protected]>
Untie word_embeddings at LMHead is done. The only pending issue is Jax leakage when loading HF weight to Levanter's model. |
dlwh
reviewed
Aug 30, 2023
dlwh
approved these changes
Aug 30, 2023
Ivan-Zhou
commented
Aug 30, 2023
Ivan-Zhou
commented
Aug 30, 2023
Ivan-Zhou
commented
Aug 30, 2023
Great thanks to @dlwh for helping with the roundtrip tests and massively improve the code style & taste in this PR 👍 |
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.
Implement Llama based on HF implementation and the paper.
A few noteable difference from Gpt2:
call()
doesn't need key as input).Tasks