Skip to content

Fix #218 - unable to load OpenELM #228

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

Merged
merged 1 commit into from
Mar 10, 2025
Merged

Fix #218 - unable to load OpenELM #228

merged 1 commit into from
Mar 10, 2025

Conversation

davidkoski
Copy link
Collaborator

- OpenELM had optional layers that were always created
- see #214
@davidkoski davidkoski requested a review from awni March 7, 2025 23:26
@ModuleInfo(key: "q_norm") var qNorm: RMSNorm
@ModuleInfo(key: "k_norm") var kNorm: RMSNorm
@ModuleInfo(key: "q_norm") var qNorm: RMSNorm?
@ModuleInfo(key: "k_norm") var kNorm: RMSNorm?
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These really should have been optional based on the config.

if !args.shareInputOutputLayers {
self._lmHead.wrappedValue = Linear(
args.numTransformerLayers, args.vocabularySize, bias: false)
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same -- this was the reported key.

out = lmHead(out)
} else {
out = matmul(out, transformer.embedTokens.weight.T)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't that use asLinear ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, good call -- it looks like there are quite a few uses of the bare property. I will file an issue for the rest.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, and I forgot to commit/push that. Well, I will hit it with #231

Copy link
Member

@awni awni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Left one comment, please take a look and merge when ready!

@davidkoski davidkoski merged commit fc9dfc1 into main Mar 10, 2025
1 check passed
@davidkoski davidkoski deleted the openelm-optional branch March 10, 2025 16:55
@davidkoski davidkoski changed the title Fix #218 Fix #218 - unable to load OpenELM Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants