Skip to content
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

Error: "Failed: keyNotFound(base: "Linear", key: "weight")" for Qwen LLMs with mlx-swift 0.21.3 #210

Closed
adrgrondin opened this issue Feb 21, 2025 · 3 comments

Comments

@adrgrondin
Copy link

I updated the project to use mlx-swift 0.21.3 and it broke the Qwen LLMs. It seems that is started with this commit on mlx-swift with the changes to MLXNN/Module.swift.

Here is the error I'm getting:
Failed: keyNotFound(base: "Linear", key: "weight")

And the model tested:
mlx-community/Qwen1.5-0.5B-Chat-4bit
mlx-community/Qwen2.5-7B-Instruct-4bit
mlx-community/Qwen2.5-1.5B-Instruct-4bit

Not sure if it can be fixed by updating the implementation in this repo or an update to mlx-swift is needed but thought I would create this issue if someone with more knowledge knows what's going on.

Thanks to all the maintainer of this project. It's amazing!

@rudrankriyam
Copy link
Contributor

Mentioned here: #214

For now, I downgraded to 0.21.2 in a fork of mlx-swift-example

@davidkoski
Copy link
Collaborator

davidkoski commented Feb 26, 2025

See also #214 -- this has an explanation of what is going on and why. Now we need to figure out if the parameters are really missing and why they are missing -- if they are, the error seems to be correct.

@davidkoski
Copy link
Collaborator

Closing this as #214 is tracking the work -- thank you for the ids of the problematic models.

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

No branches or pull requests

3 participants