Open
Conversation
minghuaw
reviewed
Mar 2, 2026
mlx-lm/src/utils/rope.rs
Outdated
| } | ||
| } | ||
|
|
||
| impl mlx_rs::module::ModuleParameters for Llama3Rope { |
mlx-lm/src/utils/rope.rs
Outdated
| } | ||
| } | ||
|
|
||
| let freqs_array = Array::from_slice(&scaled_freqs, &[half_dims]); |
Collaborator
There was a problem hiding this comment.
Instead of converting to mlx array at the end, it might be better to start using mlx ops from the beginning
| Llama3(Llama3Rope), | ||
| } | ||
|
|
||
| impl mlx_rs::module::ModuleParameters for RopeVariant { |
Collaborator
There was a problem hiding this comment.
todo: support derive ModuleParameters for enum
mlx-lm/src/utils/rope.rs
Outdated
| } | ||
| } | ||
|
|
||
| fn get_float_from_config( |
Collaborator
There was a problem hiding this comment.
str variant aren't just float point numbers in string format, there could be values like "default" and "linear" for example.
c591a5d to
6c4016c
Compare
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 PR attempts to support
meta-llama/Llama-3.2-1B-InstructReference implementation: https://github.com/ml-explore/mlx-examples/blob/main/llms/llama/llama.py
To test, run
hf download meta-llama/Llama-3.2-1B-Instructand the model folder should appear in~/.cache/huggingface/hub/models--meta-llama--Llama-3.2-1B-Instruct/snapshots/<commit_hash>