search
HomeTechnology peripheralsAIApple builds an open source framework MLX for its own chips, implements Llama 7B and runs it on M2 Ultra

In November 2020, Apple launched the M1 chip, which was astonishingly fast and powerful. Apple will launch M2 in 2022, and in October this year, the M3 chip will officially debut.

When Apple releases its chips, it attaches great importance to its AI model training and deployment capabilities

The ML Compute launched by Apple can be used on Mac The TensorFlow model is trained on. PyTorch supports GPU-accelerated PyTorch machine learning model training on the M1 version of Mac, using Apple Metal Performance Shaders (MPS) as the backend. These enable Mac users to train neural networks locally.

Apple announced the launch of an open source array framework specifically for machine learning, which will run on Apple chips and is called MLX

苹果为自家芯片打造开源框架MLX,实现Llama 7B并在M2 Ultra上运行

MLX is a framework specifically designed for machine learning researchers to efficiently train and deploy AI models. The design concept of this framework is simple and easy to understand. Researchers can easily extend and improve MLX to quickly explore and test new ideas. The design of MLX is inspired by frameworks such as NumPy, PyTorch, Jax and ArrayFire

苹果为自家芯片打造开源框架MLX,实现Llama 7B并在M2 Ultra上运行

Project address: https://github .com/ml-explore/mlx

One of the MLX project contributors and Apple Machine Learning Research Team (MLR) research scientist Awni Hannun demonstrated a section using the MLX framework to implement Llama 7B and Video running on M2 Ultra.

苹果为自家芯片打造开源框架MLX,实现Llama 7B并在M2 Ultra上运行

MLX quickly attracted the attention of machine learning researchers. Chen Tianqi, author of TVM, MXNET and XGBoost, assistant professor at CMU and CTO of OctoML, retweeted: "Apple chips have a new deep learning framework."

苹果为自家芯片打造开源框架MLX,实现Llama 7B并在M2 Ultra上运行

Some people think that Apple has "repeated the same mistakes" again. This is an evaluation of MLX

苹果为自家芯片打造开源框架MLX,实现Llama 7B并在M2 Ultra上运行

In order to keep the original meaning unchanged, the content needs to be rewritten into Chinese. The original sentence does not need to appear

MLX features and examples

In this project, we can observe that MLX has the following main features

Familiar API. MLX has a Python API that is very NumPy-like, as well as a full-featured C API that is very similar to the Python API. MLX also has more advanced packages (such as mlx.nn and mlx.optimizers) whose APIs are very similar to PyTorch and can simplify building more complex models.

Combinable function transformation. MLX features composable function transformations with automatic differentiation, automatic vectorization, and computational graph optimization.

Lazy calculation. Computation in MLX is lazy and arrays are instantiated only when needed.

Dynamic graph construction. The calculation graph construction in MLX is dynamic, changing the shape of function parameters will not cause compilation to slow down, and debugging is simple and easy to use.

Multiple devices. Operations can be run on any supported device such as CPU and GPU.

Unified Memory. The significant difference between MLX and other frameworks is unified memory, array shared memory. Operations on MLX can run on any supported device type without moving data.

In addition, the project provides a variety of examples of using the MLX framework, such as the MNIST example, which can well help you learn how to use MLX

苹果为自家芯片打造开源框架MLX,实现Llama 7B并在M2 Ultra上运行

Image source: https://github.com/ml-explore/mlx-examples/tree/main/mnist

In addition to the above examples , MLX also provides other more practical examples, such as:

  • Transformer language model training;
  • LLaMA large-scale text generation and LoRA fine-tuning;
  • Stable Diffusion generation Image;
  • OpenAI’s Whisper speech recognition.

For more detailed documentation, please refer to: https://ml-explore.github.io/mlx/build/html/install.html

#

The above is the detailed content of Apple builds an open source framework MLX for its own chips, implements Llama 7B and runs it on M2 Ultra. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:51CTO.COM. If there is any infringement, please contact admin@php.cn delete
How to Build Your Personal AI Assistant with Huggingface SmolLMHow to Build Your Personal AI Assistant with Huggingface SmolLMApr 18, 2025 am 11:52 AM

Harness the Power of On-Device AI: Building a Personal Chatbot CLI In the recent past, the concept of a personal AI assistant seemed like science fiction. Imagine Alex, a tech enthusiast, dreaming of a smart, local AI companion—one that doesn't rely

AI For Mental Health Gets Attentively Analyzed Via Exciting New Initiative At Stanford UniversityAI For Mental Health Gets Attentively Analyzed Via Exciting New Initiative At Stanford UniversityApr 18, 2025 am 11:49 AM

Their inaugural launch of AI4MH took place on April 15, 2025, and luminary Dr. Tom Insel, M.D., famed psychiatrist and neuroscientist, served as the kick-off speaker. Dr. Insel is renowned for his outstanding work in mental health research and techno

The 2025 WNBA Draft Class Enters A League Growing And Fighting Online HarassmentThe 2025 WNBA Draft Class Enters A League Growing And Fighting Online HarassmentApr 18, 2025 am 11:44 AM

"We want to ensure that the WNBA remains a space where everyone, players, fans and corporate partners, feel safe, valued and empowered," Engelbert stated, addressing what has become one of women's sports' most damaging challenges. The anno

Comprehensive Guide to Python Built-in Data Structures - Analytics VidhyaComprehensive Guide to Python Built-in Data Structures - Analytics VidhyaApr 18, 2025 am 11:43 AM

Introduction Python excels as a programming language, particularly in data science and generative AI. Efficient data manipulation (storage, management, and access) is crucial when dealing with large datasets. We've previously covered numbers and st

First Impressions From OpenAI's New Models Compared To AlternativesFirst Impressions From OpenAI's New Models Compared To AlternativesApr 18, 2025 am 11:41 AM

Before diving in, an important caveat: AI performance is non-deterministic and highly use-case specific. In simpler terms, Your Mileage May Vary. Don't take this (or any other) article as the final word—instead, test these models on your own scenario

AI Portfolio | How to Build a Portfolio for an AI Career?AI Portfolio | How to Build a Portfolio for an AI Career?Apr 18, 2025 am 11:40 AM

Building a Standout AI/ML Portfolio: A Guide for Beginners and Professionals Creating a compelling portfolio is crucial for securing roles in artificial intelligence (AI) and machine learning (ML). This guide provides advice for building a portfolio

What Agentic AI Could Mean For Security OperationsWhat Agentic AI Could Mean For Security OperationsApr 18, 2025 am 11:36 AM

The result? Burnout, inefficiency, and a widening gap between detection and action. None of this should come as a shock to anyone who works in cybersecurity. The promise of agentic AI has emerged as a potential turning point, though. This new class

Google Versus OpenAI: The AI Fight For StudentsGoogle Versus OpenAI: The AI Fight For StudentsApr 18, 2025 am 11:31 AM

Immediate Impact versus Long-Term Partnership? Two weeks ago OpenAI stepped forward with a powerful short-term offer, granting U.S. and Canadian college students free access to ChatGPT Plus through the end of May 2025. This tool includes GPT‑4o, an a

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor