Chapter 28
使用 Apple MLX 框架对 Phi-3.5 进行量化
使用 Apple MLX 框架对 Phi-3.5 进行量化
MLX 是一个面向 Apple 硅芯片的机器学习研究数组框架,由 Apple 机器学习研究团队推出。
MLX 由机器学习研究人员为机器学习研究人员设计。该框架旨在用户友好,同时在训练和部署模型时保持高效。框架本身的设计也非常简洁。我们的目标是让研究人员能够轻松扩展和改进 MLX,以便快速探索新想法。
通过 MLX,Apple 硅芯片设备上的大型语言模型(LLMs)可以加速运行,且模型可以非常方便地在本地执行。
目前 Apple MLX 框架支持 Phi-3.5-Instruct 的量化转换(Apple MLX Framework support)、Phi-3.5-Vision(MLX-VLM Framework support)以及 Phi-3.5-MoE(Apple MLX Framework support)。接下来让我们试试:
Phi-3.5-Instruct
python -m mlx_lm.convert --hf-path microsoft/Phi-3.5-mini-instruct -qPhi-3.5-Vision
python -m mlxv_lm.convert --hf-path microsoft/Phi-3.5-vision-instruct -qPhi-3.5-MoE
python -m mlx_lm.convert --hf-path microsoft/Phi-3.5-MoE-instruct -q🤖 Apple MLX 上 Phi-3.5 的示例
| 实验室 | 介绍 | 进入 |
|---|---|---|
| 🚀 Lab-Introduce Phi-3.5 Instruct | 学习如何使用 Apple MLX 框架运行 Phi-3.5 Instruct | 进入 |
| 🚀 Lab-Introduce Phi-3.5 Vision (image) | 学习如何使用 Apple MLX 框架通过 Phi-3.5 Vision 分析图像 | 进入 |
| 🚀 Lab-Introduce Phi-3.5 Vision (moE) | 学习如何使用 Apple MLX 框架运行 Phi-3.5 MoE | 进入 |
资源
-
了解 Apple MLX 框架 https://ml-explore.github.io/mlx/
-
Apple MLX GitHub 仓库 https://github.com/ml-explore
-
MLX-VLM GitHub 仓库 https://github.com/Blaizzy/mlx-vlm
免责声明:
本文件使用 AI 翻译服务 Co-op Translator 进行翻译。虽然我们力求准确,但请注意自动翻译可能包含错误或不准确之处。原始文件的母语版本应被视为权威来源。对于重要信息,建议使用专业人工翻译。对于因使用本翻译而产生的任何误解或误释,我们不承担任何责任。
