Comments (10)
There is an issue compiling the model during the training step. Before it gets fixed, you can manually delete this line in the Lora trainer: https://github.com/ml-explore/mlx-examples/blob/main/llms/mlx_lm/tuner/trainer.py#L192
cc @awni I created a PR to remove the compile step in the Lora trainer, but I'm not sure if you plan on implementing a proper fix or not. Please feel free to close that PR if it doesn't fit the purpose.
from mlx-examples.
Thanks, it works now :)
from mlx-examples.
Line 192 removal does not work for me
Loading pretrained model
Trainable parameters: 0.005% (2.229M/46702.793M)
Loading datasets
Training
Starting training..., iters: 1000
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/Users/pro/mambaforge/envs/torch/lib/python3.11/site-packages/mlx_lm/lora.py", line 257, in <module>
run(types.SimpleNamespace(**args))
File "/Users/pro/mambaforge/envs/torch/lib/python3.11/site-packages/mlx_lm/lora.py", line 204, in run
train(
File "/Users/pro/mambaforge/envs/torch/lib/python3.11/site-packages/mlx_lm/tuner/trainer.py", line 219, in train
lvalue, toks = step(batch)
^^^^^^^^^^^
File "/Users/pro/mambaforge/envs/torch/lib/python3.11/site-packages/mlx_lm/tuner/trainer.py", line 195, in step
(lvalue, toks), grad = loss_value_and_grad(model, *batch)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/pro/mambaforge/envs/torch/lib/python3.11/site-packages/mlx/nn/utils.py", line 34, in wrapped_value_grad_fn
value, grad = value_grad_fn(model.trainable_parameters(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: [reshape] Cannot reshape array of size 32 into shape (32,4096).
from mlx-examples.
Very odd.. I'm unable to reproduce that problem. Which version of MLX are you using? Which version of MLX LM?
from mlx-examples.
mlx 0.8.0 mlx LM 0.4.0 . Got the same error as @Satyam7166-tech . This one is after line 192 fixing proposed by @mzbac
from mlx-examples.
Could you share the command?
from mlx-examples.
python -m mlx_lm.lora --model ./mixtral4b-mlx-instruct --adapter-file adapters-plucv3.npz --data ./datapluc --batch-size 2 --train --iters 1000 --lora-layers 16
from mlx-examples.
I see.. I think this was actually from the bug here that was introduced in 0.8 and just fixed.
Sorry about that. You can revert to 0.7 (or build MLX from source) until we have a patch release / 0.9 is out.
from mlx-examples.
I'm going to close this issue because we landed the compile fix. Everything is working on main so it will be a few days at most until this percolates into our relese.
Sorry for the noise here.. we're working on some regression testing for this model to keep us honest.
from mlx-examples.
This should work now with the latest MLX, if you do pip install -U mlx
.
from mlx-examples.
Related Issues (20)
- GatedRepoError: 401 Client Error; "You must be authenticated to access it." HOT 1
- [Feature Request] When generating using mlx_lm, specify data format HOT 2
- how to merge lora adapter to base model HOT 1
- delete and uninstall HOT 11
- KV Cache can only process more than self.step tokens if offset % step == 0 HOT 2
- Text to Speech MLX model. HOT 1
- SLM Example Code HOT 1
- Enhance load function to support model configuration editing HOT 1
- Support for full set of output formats - e.g. vtt, json and json-full HOT 2
- Whisper stutters HOT 8
- mlx 0.13 very slow with q8 and fp16 HOT 5
- Fine tuned a Mixtral-8x7B-Instruct-v0.1 model and unable to load with AutoModelForCausalLM HOT 1
- Phi-3-mini-4k-instruct : Failing to stop at <|end|> on generating the answer. HOT 5
- PaliGemma 4bit Quantization broken and Inference issues. HOT 27
- [Feature Request] Function Calling for mlx_lm.server HOT 4
- OS system requirement for mlx HOT 1
- 01-ai/Yi-1.5-9B-Chat got ValueError: Cannot instantiate this tokenizer from a slow version. HOT 4
- CLIP Tokenizer unable to take text of unequal length (or token length) HOT 7
- Package 'mlx_whisper.assets' is absent from the `packages` configuration HOT 1
- [Feature Request] Add support for logprobs to the mlx_lm server HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mlx-examples.