mirror of
https://github.com/ml-explore/mlx.git
synced 2025-09-18 01:39:36 +08:00
docs update
This commit is contained in:

committed by
CircleCI Docs

parent
e1f3a7b14d
commit
8b5550f9f8
194
docs/build/html/install.html
vendored
194
docs/build/html/install.html
vendored
@@ -1,15 +1,14 @@
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
|
||||
<html lang="en" data-content_root="" >
|
||||
<html lang="en" data-content_root="./" >
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
|
||||
|
||||
<title>Build and Install — MLX 0.7.0 documentation</title>
|
||||
<title>Build and Install — MLX 0.9.0 documentation</title>
|
||||
|
||||
|
||||
|
||||
@@ -29,20 +28,18 @@
|
||||
<link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/6.1.2/webfonts/fa-brands-400.woff2" />
|
||||
<link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/6.1.2/webfonts/fa-regular-400.woff2" />
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
|
||||
<link rel="stylesheet" href="_static/styles/sphinx-book-theme.css?digest=14f4ca6b54d191a8c7657f6c759bf11a5fb86285" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
|
||||
<link rel="stylesheet" type="text/css" href="_static/styles/sphinx-book-theme.css?v=384b581d" />
|
||||
|
||||
<!-- Pre-loaded scripts that we'll load fully later -->
|
||||
<link rel="preload" as="script" href="_static/scripts/bootstrap.js?digest=5b4479735964841361fd" />
|
||||
<link rel="preload" as="script" href="_static/scripts/pydata-sphinx-theme.js?digest=5b4479735964841361fd" />
|
||||
<script src="_static/vendor/fontawesome/6.1.2/js/all.min.js?digest=5b4479735964841361fd"></script>
|
||||
|
||||
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
||||
<script src="_static/jquery.js"></script>
|
||||
<script src="_static/underscore.js"></script>
|
||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||
<script src="_static/doctools.js"></script>
|
||||
<script src="_static/scripts/sphinx-book-theme.js?digest=5a5c038af52cf7bc1a1ec88eea08e6366ee68824"></script>
|
||||
<script src="_static/documentation_options.js?v=2a76c96f"></script>
|
||||
<script src="_static/doctools.js?v=888ff710"></script>
|
||||
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
|
||||
<script src="_static/scripts/sphinx-book-theme.js?v=efea14e4"></script>
|
||||
<script>DOCUMENTATION_OPTIONS.pagename = 'install';</script>
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@@ -134,12 +131,23 @@
|
||||
|
||||
|
||||
|
||||
<img src="_static/mlx_logo.png" class="logo__image only-light" alt="MLX 0.7.0 documentation - Home"/>
|
||||
<script>document.write(`<img src="_static/mlx_logo_dark.png" class="logo__image only-dark" alt="MLX 0.7.0 documentation - Home"/>`);</script>
|
||||
<img src="_static/mlx_logo.png" class="logo__image only-light" alt="MLX 0.9.0 documentation - Home"/>
|
||||
<script>document.write(`<img src="_static/mlx_logo_dark.png" class="logo__image only-dark" alt="MLX 0.9.0 documentation - Home"/>`);</script>
|
||||
|
||||
|
||||
</a></div>
|
||||
<div class="sidebar-primary-item"><nav class="bd-links" id="bd-docs-nav" aria-label="Main">
|
||||
<div class="sidebar-primary-item">
|
||||
|
||||
<script>
|
||||
document.write(`
|
||||
<button class="btn navbar-btn search-button-field search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
|
||||
<i class="fa-solid fa-magnifying-glass"></i>
|
||||
<span class="search-button__default-text">Search</span>
|
||||
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
|
||||
</button>
|
||||
`);
|
||||
</script></div>
|
||||
<div class="sidebar-primary-item"><nav class="bd-links bd-docs-nav" aria-label="Main">
|
||||
<div class="bd-toc-item navbar-nav active">
|
||||
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Install</span></p>
|
||||
<ul class="current nav bd-sidenav">
|
||||
@@ -168,27 +176,38 @@
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/array.html">Array</a><input class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-1"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.html">mlx.core.array</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.astype.html">mlx.core.array.astype</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.at.html">mlx.core.array.at</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.item.html">mlx.core.array.item</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.tolist.html">mlx.core.array.tolist</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.dtype.html">mlx.core.array.dtype</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.itemsize.html">mlx.core.array.itemsize</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.nbytes.html">mlx.core.array.nbytes</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.ndim.html">mlx.core.array.ndim</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.shape.html">mlx.core.array.shape</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.size.html">mlx.core.array.size</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.Dtype.html">mlx.core.Dtype</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.abs.html">mlx.core.array.abs</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.all.html">mlx.core.array.all</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.any.html">mlx.core.array.any</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.argmax.html">mlx.core.array.argmax</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.argmin.html">mlx.core.array.argmin</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.cos.html">mlx.core.array.cos</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.dtype.html">mlx.core.array.dtype</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.cummax.html">mlx.core.array.cummax</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.cummin.html">mlx.core.array.cummin</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.cumprod.html">mlx.core.array.cumprod</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.cumsum.html">mlx.core.array.cumsum</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.diag.html">mlx.core.array.diag</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.diagonal.html">mlx.core.array.diagonal</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.exp.html">mlx.core.array.exp</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.flatten.html">mlx.core.array.flatten</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.log.html">mlx.core.array.log</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.log10.html">mlx.core.array.log10</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.log1p.html">mlx.core.array.log1p</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.log2.html">mlx.core.array.log2</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.logsumexp.html">mlx.core.array.logsumexp</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.max.html">mlx.core.array.max</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.mean.html">mlx.core.array.mean</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.min.html">mlx.core.array.min</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.moveaxis.html">mlx.core.array.moveaxis</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.prod.html">mlx.core.array.prod</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.reciprocal.html">mlx.core.array.reciprocal</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.reshape.html">mlx.core.array.reshape</a></li>
|
||||
@@ -198,13 +217,21 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.split.html">mlx.core.array.split</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.sqrt.html">mlx.core.array.sqrt</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.square.html">mlx.core.array.square</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.squeeze.html">mlx.core.array.squeeze</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.swapaxes.html">mlx.core.array.swapaxes</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.sum.html">mlx.core.array.sum</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.transpose.html">mlx.core.array.transpose</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.T.html">mlx.core.array.T</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.array.var.html">mlx.core.array.var</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/devices_and_streams.html">Devices and Streams</a><input class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-2"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/data_types.html">Data Types</a><input class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-2"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.Dtype.html">mlx.core.Dtype</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.DtypeCategory.html">mlx.core.DtypeCategory</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.issubdtype.html">mlx.core.issubdtype</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/devices_and_streams.html">Devices and Streams</a><input class="toctree-checkbox" id="toctree-checkbox-3" name="toctree-checkbox-3" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-3"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.Device.html">mlx.core.Device</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/stream_class.html">mlx.core.Stream</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.default_device.html">mlx.core.default_device</a></li>
|
||||
@@ -215,7 +242,7 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.stream.html">mlx.core.stream</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/ops.html">Operations</a><input class="toctree-checkbox" id="toctree-checkbox-3" name="toctree-checkbox-3" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-3"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/ops.html">Operations</a><input class="toctree-checkbox" id="toctree-checkbox-4" name="toctree-checkbox-4" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-4"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.abs.html">mlx.core.abs</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.add.html">mlx.core.add</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.all.html">mlx.core.all</a></li>
|
||||
@@ -246,6 +273,10 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.conv_general.html">mlx.core.conv_general</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.cos.html">mlx.core.cos</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.cosh.html">mlx.core.cosh</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.cummax.html">mlx.core.cummax</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.cummin.html">mlx.core.cummin</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.cumprod.html">mlx.core.cumprod</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.cumsum.html">mlx.core.cumsum</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.dequantize.html">mlx.core.dequantize</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.diag.html">mlx.core.diag</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.diagonal.html">mlx.core.diagonal</a></li>
|
||||
@@ -266,10 +297,10 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.identity.html">mlx.core.identity</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.inner.html">mlx.core.inner</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.isclose.html">mlx.core.isclose</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.isnan.html">mlx.core.isnan</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.isposinf.html">mlx.core.isposinf</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.isneginf.html">mlx.core.isneginf</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.isinf.html">mlx.core.isinf</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.isnan.html">mlx.core.isnan</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.isneginf.html">mlx.core.isneginf</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.isposinf.html">mlx.core.isposinf</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.less.html">mlx.core.less</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.less_equal.html">mlx.core.less_equal</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.linspace.html">mlx.core.linspace</a></li>
|
||||
@@ -342,7 +373,7 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.zeros_like.html">mlx.core.zeros_like</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/random.html">Random</a><input class="toctree-checkbox" id="toctree-checkbox-4" name="toctree-checkbox-4" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-4"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/random.html">Random</a><input class="toctree-checkbox" id="toctree-checkbox-5" name="toctree-checkbox-5" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-5"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.random.bernoulli.html">mlx.core.random.bernoulli</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.random.categorical.html">mlx.core.random.categorical</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.random.gumbel.html">mlx.core.random.gumbel</a></li>
|
||||
@@ -355,7 +386,7 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.random.uniform.html">mlx.core.random.uniform</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/transforms.html">Transforms</a><input class="toctree-checkbox" id="toctree-checkbox-5" name="toctree-checkbox-5" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-5"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/transforms.html">Transforms</a><input class="toctree-checkbox" id="toctree-checkbox-6" name="toctree-checkbox-6" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-6"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.eval.html">mlx.core.eval</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.compile.html">mlx.core.compile</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.disable_compile.html">mlx.core.disable_compile</a></li>
|
||||
@@ -367,7 +398,14 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.vmap.html">mlx.core.vmap</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/fft.html">FFT</a><input class="toctree-checkbox" id="toctree-checkbox-6" name="toctree-checkbox-6" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-6"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/fast.html">Fast</a><input class="toctree-checkbox" id="toctree-checkbox-7" name="toctree-checkbox-7" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-7"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.fast.rms_norm.html">mlx.core.fast.rms_norm</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.fast.layer_norm.html">mlx.core.fast.layer_norm</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.fast.rope.html">mlx.core.fast.rope</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.fast.scaled_dot_product_attention.html">mlx.core.fast.scaled_dot_product_attention</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/fft.html">FFT</a><input class="toctree-checkbox" id="toctree-checkbox-8" name="toctree-checkbox-8" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-8"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.fft.fft.html">mlx.core.fft.fft</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.fft.ifft.html">mlx.core.fft.ifft</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.fft.fft2.html">mlx.core.fft.fft2</a></li>
|
||||
@@ -382,12 +420,12 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.fft.irfftn.html">mlx.core.fft.irfftn</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/linalg.html">Linear Algebra</a><input class="toctree-checkbox" id="toctree-checkbox-7" name="toctree-checkbox-7" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-7"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/linalg.html">Linear Algebra</a><input class="toctree-checkbox" id="toctree-checkbox-9" name="toctree-checkbox-9" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-9"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.linalg.norm.html">mlx.core.linalg.norm</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.linalg.qr.html">mlx.core.linalg.qr</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/metal.html">Metal</a><input class="toctree-checkbox" id="toctree-checkbox-8" name="toctree-checkbox-8" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-8"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/metal.html">Metal</a><input class="toctree-checkbox" id="toctree-checkbox-10" name="toctree-checkbox-10" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-10"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.metal.is_available.html">mlx.core.metal.is_available</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.metal.get_active_memory.html">mlx.core.metal.get_active_memory</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.metal.get_peak_memory.html">mlx.core.metal.get_peak_memory</a></li>
|
||||
@@ -396,9 +434,9 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.core.metal.set_cache_limit.html">mlx.core.metal.set_cache_limit</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/nn.html">Neural Networks</a><input class="toctree-checkbox" id="toctree-checkbox-9" name="toctree-checkbox-9" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-9"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/nn.html">Neural Networks</a><input class="toctree-checkbox" id="toctree-checkbox-11" name="toctree-checkbox-11" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-11"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.nn.value_and_grad.html">mlx.nn.value_and_grad</a></li>
|
||||
<li class="toctree-l2 has-children"><a class="reference internal" href="python/nn/module.html">Module</a><input class="toctree-checkbox" id="toctree-checkbox-10" name="toctree-checkbox-10" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-10"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l2 has-children"><a class="reference internal" href="python/nn/module.html">Module</a><input class="toctree-checkbox" id="toctree-checkbox-12" name="toctree-checkbox-12" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-12"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary/mlx.nn.Module.training.html">mlx.nn.Module.training</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary/mlx.nn.Module.state.html">mlx.nn.Module.state</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary/mlx.nn.Module.apply.html">mlx.nn.Module.apply</a></li>
|
||||
@@ -413,6 +451,7 @@
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary/mlx.nn.Module.named_modules.html">mlx.nn.Module.named_modules</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary/mlx.nn.Module.parameters.html">mlx.nn.Module.parameters</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary/mlx.nn.Module.save_weights.html">mlx.nn.Module.save_weights</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary/mlx.nn.Module.set_dtype.html">mlx.nn.Module.set_dtype</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary/mlx.nn.Module.train.html">mlx.nn.Module.train</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary/mlx.nn.Module.trainable_parameters.html">mlx.nn.Module.trainable_parameters</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary/mlx.nn.Module.unfreeze.html">mlx.nn.Module.unfreeze</a></li>
|
||||
@@ -420,7 +459,7 @@
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary/mlx.nn.Module.update_modules.html">mlx.nn.Module.update_modules</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2 has-children"><a class="reference internal" href="python/nn/layers.html">Layers</a><input class="toctree-checkbox" id="toctree-checkbox-11" name="toctree-checkbox-11" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-11"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l2 has-children"><a class="reference internal" href="python/nn/layers.html">Layers</a><input class="toctree-checkbox" id="toctree-checkbox-13" name="toctree-checkbox-13" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-13"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary/mlx.nn.ALiBi.html">mlx.nn.ALiBi</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary/mlx.nn.AvgPool1d.html">mlx.nn.AvgPool1d</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary/mlx.nn.AvgPool2d.html">mlx.nn.AvgPool2d</a></li>
|
||||
@@ -458,7 +497,7 @@
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary/mlx.nn.Upsample.html">mlx.nn.Upsample</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2 has-children"><a class="reference internal" href="python/nn/functions.html">Functions</a><input class="toctree-checkbox" id="toctree-checkbox-12" name="toctree-checkbox-12" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-12"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l2 has-children"><a class="reference internal" href="python/nn/functions.html">Functions</a><input class="toctree-checkbox" id="toctree-checkbox-14" name="toctree-checkbox-14" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-14"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary_functions/mlx.nn.elu.html">mlx.nn.elu</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary_functions/mlx.nn.gelu.html">mlx.nn.gelu</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary_functions/mlx.nn.gelu_approx.html">mlx.nn.gelu_approx</a></li>
|
||||
@@ -482,7 +521,7 @@
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary_functions/mlx.nn.tanh.html">mlx.nn.tanh</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2 has-children"><a class="reference internal" href="python/nn/losses.html">Loss Functions</a><input class="toctree-checkbox" id="toctree-checkbox-13" name="toctree-checkbox-13" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-13"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l2 has-children"><a class="reference internal" href="python/nn/losses.html">Loss Functions</a><input class="toctree-checkbox" id="toctree-checkbox-15" name="toctree-checkbox-15" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-15"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary_functions/mlx.nn.losses.binary_cross_entropy.html">mlx.nn.losses.binary_cross_entropy</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary_functions/mlx.nn.losses.cosine_similarity_loss.html">mlx.nn.losses.cosine_similarity_loss</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary_functions/mlx.nn.losses.cross_entropy.html">mlx.nn.losses.cross_entropy</a></li>
|
||||
@@ -499,7 +538,7 @@
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary_functions/mlx.nn.losses.triplet_loss.html">mlx.nn.losses.triplet_loss</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2 has-children"><a class="reference internal" href="python/nn/init.html">Initializers</a><input class="toctree-checkbox" id="toctree-checkbox-14" name="toctree-checkbox-14" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-14"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l2 has-children"><a class="reference internal" href="python/nn/init.html">Initializers</a><input class="toctree-checkbox" id="toctree-checkbox-16" name="toctree-checkbox-16" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-16"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary/mlx.nn.init.constant.html">mlx.nn.init.constant</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary/mlx.nn.init.normal.html">mlx.nn.init.normal</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/nn/_autosummary/mlx.nn.init.uniform.html">mlx.nn.init.uniform</a></li>
|
||||
@@ -512,15 +551,15 @@
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/optimizers.html">Optimizers</a><input class="toctree-checkbox" id="toctree-checkbox-15" name="toctree-checkbox-15" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-15"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l2 has-children"><a class="reference internal" href="python/optimizers/optimizer.html">Optimizer</a><input class="toctree-checkbox" id="toctree-checkbox-16" name="toctree-checkbox-16" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-16"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/optimizers.html">Optimizers</a><input class="toctree-checkbox" id="toctree-checkbox-17" name="toctree-checkbox-17" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-17"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l2 has-children"><a class="reference internal" href="python/optimizers/optimizer.html">Optimizer</a><input class="toctree-checkbox" id="toctree-checkbox-18" name="toctree-checkbox-18" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-18"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/optimizers/_autosummary/mlx.optimizers.Optimizer.state.html">mlx.optimizers.Optimizer.state</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/optimizers/_autosummary/mlx.optimizers.Optimizer.apply_gradients.html">mlx.optimizers.Optimizer.apply_gradients</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/optimizers/_autosummary/mlx.optimizers.Optimizer.init.html">mlx.optimizers.Optimizer.init</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/optimizers/_autosummary/mlx.optimizers.Optimizer.update.html">mlx.optimizers.Optimizer.update</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2 has-children"><a class="reference internal" href="python/optimizers/common_optimizers.html">Common Optimizers</a><input class="toctree-checkbox" id="toctree-checkbox-17" name="toctree-checkbox-17" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-17"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l2 has-children"><a class="reference internal" href="python/optimizers/common_optimizers.html">Common Optimizers</a><input class="toctree-checkbox" id="toctree-checkbox-19" name="toctree-checkbox-19" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-19"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/optimizers/_autosummary/mlx.optimizers.SGD.html">mlx.optimizers.SGD</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/optimizers/_autosummary/mlx.optimizers.RMSprop.html">mlx.optimizers.RMSprop</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/optimizers/_autosummary/mlx.optimizers.Adagrad.html">mlx.optimizers.Adagrad</a></li>
|
||||
@@ -532,7 +571,7 @@
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/optimizers/_autosummary/mlx.optimizers.Lion.html">mlx.optimizers.Lion</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2 has-children"><a class="reference internal" href="python/optimizers/schedulers.html">Schedulers</a><input class="toctree-checkbox" id="toctree-checkbox-18" name="toctree-checkbox-18" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-18"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l2 has-children"><a class="reference internal" href="python/optimizers/schedulers.html">Schedulers</a><input class="toctree-checkbox" id="toctree-checkbox-20" name="toctree-checkbox-20" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-20"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/optimizers/_autosummary/mlx.optimizers.cosine_decay.html">mlx.optimizers.cosine_decay</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/optimizers/_autosummary/mlx.optimizers.exponential_decay.html">mlx.optimizers.exponential_decay</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="python/optimizers/_autosummary/mlx.optimizers.join_schedules.html">mlx.optimizers.join_schedules</a></li>
|
||||
@@ -542,7 +581,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/tree_utils.html">Tree Utils</a><input class="toctree-checkbox" id="toctree-checkbox-19" name="toctree-checkbox-19" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-19"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="python/tree_utils.html">Tree Utils</a><input class="toctree-checkbox" id="toctree-checkbox-21" name="toctree-checkbox-21" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-21"><i class="fa-solid fa-chevron-down"></i></label><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.utils.tree_flatten.html">mlx.utils.tree_flatten</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.utils.tree_unflatten.html">mlx.utils.tree_unflatten</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="python/_autosummary/mlx.utils.tree_map.html">mlx.utils.tree_map</a></li>
|
||||
@@ -556,6 +595,7 @@
|
||||
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Further Reading</span></p>
|
||||
<ul class="nav bd-sidenav">
|
||||
<li class="toctree-l1"><a class="reference internal" href="dev/extensions.html">Developer Documentation</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="dev/metal_debugger.html">Metal Debugger</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
@@ -746,12 +786,12 @@ document.write(`
|
||||
<article class="bd-article" role="main">
|
||||
|
||||
<section id="build-and-install">
|
||||
<h1>Build and Install<a class="headerlink" href="#build-and-install" title="Permalink to this heading">#</a></h1>
|
||||
<h1>Build and Install<a class="headerlink" href="#build-and-install" title="Link to this heading">#</a></h1>
|
||||
<section id="python-installation">
|
||||
<h2>Python Installation<a class="headerlink" href="#python-installation" title="Permalink to this heading">#</a></h2>
|
||||
<h2>Python Installation<a class="headerlink" href="#python-installation" title="Link to this heading">#</a></h2>
|
||||
<p>MLX is available on PyPI. All you have to do to use MLX with your own Apple
|
||||
silicon computer is</p>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pip install mlx
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span>mlx
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>To install from PyPI you must meet the following requirements:</p>
|
||||
@@ -766,15 +806,15 @@ silicon computer is</p>
|
||||
It is highly recommended to use macOS 14 (Sonoma)</p>
|
||||
</div>
|
||||
<p>MLX is also available on conda-forge. To install MLX with conda do:</p>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>conda install conda-forge::mlx
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>conda<span class="w"> </span>install<span class="w"> </span>conda-forge::mlx
|
||||
</pre></div>
|
||||
</div>
|
||||
<section id="troubleshooting">
|
||||
<h3>Troubleshooting<a class="headerlink" href="#troubleshooting" title="Permalink to this heading">#</a></h3>
|
||||
<h3>Troubleshooting<a class="headerlink" href="#troubleshooting" title="Link to this heading">#</a></h3>
|
||||
<p><em>My OS and Python versions are in the required range but pip still does not find
|
||||
a matching distribution.</em></p>
|
||||
<p>Probably you are using a non-native Python. The output of</p>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>python -c <span class="s2">"import platform; print(platform.processor())"</span>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>python<span class="w"> </span>-c<span class="w"> </span><span class="s2">"import platform; print(platform.processor())"</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>should be <code class="docutils literal notranslate"><span class="pre">arm</span></code>. If it is <code class="docutils literal notranslate"><span class="pre">i386</span></code> (and you have M series machine) then you
|
||||
@@ -783,9 +823,9 @@ way to do this is with <a class="reference external" href="https://stackoverflow
|
||||
</section>
|
||||
</section>
|
||||
<section id="build-from-source">
|
||||
<h2>Build from source<a class="headerlink" href="#build-from-source" title="Permalink to this heading">#</a></h2>
|
||||
<h2>Build from source<a class="headerlink" href="#build-from-source" title="Link to this heading">#</a></h2>
|
||||
<section id="build-requirements">
|
||||
<h3>Build Requirements<a class="headerlink" href="#build-requirements" title="Permalink to this heading">#</a></h3>
|
||||
<h3>Build Requirements<a class="headerlink" href="#build-requirements" title="Link to this heading">#</a></h3>
|
||||
<ul class="simple">
|
||||
<li><p>A C++ compiler with C++17 support (e.g. Clang >= 5.0)</p></li>
|
||||
<li><p><a class="reference external" href="https://cmake.org/">cmake</a> – version 3.24 or later, and <code class="docutils literal notranslate"><span class="pre">make</span></code></p></li>
|
||||
@@ -798,57 +838,54 @@ the output of <code class="docutils literal notranslate"><span class="pre">uname
|
||||
</div>
|
||||
</section>
|
||||
<section id="python-api">
|
||||
<h3>Python API<a class="headerlink" href="#python-api" title="Permalink to this heading">#</a></h3>
|
||||
<h3>Python API<a class="headerlink" href="#python-api" title="Link to this heading">#</a></h3>
|
||||
<p>To build and install the MLX python library from source, first, clone MLX from
|
||||
<a class="reference external" href="https://github.com/ml-explore/mlx">its GitHub repo</a>:</p>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>git clone git@github.com:ml-explore/mlx.git mlx <span class="o">&&</span> <span class="nb">cd</span> mlx
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>git<span class="w"> </span>clone<span class="w"> </span>git@github.com:ml-explore/mlx.git<span class="w"> </span>mlx<span class="w"> </span><span class="o">&&</span><span class="w"> </span><span class="nb">cd</span><span class="w"> </span>mlx
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Make sure that you have <a class="reference external" href="https://pybind11.readthedocs.io/en/stable/index.html">pybind11</a>
|
||||
installed. You can install <code class="docutils literal notranslate"><span class="pre">pybind11</span></code> with <code class="docutils literal notranslate"><span class="pre">pip</span></code>, <code class="docutils literal notranslate"><span class="pre">brew</span></code> or <code class="docutils literal notranslate"><span class="pre">conda</span></code> as follows:</p>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pip install <span class="s2">"pybind11[global]"</span>
|
||||
conda install pybind11
|
||||
brew install pybind11
|
||||
<p>Install <a class="reference external" href="https://nanobind.readthedocs.io/en/latest/">nanobind</a> with:</p>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span>git+https://github.com/wjakob/nanobind.git
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Then simply build and install it using pip:</p>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>env <span class="nv">CMAKE_BUILD_PARALLEL_LEVEL</span><span class="o">=</span><span class="s2">""</span> pip install .
|
||||
<p>Then simply build and install MLX using pip:</p>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>env<span class="w"> </span><span class="nv">CMAKE_BUILD_PARALLEL_LEVEL</span><span class="o">=</span><span class="s2">""</span><span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>.
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>For developing use an editable install:</p>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>env <span class="nv">CMAKE_BUILD_PARALLEL_LEVEL</span><span class="o">=</span><span class="s2">""</span> pip install -e .
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>env<span class="w"> </span><span class="nv">CMAKE_BUILD_PARALLEL_LEVEL</span><span class="o">=</span><span class="s2">""</span><span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-e<span class="w"> </span>.
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>To make sure the install is working run the tests with:</p>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pip install <span class="s2">".[testing]"</span>
|
||||
python -m unittest discover python/tests
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span><span class="s2">".[testing]"</span>
|
||||
python<span class="w"> </span>-m<span class="w"> </span>unittest<span class="w"> </span>discover<span class="w"> </span>python/tests
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Optional: Install stubs to enable auto completions and type checking from your IDE:</p>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pip install <span class="s2">".[dev]"</span>
|
||||
python setup.py generate_stubs
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span><span class="s2">".[dev]"</span>
|
||||
python<span class="w"> </span>setup.py<span class="w"> </span>generate_stubs
|
||||
</pre></div>
|
||||
</div>
|
||||
</section>
|
||||
<section id="c-api">
|
||||
<h3>C++ API<a class="headerlink" href="#c-api" title="Permalink to this heading">#</a></h3>
|
||||
<h3>C++ API<a class="headerlink" href="#c-api" title="Link to this heading">#</a></h3>
|
||||
<p>Currently, MLX must be built and installed from source.</p>
|
||||
<p>Similarly to the python library, to build and install the MLX C++ library start
|
||||
by cloning MLX from <a class="reference external" href="https://github.com/ml-explore/mlx">its GitHub repo</a>:</p>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>git clone git@github.com:ml-explore/mlx.git mlx <span class="o">&&</span> <span class="nb">cd</span> mlx
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>git<span class="w"> </span>clone<span class="w"> </span>git@github.com:ml-explore/mlx.git<span class="w"> </span>mlx<span class="w"> </span><span class="o">&&</span><span class="w"> </span><span class="nb">cd</span><span class="w"> </span>mlx
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Create a build directory and run CMake and make:</p>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>mkdir -p build <span class="o">&&</span> <span class="nb">cd</span> build
|
||||
cmake .. <span class="o">&&</span> make -j
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>mkdir<span class="w"> </span>-p<span class="w"> </span>build<span class="w"> </span><span class="o">&&</span><span class="w"> </span><span class="nb">cd</span><span class="w"> </span>build
|
||||
cmake<span class="w"> </span>..<span class="w"> </span><span class="o">&&</span><span class="w"> </span>make<span class="w"> </span>-j
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Run tests with:</p>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>make <span class="nb">test</span>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>make<span class="w"> </span><span class="nb">test</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Install with:</p>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>make install
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>make<span class="w"> </span>install
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Note that the built <code class="docutils literal notranslate"><span class="pre">mlx.metallib</span></code> file should be either at the same
|
||||
@@ -856,7 +893,7 @@ directory as the executable statically linked to <code class="docutils literal n
|
||||
preprocessor constant <code class="docutils literal notranslate"><span class="pre">METAL_PATH</span></code> should be defined at build time and it
|
||||
should point to the path to the built metal library.</p>
|
||||
<table class="table" id="id3">
|
||||
<caption><span class="caption-text">Build Options</span><a class="headerlink" href="#id3" title="Permalink to this table">#</a></caption>
|
||||
<caption><span class="caption-text">Build Options</span><a class="headerlink" href="#id3" title="Link to this table">#</a></caption>
|
||||
<colgroup>
|
||||
<col style="width: 76%" />
|
||||
<col style="width: 24%" />
|
||||
@@ -882,6 +919,9 @@ should point to the path to the built metal library.</p>
|
||||
<tr class="row-even"><td><p>MLX_BUILD_PYTHON_BINDINGS</p></td>
|
||||
<td><p>OFF</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p>MLX_METAL_DEBUG</p></td>
|
||||
<td><p>OFF</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="admonition note">
|
||||
@@ -889,35 +929,35 @@ should point to the path to the built metal library.</p>
|
||||
<p>If you have multiple Xcode installations and wish to use
|
||||
a specific one while building, you can do so by adding the
|
||||
following environment variable before building</p>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="nb">export</span> <span class="nv">DEVELOPER_DIR</span><span class="o">=</span><span class="s2">"/path/to/Xcode.app/Contents/Developer/"</span>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="nb">export</span><span class="w"> </span><span class="nv">DEVELOPER_DIR</span><span class="o">=</span><span class="s2">"/path/to/Xcode.app/Contents/Developer/"</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Further, you can use the following command to find out which
|
||||
macOS SDK will be used</p>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>xcrun -sdk macosx --show-sdk-version
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>xcrun<span class="w"> </span>-sdk<span class="w"> </span>macosx<span class="w"> </span>--show-sdk-version
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section id="id2">
|
||||
<h3>Troubleshooting<a class="headerlink" href="#id2" title="Permalink to this heading">#</a></h3>
|
||||
<h3>Troubleshooting<a class="headerlink" href="#id2" title="Link to this heading">#</a></h3>
|
||||
<section id="metal-not-found">
|
||||
<h4>Metal not found<a class="headerlink" href="#metal-not-found" title="Permalink to this heading">#</a></h4>
|
||||
<h4>Metal not found<a class="headerlink" href="#metal-not-found" title="Link to this heading">#</a></h4>
|
||||
<p>You see the following error when you try to build:</p>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>error: unable to find utility <span class="s2">"metal"</span>, not a developer tool or <span class="k">in</span> PATH
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>error:<span class="w"> </span>unable<span class="w"> </span>to<span class="w"> </span>find<span class="w"> </span>utility<span class="w"> </span><span class="s2">"metal"</span>,<span class="w"> </span>not<span class="w"> </span>a<span class="w"> </span>developer<span class="w"> </span>tool<span class="w"> </span>or<span class="w"> </span><span class="k">in</span><span class="w"> </span>PATH
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>To fix this, first make sure you have Xcode installed:</p>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>xcode-select --install
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>xcode-select<span class="w"> </span>--install
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Then set the active developer directory:</p>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>xcode-select<span class="w"> </span>--switch<span class="w"> </span>/Applications/Xcode.app/Contents/Developer
|
||||
</pre></div>
|
||||
</div>
|
||||
</section>
|
||||
<section id="x86-shell">
|
||||
<h4>x86 Shell<a class="headerlink" href="#x86-shell" title="Permalink to this heading">#</a></h4>
|
||||
<h4>x86 Shell<a class="headerlink" href="#x86-shell" title="Link to this heading">#</a></h4>
|
||||
<p id="build-shell">If the ouptut of <code class="docutils literal notranslate"><span class="pre">uname</span> <span class="pre">-p</span></code> is <code class="docutils literal notranslate"><span class="pre">x86</span></code> then your shell is running as x86 via
|
||||
Rosetta instead of natively.</p>
|
||||
<p>To fix this, find the application in Finder (<code class="docutils literal notranslate"><span class="pre">/Applications</span></code> for iTerm,
|
||||
@@ -925,13 +965,13 @@ Rosetta instead of natively.</p>
|
||||
Uncheck “Open using Rosetta”, close the “Get Info” window, and restart your
|
||||
terminal.</p>
|
||||
<p>Verify the terminal is now running natively the following command:</p>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>$ uname -p
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>uname<span class="w"> </span>-p
|
||||
arm
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Also check that cmake is using the correct architecture:</p>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>$ cmake --system-information <span class="p">|</span> grep CMAKE_HOST_SYSTEM_PROCESSOR
|
||||
CMAKE_HOST_SYSTEM_PROCESSOR <span class="s2">"arm64"</span>
|
||||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>cmake<span class="w"> </span>--system-information<span class="w"> </span><span class="p">|</span><span class="w"> </span>grep<span class="w"> </span>CMAKE_HOST_SYSTEM_PROCESSOR
|
||||
CMAKE_HOST_SYSTEM_PROCESSOR<span class="w"> </span><span class="s2">"arm64"</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>If you see <code class="docutils literal notranslate"><span class="pre">"x86_64"</span></code>, try re-installing <code class="docutils literal notranslate"><span class="pre">cmake</span></code>. If you see <code class="docutils literal notranslate"><span class="pre">"arm64"</span></code>
|
||||
|
Reference in New Issue
Block a user