Linux 上默认包不含 CUDA,需装 mlx[cuda];纯 CPU 的 Linux 环境要装 mlx[cpu];示例代码在单独的 mlx-examples 仓库,不在本仓库内。
pip install mlx面向 Apple silicon;README 说明运算可跑在 CPU 和 GPU 上,Linux 另提供 CUDA 后端和纯 CPU 包,但未给出具体显存或 GPU 型号要求。
Apple 出品的数组框架,让 Mac 统一内存上高效训练和部署模型
面向 Apple silicon 的数组计算框架,让机器学习模型能直接在 Mac 芯片上高效训练和推理,省去折腾 CUDA 的麻烦。
核心能力
- Python API 贴近 NumPy,mlx.nn 和 mlx.optimizers 贴近 PyTorch
- 支持自动微分、自动向量化与计算图优化的可组合变换
- 惰性计算,数组仅在需要时才实际生成
- 动态构建计算图,改形状不触发慢编译,便于调试
- 统一内存模型,CPU 与 GPU 间无需拷贝数据
容易踩的坑
- v0.32.4最新正式版2026-10-14 · 2026-10-14 23:37 UTC
What's Changed
- Adding VJP for the scaled dot product attention. by @tpegolotti in https://github.com/ml-explore/mlx/pull/4563
- python: Add pos support to array by @aaishwarymishra in https://github.com/ml-explore/mlx/pull/4488
- Add Python 3.15 and 3.15t support by @XXXXRT666 in https://github.com/ml-explore/mlx/pull/4555
- Add fixed size
uniqueoperation by @louen in https://github.com/ml-explore/mlx/pull/4501 - Fix normalizing single-element slice with negative stride by @axiom-of-choice in https://github.com/ml-explore/mlx/pull/4446
- Patch bump to 0.32.4 by @zcbenz in https://github.com/ml-explore/mlx/pull/4582
- Adding VJP for gated delta net. by @tpegolotti in https://github.com/ml-explore/mlx/pull/4565
- Fix
col_reduce_longcolumnfor negative-stride views by @mateuuszzzzz in https://github.com/ml-explore/mlx/pull/4529 - Clear CUDA errors once reported and raise eval errors in buffer protocol by @aleroot in https://github.com/ml-explore/mlx/pull/4523
- Improve pre-M5 metal memory usage for SDPA D512 by @dhiltgen in https://github.com/ml-explore/mlx/pull/4518
- Fix split data size span by @michalk8 in https://github.com/ml-explore/mlx/pull/4540
- Re-introduce Array API Tests suite by @prady0t in https://github.com/ml-explore/mlx/pull/4433
- Fix view inside of a vmap by @michalk8 in https://github.com/ml-explore/mlx/pull/4586
- Fix cumsum of a non-contiguous bool by @michalk8 in https://github.com/ml-explore/mlx/pull/4590
- docs: contraction dtype requirements in matmul/einsum by @simeetnayan81 in https://github.com/ml-explore/mlx/pull/4550
- Fixing cooperative tensor build issues on Mac OS 27 by @tpegolotti in https://github.com/ml-explore/mlx/pull/4594
- Handle EOF and EINTR in ParallelFileReader::read by @Ritabanm in https://github.com/ml-explore/mlx/pull/4532
- Clamp slice bounds when a slice is combined with an array index by @IshaanPotle in https://github.com/ml-explore/mlx/pull/4513
- Fixes grouped Conv1d/Conv2d init to use in_channels // groups by @CodeWithMoin in https://github.com/ml-explore/mlx/pull/4544
- Fix mx.view misaligned offset by @michalk8 in https://github.com/ml-explore/mlx/pull/4585
- [CUDA] Add fp_gather_qmv to optimize gather_qmm by @dhiltgen in https://github.com/ml-explore/mlx/pull/4508
- Fix eval cleanup deadlock by committing GPU streams before waiting by @ronaldmannak in https://github.com/ml-explore/mlx/pull/4556
- Fix shared_buffer_reshape contiguity flags by @michalk8 in https://github.com/ml-explore/mlx/pull/4589
- Fix view last axis stride by @michalk8 in https://github.com/ml-explore/mlx/pull/4587
- Fix empty unsigned sum/prod failing on Metal by @CodeWithMoin in https://github.com/ml-explore/mlx/pull/4546
- [CUDA] Add gather_qmm_rhs_sm80 by @dhiltgen in https://github.com/ml-explore/mlx/pull/4554
- python: Fix bare ellipsis setitem by squeezing leading singleton dimensions by @shaeantoine in https://github.com/ml-explore/mlx/pull/4561
- Fix row/col contiguous flags in view by @michalk8 in https://github.com/ml-explore/mlx/pull/4588
- Do not cache failed distributed backend initialization by @ronaldmannak in https://github.com/ml-explore/mlx/pull/4558
- Fix reduction over large arrays by @nicoloangileri in https://github.com/ml-explore/mlx/pull/4549
- docs: Correct the export callback type in the guide by @ssmall256 in https://github.com/ml-explore/mlx/pull/4578
- Fix MultiOptimizer crash when an optimizer's group is empty by @ishtihoss in https://github.com/ml-explore/mlx/pull/4570
- Fix fft size one by @michalk8 in https://github.com/ml-explore/mlx/pull/4591
- Sanitize '-' in make_template_hash for metal kernel by @gokay-ai in https://github.com/ml-explore/mlx/pull/4584
- Fix as_strided contiguity by @sofinvalery in https://github.com/ml-explore/mlx/pull/4575
- Reject non-aligned pointers when converting to mx.array by @michalk8 in https://github.com/ml-explore/mlx/pull/4592
- Fix conjugation in complex VJPs for inverse trig ops,
- v0.32.32026-09-29 · 2026-09-29 00:37 UTC
查看更新说明
What's Changed
- Fix scan and sort for a zero-size axis by @eyupcanakman in https://github.com/ml-explore/mlx/pull/4340
- Add a correction parameter in std and var by @prady0t in https://github.com/ml-explore/mlx/pull/4348
- Fix tests/run.py stuck in macOS CI by @zcbenz in https://github.com/ml-explore/mlx/pull/4410
- Extension Example Updated by @jagrit06 in https://github.com/ml-explore/mlx/pull/4412
- Fix sorted gather_qmm NAX row overflow above 32K by @PhilipJohnBasile in https://github.com/ml-explore/mlx/pull/3922
- Fix deadlock caused by mx.clear_streams() holding GIL by @aleroot in https://github.com/ml-explore/mlx/pull/4413
- Fix integer pow zeroing a whole SIMD vector on a negative exponent by @ayaangazali in https://github.com/ml-explore/mlx/pull/4354
- Make concurrency cap on load adaptative so that I/O scales with the machine by @aleroot in https://github.com/ml-explore/mlx/pull/4408
- Fix pad with an axes subset and negative axes by @kapellirohith in https://github.com/ml-explore/mlx/pull/4364
- Use sdpa_vector_2pass_1_gqa for GQA size 12 and 16 by @dudududukim in https://github.com/ml-explore/mlx/pull/4380
- python: Make axis of put_along_axis optional by @ayaangazali in https://github.com/ml-explore/mlx/pull/4360
- python: Make axis default to -1 in take_along_axis by @aaishwarymishra in https://github.com/ml-explore/mlx/pull/4368
- Propagate NaN in arg reductions by @atirna in https://github.com/ml-explore/mlx/pull/4291
- Fix mx.from_fp8 E4M3FN NaN decode with branchless carry by @saud5150 in https://github.com/ml-explore/mlx/pull/4376
- Update rules for PR limitation bypass list by @zcbenz in https://github.com/ml-explore/mlx/pull/4415
- [CUDA] Use native events for GPU fence waits by @strayberry in https://github.com/ml-explore/mlx/pull/4401
- Validate GGUF tensor dimensions by @roshaninfordham in https://github.com/ml-explore/mlx/pull/4378
- Fix crash on ellipsis indexing with too many trailing indices by @Adityaj0 in https://github.com/ml-explore/mlx/pull/4396
- [CUDA] Cholesky via cuSOLVER by @sashko-zakharchuk in https://github.com/ml-explore/mlx/pull/4208
- python: Fix setitem with negative index preceded by None by @Adityaj0 in https://github.com/ml-explore/mlx/pull/4414
- Update nanobind to 3.0.1 by @XXXXRT666 in https://github.com/ml-explore/mlx/pull/4417
- chore: Use normalize_axis_index in scan ops by @Adityaj0 in https://github.com/ml-explore/mlx/pull/4383
- python: Add explicit index and bytes support by @aaishwarymishra in https://github.com/ml-explore/mlx/pull/4388
- docs: fix typo recived -> received by @vaibhav8a in https://github.com/ml-explore/mlx/pull/4424
- Fix Metal grid sizing for strided scans by @TheDarkchip in https://github.com/ml-explore/mlx/pull/4420
- Fix SGD and Adafactor weight decay mutating caller arrays by @2sumtech in https://github.com/ml-explore/mlx/pull/4426
- Widen float16/bfloat16 to float32 in cpu reduce by @Ved235 in https://github.com/ml-explore/mlx/pull/4387
- sdpa_vector_2pass_1_gqa kernel batch offset for K/V in gqa decode by @dudududukim in https://github.com/ml-explore/mlx/pull/4431
- Make head-dim-256 prefill with array mask run fused NAX kernel by @dwijenpatel in https://github.com/ml-explore/mlx/pull/4416
- python: Make unstack return tuple instead of list by @JasonHonKL in https://github.com/ml-explore/mlx/pull/4448
- python: Make iter() throw TypeError for 0-dim array by @simeetnayan81 in https://github.com/ml-explore/mlx/pull/4425
- Fix save and save_safetensors corrupting a lazily loaded source file by @Cdimoy in https://github.com/ml-explore/mlx/pull/4434
- [Metal] Use hypot for complex ops by @JasonHonKL in https://github.com/ml-explore/mlx/pull/4345
- Add get_array_buffer_size to query buffer size for arrays by @aleroot in https://github.com/ml-explore/mlx/pull/4436
- Add M5 ultra tunings for non-quantized matmuls by @jagrit06 in https://github.com/ml-explore/mlx/pull/4447
- [CUDA] Fix completion worker busy l
- v0.32.22026-08-25 · 2026-08-25 10:58 UTC
查看更新说明
What's Changed
- Preserve subnormal float values when casting to bool by @reckylurker in https://github.com/ml-explore/mlx/pull/4224
- Support assigning through a bare Ellipsis index by @Adityaj0 in https://github.com/ml-explore/mlx/pull/4314
- Fix divmod truncating the quotient for floats by @ayaangazali in https://github.com/ml-explore/mlx/pull/4108
- Add force_fused option to scaled_dot_product_attention by @hojin12312 in https://github.com/ml-explore/mlx/pull/4185
- Reject a negative eps in the normalization layers by @ayaangazali in https://github.com/ml-explore/mlx/pull/4312
- Bound GGUF metadata string/array values against the file mapping by @x14ngch3n in https://github.com/ml-explore/mlx/pull/4212
- Read each K/V byte once in gqa-8 decode attention by @dudududukim in https://github.com/ml-explore/mlx/pull/4077
- Fix fft vmap and jvp for transforms over a subset of axes by @kapellirohith in https://github.com/ml-explore/mlx/pull/4138
- Fix median dropping NaN by @devteamaegis in https://github.com/ml-explore/mlx/pull/4146
- Fix the CPU scan over a size one axis with a padded stride by @kapellirohith in https://github.com/ml-explore/mlx/pull/4139
- Validate the optimizer betas at construction by @ayaangazali in https://github.com/ml-explore/mlx/pull/4310
RMSNormVJPbackward writes a full{n_rows, D}gw_tempintermediate by @JasonHonKL in https://github.com/ml-explore/mlx/pull/4293- [Bug]: add default none value to axis parameter of the take_along_axis by @aaishwarymishra in https://github.com/ml-explore/mlx/pull/4357
- Add a fused full-attention path for head_dim 256 on NAX devices by @wyanzhao in https://github.com/ml-explore/mlx/pull/3842
- Update nanobind to 2.15.0 by @XXXXRT666 in https://github.com/ml-explore/mlx/pull/4337
- Skip unnecessary simdgroup computations for quantised MOE matmuls on NAX by @RohanGautam in https://github.com/ml-explore/mlx/pull/4352
- Add AI usage policy by @zcbenz in https://github.com/ml-explore/mlx/pull/4331
- Raise cpu stream errors from synchronize by @robertomeroni in https://github.com/ml-explore/mlx/pull/4338
- chore: Validate eps in Adam at construction by @vraj00222 in https://github.com/ml-explore/mlx/pull/4361
- Bound winograd conv2d working set by tiling the batch by @Gusanidas in https://github.com/ml-explore/mlx/pull/4102
- Use a 32-row block in qmm_t_nax when one block covers all of M by @dwijenpatel in https://github.com/ml-explore/mlx/pull/4171
- Deduplicate fftshift and ifftshift by @Adityaj0 in https://github.com/ml-explore/mlx/pull/4318
- Fix Log and Equal is_equivalent ignoring primitive state by @kapellirohith in https://github.com/ml-explore/mlx/pull/4266
- Stabilize reduced-precision InstanceNorm by @ternaus in https://github.com/ml-explore/mlx/pull/4230
- Normalize negative axes in sort and argsort by @deBrian07 in https://github.com/ml-explore/mlx/pull/4332
- Clean up main thread compile cache before python interpreter shuts down by @zcbenz in https://github.com/ml-explore/mlx/pull/4373
- chore: Check malformed jaccl hostfile that miss rdma in pairs by @erwinzhang7 in https://github.com/ml-explore/mlx/pull/4284
- Round mxfp8 block scales up to avoid saturation by @dhiltgen in https://github.com/ml-explore/mlx/pull/4353
- Add support for the array_namespace_info by @aaishwarymishra in https://github.com/ml-explore/mlx/pull/4334
- Stop a failed CUDA graph commit from poisoning the encoder by @strayberry in https://github.com/ml-explore/mlx/pull/4356
- Fix quantized kernels in JIT build by @dwijenpatel in https://github.com/ml-explore/mlx/pull/4372
- [Metal][Performance] Avoid zero work in stride-2 ConvTranspose3d by @ternaus in https://github.com/ml-explore/mlx/pull/4343
- [CUDA] Ce fused kernel by @nastya236 in https://github.com/ml-explore/mlx/pull/3947
- Fix cpu exclusive scan for complex numbers by @ayaangazali in https://github.com/ml-explore/mlx/pull/4272
- Support Relocatable CUDA DLLs on Windows by @dhiltg
- v0.32.12026-08-18 · 2026-08-18 03:45 UTC
查看更新说明
What's Changed
- Fix int64 type cast error when loading GGUF metadata arrays by @danlee2002 in https://github.com/ml-explore/mlx/pull/3823
- Document default values in normalization layer docstrings by @Pablosinyores in https://github.com/ml-explore/mlx/pull/3819
- Warn at configure time when NAX kernels are disabled by @pierre427 in https://github.com/ml-explore/mlx/pull/3824
- [CUDA][Improvement] RMSNorm forward speed up by @nastya236 in https://github.com/ml-explore/mlx/pull/3850
- Fix captured random state in compile by @angeloskath in https://github.com/ml-explore/mlx/pull/3828
- Fix JIT preamble header filter matching project paths containing "Xcode" by @apocryphx in https://github.com/ml-explore/mlx/pull/3873
- Document default value of p in dropout layer docstrings by @ayaangazali in https://github.com/ml-explore/mlx/pull/3870
- [WIP] [CUDA] fsdp by @nastya236 in https://github.com/ml-explore/mlx/pull/3768
- Fix triplet_loss docstring to document the reduced output shape by @ayaangazali in https://github.com/ml-explore/mlx/pull/3884
- Zero-copy CPU import: mx.array(host_buffer, copy=False) on unified memory by @HaoXuAI in https://github.com/ml-explore/mlx/pull/3872
- Round MLX_SDPA_BLOCKS up to a multiple of 32 by @pierre427 in https://github.com/ml-explore/mlx/pull/3875
- Reuse Metal WAR tracking hash tables by @neilmehta24 in https://github.com/ml-explore/mlx/pull/3882
- Use unroll_count(4) for the NAX attention [email protected] loop by @wyanzhao in https://github.com/ml-explore/mlx/pull/3843
- metal: add gemv_wide for fp16/bf16 matmuls of a few rows by @jessegross in https://github.com/ml-explore/mlx/pull/3888
- Fix broken docstring rendering in Linear and RNN by @ayaangazali in https://github.com/ml-explore/mlx/pull/3890
- Fix Adamax betas docstring and MultiOptimizer filters type by @ayaangazali in https://github.com/ml-explore/mlx/pull/3889
- Fix incorrect nvfp4 quantized_matmul through the split-K path by @metascroy in https://github.com/ml-explore/mlx/pull/3854
- [Metal] Avoid regex in custom kernel name generation by @aleroot in https://github.com/ml-explore/mlx/pull/3869
- Fix prod dtype promotion when reducing a size-1 axis by @eyupcanakman in https://github.com/ml-explore/mlx/pull/3898
- [CUDA] Fix grid overflow in gemm conv unfold kernels for >= 65,536 output positions by @AdamDLuz in https://github.com/ml-explore/mlx/pull/3893
- [CUDA] columnwise quantize with tma by @nastya236 in https://github.com/ml-explore/mlx/pull/3157
- metal: reduce NVFP4 scales per 16-lane group by @jessegross in https://github.com/ml-explore/mlx/pull/3934
- Update homebrew in CI by @angeloskath in https://github.com/ml-explore/mlx/pull/3946
- Make index autodiff errors explicitly recommend stop_gradient by @dogukanveziroglu in https://github.com/ml-explore/mlx/pull/3820
- Making JACCL coordinator optional by @angeloskath in https://github.com/ml-explore/mlx/pull/3899
- Fix docstring mismatches in the Python bindings by @ayaangazali in https://github.com/ml-explore/mlx/pull/3948
- Raise a clear error for an invalid quantization mode in nn layers by @ayaangazali in https://github.com/ml-explore/mlx/pull/3914
- Fix incorrect examples and outputs in the usage docs by @ayaangazali in https://github.com/ml-explore/mlx/pull/3956
- Skip test_gather_qmm_sorted cpu test on M1 mac by @zcbenz in https://github.com/ml-explore/mlx/pull/3973
- Fixes an axis mismatch bug in matrix norm for case -1 and 1 by @danlee2002 in https://github.com/ml-explore/mlx/pull/3827
- Fix BatchNorm running variance estimator by @ishtihoss in https://github.com/ml-explore/mlx/pull/3817
- Fix build error caused by TMA macro guard by @zcbenz in https://github.com/ml-explore/mlx/pull/3988
- Fix Glorot/He uniform init docstrings to label the uniform bound, not sigma by @vineethsaivs in https://github.com/ml-explore/mlx/pull/3831
- Fix custom metal kernel cache collision for same name, different source by @katlun-lgtm in https://github.com/m
- v0.32.02026-07-07 · 2026-07-07 22:29 UTC
查看更新说明
What's Changed
- Generate qmm implementaions with cmake by @zcbenz in https://github.com/ml-explore/mlx/pull/3424
- Enable swap for all CI building CUDA by @zcbenz in https://github.com/ml-explore/mlx/pull/3437
- Bump minor by @angeloskath in https://github.com/ml-explore/mlx/pull/3438
- [CUDA] Fix qmm_naive K-tail dispatch for FP quantized kernels by @Lyxot in https://github.com/ml-explore/mlx/pull/3445
- Keep gguflib input-validation asserts active in release builds by @qflen in https://github.com/ml-explore/mlx/pull/3436
- Reuse nightly build's ccache for release by @zcbenz in https://github.com/ml-explore/mlx/pull/3458
- Add barrier to JACCL by @Isalia20 in https://github.com/ml-explore/mlx/pull/3459
- Add determinant and sign-log-determinant functions to mlx.core.linalg by @abhilashreddys in https://github.com/ml-explore/mlx/pull/3416
- Define ST_F8_E8M0 by @pcuenca in https://github.com/ml-explore/mlx/pull/3448
- Clearer error when shape dimension overflows int32 by @serenposh in https://github.com/ml-explore/mlx/pull/3425
- [CUDA] Fix half type matmul in cutlass kernels by @zcbenz in https://github.com/ml-explore/mlx/pull/3469
- Fix indexing bug in slice update with op by @angeloskath in https://github.com/ml-explore/mlx/pull/3483
- Make device_count() return 0 when there is no GPU by @zcbenz in https://github.com/ml-explore/mlx/pull/3486
- Compute contiguity from the actual occupied data by @sofinvalery in https://github.com/ml-explore/mlx/pull/3475
- Do not use prebuilt cpu compile preamble when headers are installed by @zcbenz in https://github.com/ml-explore/mlx/pull/3463
- [CUDA] Separate main loop into a function in qmm by @zcbenz in https://github.com/ml-explore/mlx/pull/3443
- test: Upcast the random numbers before computing their average by @sofinvalery in https://github.com/ml-explore/mlx/pull/3488
- Pass deployment target when linking metallib by @dhiltgen in https://github.com/ml-explore/mlx/pull/3501
- Fix rope single token multiple sequences by @angeloskath in https://github.com/ml-explore/mlx/pull/3498
- Fix qvm_split_k incorrect batch stride calculation by @angeloskath in https://github.com/ml-explore/mlx/pull/3497
- Fix scatter_prod GPU hang on NaN with contention by @tillahoffmann in https://github.com/ml-explore/mlx/pull/3492
- [jaccl] Fix race on local_staging in MeshImpl::all_reduce by @kernelpool in https://github.com/ml-explore/mlx/pull/3451
- Add MLX_SDPA_BLOCKS env var for 2-pass vector kernel block-count override by @adurham in https://github.com/ml-explore/mlx/pull/3455
- mlx launch clean by @nastya236 in https://github.com/ml-explore/mlx/pull/3513
- [CUDA] Fix gather_mm by @zcbenz in https://github.com/ml-explore/mlx/pull/3503
- [CUDA] Guard qmm_naive scale and bias loads at tile boundaries by @Lyxot in https://github.com/ml-explore/mlx/pull/3509
- win: fix cuda build by @dhiltgen in https://github.com/ml-explore/mlx/pull/3532
- Improve DLPack-compatible array imports by @XXXXRT666 in https://github.com/ml-explore/mlx/pull/3495
- Apply the same thread-local approach to the CPU by @angeloskath in https://github.com/ml-explore/mlx/pull/3537
- removed automatic prepending python in mlx launch by @nastya236 in https://github.com/ml-explore/mlx/pull/3536
- ci: Show stack trace on crash by @zcbenz in https://github.com/ml-explore/mlx/pull/3538
- Handle non-multiple-of-8 spatial dims in depthwise conv2d Metal path by @qflen in https://github.com/ml-explore/mlx/pull/3446
- Remove reference to groups in Conv3D extra_repr by @GriffinMB in https://github.com/ml-explore/mlx/pull/3559
- Add buffer caching to no_gpu CPU allocator by @dhiltgen in https://github.com/ml-explore/mlx/pull/3554
- Fix steel GEMM safe load offset by @sofinvalery in https://github.com/ml-explore/mlx/pull/3560
- Fix singleton lifetime issues at process exit by @dhiltgen in https://github.com/ml-explore/mlx/pull/3555
- Fix doubled-word typos in docstrings by @LeSingh1 in https://github.com/ml-e
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
MLX
Quickstart | Installation | Documentation | Examples
MLX is an array framework for machine learning on Apple silicon, brought to you by Apple machine learning research.
Some key features of MLX include:
-
Familiar APIs: MLX has a Python API that closely follows NumPy. MLX also has fully featured C++, C, and Swift APIs, which closely mirror the Python API. MLX has higher-level packages like
mlx.nnandmlx.optimizerswith APIs that closely follow PyTorch to simplify building more complex models. -
Composable function transformations: MLX supports composable function transformations for automatic differentiation, automatic vectorization, and computation graph optimization.
-
Lazy computation: Computations in MLX are lazy. Arrays are only materialized when needed.
-
Dynamic graph construction: Computation graphs in MLX are constructed dynamically. Changing the shapes of function arguments does not trigger slow compilations, and debugging is simple and intuitive.
-
Multi-device: Operations can run on any of the supported devices (currently the CPU and the GPU).
-
Unified memory: A notable difference from MLX and other frameworks is the unified memory model. Arrays in MLX live in shared memory. Operations on MLX arrays can be performed on any of the supported device types without transferring data.
MLX is designed by machine learning researchers for machine learning researchers. The framework is intended to be user-friendly, but still efficient to train and deploy models. The design of the framework itself is also conceptually simple. We intend to make it easy for researchers to extend and improve MLX with the goal of quickly exploring new ideas.
The design of MLX is inspired by frameworks like NumPy, PyTorch, Jax, and ArrayFire.
Examples
The MLX examples repo has a variety of examples, including:
- Transformer language model training.
- Large-scale text generation with LLaMA and finetuning with LoRA.
- Generating images with Stable Diffusion.
- Speech recognition with OpenAI's Whisper.
Quickstart
See the quick start guide in the documentation.
Installation
MLX is available on PyPI. To install MLX on macOS, run:
pip install mlx
To install the CUDA backend on Linux, run:
pip install mlx[cuda]
To install a CPU-only Linux package, run:
pip install mlx[cpu]
Checkout the documentation for more information on building the C++ and Python APIs from source.
Contributing
Check out the contribution guidelines for more information on contributing to MLX. See the docs for more information on building from source, and running tests.
We are grateful for all of our contributors. If you contribute to MLX and wish to be acknowledged, please add your name to the list in your pull request.
Citing MLX
The MLX software suite was initially developed with equal contribution by Awni Hannun, Jagrit Digani, Angelos Katharopoulos, and Ronan Collobert. If you find MLX useful in your research and wish to cite it, please use the following BibTex entry:
@software{mlx2023,
author = {Awni Hannun and Jagrit Digani and Angelos Katharopoulos and Ronan Collobert},
title = {{MLX}: Efficient and flexible machine learning on Apple silicon},
url = {https://github.com/ml-explore},
version = {0.0},
year = {2023},
}