项目简介
MLX 是由 Apple 机器学习研究团队开发的数组框架,专为 Apple 芯片设计,提供类似 NumPy 和 PyTorch 的 API。支持可组合函数变换、惰性计算、动态图构建以及 CPU 和 GPU 的统一内存。旨在高效训练和部署机器学习模型。
README 预览
# MLX\n\n[**Quickstart**](#quickstart) | [**Installation**](#installation) |\n[**Documentation**](https://ml-explore.github.io/mlx/build/html/index.html) |\n[**Examples**](#examples)\n\n[](https://circleci.com/gh/ml-explore/mlx)\n\nMLX is an array framework for machine learning on Apple silicon,\nbrought to you by Apple machine learning research.\n\nSome key features of MLX include:\n\n- **Familiar APIs**: MLX has a Python API that closely follows NumPy. MLX\n also has fully featured C++, [C](https://github.com/ml-explore/mlx-c), and\n [Swift](https://github.com/ml-explore/mlx-swift/) APIs, which closely mirror\n the Python API. MLX has higher-level packages like `mlx.nn` and\n `mlx.optimizers` with APIs that closely follow PyTorch to simplify building\n more complex models.\n\n- **Composable function transformations**: MLX supports composable function\n transformations for automatic differentiation, automatic vectorization,\n and computation graph optimization.\n\n- **Lazy computation**: Computations in MLX are lazy. Arrays are only\n materialized when needed.\n\n- **Dynamic graph construction**: Computation graphs in MLX are constructed\n dynamically. Changing the shapes of function arguments does not trigger\n slow compilations, and debugging is simple and intuitive.\n\n- **Multi-device**: Operations can run on any of the supported devices\n (currently the CPU and the GPU).\n\n- **Unified memory**: A notable difference from MLX and other frameworks\n is the *unified memory model*. Arrays in MLX live in shared memory.\n Operations on MLX arrays can be performed on any of the supported\n device types without transferring data.\n\nMLX is designed by machine learning researchers for machine learning\nresearchers. The framework is intended to be user-friendly, but still efficient\nto train and deploy models. The design of the framework itself is also\nconceptually simple. We intend to make it easy for researchers to extend and\nimprove MLX with the