Commit Graph

704 Commits

Author SHA1 Message Date
Gökdeniz Gülmez
4a9d75ae4f
Merge branch 'ml-explore:main' into adding-dpo-training 2025-03-12 16:53:23 +01:00
Neil Mehta
4c3df00162
make_sampler creates sampler chain with all sampling parameters (#1330)
* top_p refactor

* top_k and min_p refactor

* Create sampler chain

* Remove unnecessary mx.where

* Use mx.allclose
2025-03-11 13:37:35 -07:00
Goekdeniz-Guelmez
4a4775557c udpate 2025-03-08 22:38:23 +01:00
Gökdeniz Gülmez
3aaf2d6c9f
Merge branch 'main' into adding-dpo-training 2025-03-08 10:07:48 +01:00
Awni Hannun
d2e02b3aae
fix mixed quant option (#1326) 2025-03-07 08:35:48 -08:00
Awni Hannun
595f5da146
remove lm head if unused (#1324) 2025-03-06 15:35:47 -08:00
cavit99
877d2a345b
Change DEFAULT_SEED to None for stochastic generation by default (#1323)
* Change DEFAULT_SEED to None for stochastic generation by default

* Update llms/mlx_lm/chat.py

* Update llms/mlx_lm/generate.py

---------

Co-authored-by: Awni Hannun <awni.hannun@gmail.com>
2025-03-06 06:49:35 -08:00
Awni Hannun
32d10036de
fix flaky test (#1322) 2025-03-05 14:00:09 -08:00
Gökdeniz Gülmez
e150621095
Adding multiple optimizers to mlx lm (#1315)
* initial commmit

* adding more customized YAML configuartion

* update YAML example file

* Changed the switch to set opt_class

* removing muon

* using default arguments

* udpate
2025-03-05 13:54:54 -08:00
Gökdeniz Gülmez
56d2db23e1
adding OLMoE architecture (#1321)
* initial commit

* udpate ACKNOWLEDGMENTS.md

* adding olmoe to training

* clean up

* faster generation

* remove sanitize method

* more clean ups

* adding SwitchGLU

* clean up

* a little faster and adding norm_topk_prob

* formated
2025-03-05 13:46:06 -08:00
Angelos Katharopoulos
e7267d30f8
Distributed support cifar (#1301) 2025-03-05 13:33:15 -08:00
Awni Hannun
f621218ff5
Tool use example (#1316)
* tool use example

* nits
2025-03-04 13:53:20 -08:00
Awni Hannun
65aa2ec849
use a bool mask for attention (#1319) 2025-03-04 12:47:32 -08:00
Gökdeniz Gülmez
2954398002
Merge branch 'ml-explore:main' into adding-dpo-training 2025-03-03 22:13:31 +01:00
Pierre-Louis
1bc3476a46
chore(lora): Add real-time log buffering fix for nohup execution (#1311)
* chore(lora): Add real-time log buffering fix for nohup execution

Disable Python stdout buffering to ensure logs appear in nohup.out in real-time instead of only after script completion.

* chore(lora): remove python 3.7+ check

* chore(lora): running pre-commit hook

---------

Co-authored-by: Pierre-Louis Létoquart <randlgint@proton.me>
2025-03-03 06:12:33 -08:00
Shunta Saito
269faa5fa4
Fix plamo2 model to use rms_norm (#1308)
* Fix plamo2 model to use rms_norm and enable sliding window attention

* Fix missing variable

* Remove sliding window attention impl. cause it should be done by using RotatingKVCache

* Remove unused imports
2025-03-03 06:12:02 -08:00
Goekdeniz-Guelmez
c119a7a4a5 updates 2025-03-01 12:47:13 +01:00
Gökdeniz Gülmez
8aeea10901
Merge branch 'main' into adding-dpo-training 2025-02-28 22:10:56 +01:00
Awni Hannun
845cd8c01e
support kimi + more options in chat mode (#1312) 2025-02-28 11:33:18 -08:00
Awni Hannun
b2108a0de6
Allow mask prompt in config (#1314) 2025-02-28 11:33:04 -08:00
madroid
eb73549631
Generate: Support Prefill Response (#1299)
* Generate: Support Prefill Prompt

python -m mlx_lm.generate \
       --model mlx-community/DeepSeek-R1-Distill-Qwen-1.5B-4bit \
       --prompt "hello" \
       --prefill-prompt "<think>\n"

* Generate: rename prefill-prompt to prefill-response

* nits

---------

Co-authored-by: Awni Hannun <awni.hannun@gmail.com>
2025-02-27 07:44:00 -08:00
Awni Hannun
00a7379070
Fixes for phi4 mini (#1305) 2025-02-26 16:21:54 -08:00
Awni Hannun
0f240a4c7e
Use max tokens from options in mlx_lm evaluate (#1302) 2025-02-26 15:46:16 -08:00
Awni Hannun
56e60ad5a6
fix manage for new transformers (#1304) 2025-02-26 15:44:57 -08:00
Pedro Cuenca
b7f742ef56
Mixed quant recipes (#1300)
* Mixed 3/6 and 2/6 recipes based on Alex Barron's

* format / nits

---------

Co-authored-by: Awni Hannun <awni.hannun@gmail.com>
2025-02-26 11:32:36 -08:00
Gökdeniz Gülmez
3387e06ccd
Merge branch 'ml-explore:main' into adding-dpo-training 2025-02-25 13:27:08 +01:00
Shunta Saito
c37e26a1a3
Add plamo-2-1b model (#1283)
* Add pfnet/plamo-2-1b

* Fix cache.py to support non-top level layers

* Use mlx's BaseModelArgs

* Fix model

* Use sanitize()

* Remove unnecessary changes

* Add plamo2.py

* Apply formatter

* Fix some part

* Allow a cache obj defined externally

* Fix channel first weights to channel last for right use of MLX's conv1d

* Remove unused code part

* Give all inputs when it's the first time call of model

* Fix import

* Include .jsonl files to download from Huggingface hub

* Fix reference to layers

* Remove unnecessary code and add a test for plamo2

* Do not pass mask to prepare_inputs_for_generation

* Fix to use repeat instead of tile

* Add state property to PlamoCache

* Add __iter__ and __next__ methods to PlamoCache

* cleanup

* cleanup

* fix

---------

Co-authored-by: Awni Hannun <awni.hannun@gmail.com>
2025-02-24 19:24:43 -08:00
Gökdeniz Gülmez
ea7ca22d10
Merge branch 'ml-explore:main' into adding-dpo-training 2025-02-22 19:11:15 +01:00
Usama Ahmed
09b641aaa7
Fix FutureWarning in torch.load by setting weights_only=True (#1295) 2025-02-22 06:08:54 -08:00
Gökdeniz Gülmez
d050911ab5
Merge branch 'ml-explore:main' into adding-dpo-training 2025-02-21 18:35:52 +01:00
Awni Hannun
3d793ecf68
Fix logits processor bugs with spec dec (#1291)
* Fix logits processor bugs with spec dec

* bump patch
2025-02-20 15:55:55 -08:00
Awni Hannun
85669451d0
Fix num layers in fine tune (#1294) 2025-02-20 13:32:01 -08:00
Gökdeniz Gülmez
6d5432b143
Merge branch 'ml-explore:main' into adding-dpo-training 2025-02-19 21:24:10 +01:00
Awni Hannun
1cbf5cdac7
use more standard window strategy (#1287) 2025-02-19 06:22:51 -08:00
Gökdeniz Gülmez
ab35c87911
Merge branch 'ml-explore:main' into adding-dpo-training 2025-02-18 17:17:49 +01:00
Matthias Neumayer
96bf37008e
Update README.md to include how to set temperature (#1280)
* Update README.md to include how to set temperature

* nits

---------

Co-authored-by: Awni Hannun <awni@apple.com>
2025-02-13 19:32:56 -08:00
Awni Hannun
7b07b14e67
add logits processor to spec gen (#1260) 2025-02-13 19:19:53 -08:00
Gökdeniz Gülmez
4b44434c54
Merge branch 'ml-explore:main' into adding-dpo-training 2025-02-12 11:09:58 +01:00
Awni Hannun
ec30dc3538
hunyuan finetune (#1270) 2025-02-11 16:49:35 -08:00
Awni Hannun
42413c5d85
fix lora timings after validation (#1278) 2025-02-11 16:48:55 -08:00
Awni Hannun
f8cbf159e0
fix sharding for more even number of layers (#1276) 2025-02-11 16:26:59 -08:00
Awni Hannun
e879ea70e1
fix generation evaluations (#1277) 2025-02-11 16:10:30 -08:00
Matt Clayton
3d677f0870
Add "from_draft" to GenerationResponse (#1272)
* Add from_draft field in GenerationResponse

* Cleanup

* Re-work for minimal changes, add test

* Fix comment
2025-02-11 15:41:02 -08:00
Awni Hannun
bded1a8fcd
fix looping in whisper (#1273) 2025-02-10 13:04:35 -08:00
Goekdeniz-Guelmez
3716946aae Merge branch 'adding-dpo-training' of https://github.com/Goekdeniz-Guelmez/mlx-examples into adding-dpo-training 2025-02-10 10:56:57 +01:00
Goekdeniz-Guelmez
aa932e83e3 nits 2025-02-10 10:56:50 +01:00
Gökdeniz Gülmez
16a3c7613f
Merge branch 'main' into adding-dpo-training 2025-02-10 10:55:39 +01:00
Chime Ogbuji
5865899c81
Completion only fine-tuning of instruction models with collections of HF datasets (#1103)
- Optional completion only fine-tuning with `--mask-prompt`
- Collections of Hugging Face datasets

---------

Co-authored-by: Awni Hannun <awni@apple.com>
2025-02-09 20:12:34 -08:00
Sri Harsha Pamu
1ced1b00ca
rm temp argument (#1267) 2025-02-09 11:39:11 -08:00
Awni Hannun
f58c7de901
Some improvements to speedup alignment computation in MLX Whisper (#1259)
* some improvements to speedup alignment computation in MLX Whisper

* fix alignment
2025-02-08 15:47:00 -08:00