diff --git a/docs/src/conf.py b/docs/src/conf.py index da967f4c4..411329f7f 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -83,3 +83,15 @@ def setup(app): # -- Options for LaTeX output ------------------------------------------------ latex_documents = [(main_doc, "MLX.tex", "MLX Documentation", author, "manual")] +latex_elements = { + "preamble": r""" + \usepackage{enumitem} + \setlistdepth{5} + \setlist[itemize,1]{label=$\bullet$} + \setlist[itemize,2]{label=$\bullet$} + \setlist[itemize,3]{label=$\bullet$} + \setlist[itemize,4]{label=$\bullet$} + \setlist[itemize,5]{label=$\bullet$} + \renewlist{itemize}{itemize}{5} +""", +} diff --git a/docs/src/examples/llama-inference.rst b/docs/src/examples/llama-inference.rst index 0e080146b..7e06895e3 100644 --- a/docs/src/examples/llama-inference.rst +++ b/docs/src/examples/llama-inference.rst @@ -15,7 +15,7 @@ module to concisely define the model architecture. Attention layer ^^^^^^^^^^^^^^^^ -We will start with the llama attention layer which notably uses the RoPE +We will start with the Llama attention layer which notably uses the RoPE positional encoding. [1]_ In addition, our attention layer will optionally use a key/value cache that will be concatenated with the provided keys and values to support efficient inference. diff --git a/docs/src/examples/mlp.rst b/docs/src/examples/mlp.rst index 36890e95c..3214af504 100644 --- a/docs/src/examples/mlp.rst +++ b/docs/src/examples/mlp.rst @@ -64,7 +64,7 @@ set: Next, setup the problem parameters and load the data. To load the data, you need our `mnist data loader `_, which -we will import as `mnist`. +we will import as ``mnist``. .. code-block:: python diff --git a/docs/src/install.rst b/docs/src/install.rst index c2288e46d..c8cf5723b 100644 --- a/docs/src/install.rst +++ b/docs/src/install.rst @@ -70,36 +70,36 @@ To build and install the MLX python library from source, first, clone MLX from git clone git@github.com:ml-explore/mlx.git mlx && cd mlx -Install `nanobind `_ with: - -.. code-block:: shell - - pip install git+https://github.com/wjakob/nanobind.git@2f04eac452a6d9142dedb957701bdb20125561e4 - Then simply build and install MLX using pip: .. code-block:: shell - env CMAKE_BUILD_PARALLEL_LEVEL="" pip install . + CMAKE_BUILD_PARALLEL_LEVEL="" pip install . -For developing use an editable install: +For developing, install the package with development dependencies, and use an +editable install: .. code-block:: shell - env CMAKE_BUILD_PARALLEL_LEVEL="" pip install -e . + CMAKE_BUILD_PARALLEL_LEVEL="" pip install -e ".[dev]" -To make sure the install is working run the tests with: +Once the development dependencies are installed, you can build faster with: + +.. code-block:: shell + + CMAKE_BUILD_PARALLEL_LEVEL="" python setup.py build_ext -j --inplace + +Run the tests with: .. code-block:: shell - pip install ".[testing]" python -m unittest discover python/tests -Optional: Install stubs to enable auto completions and type checking from your IDE: +Optional: Install stubs to enable auto completions and type checking from your +IDE: .. code-block:: shell - pip install ".[dev]" python setup.py generate_stubs C++ API diff --git a/python/src/array.cpp b/python/src/array.cpp index 61641be88..cd42dc26e 100644 --- a/python/src/array.cpp +++ b/python/src/array.cpp @@ -162,7 +162,7 @@ void init_array(nb::module_& m) { * :attr:`~mlx.core.complexfloating` - * :ref:`complex128 ` + * :ref:`complex64 ` See also :func:`~mlx.core.issubdtype`. )pbdoc"); diff --git a/setup.py b/setup.py index a537a615a..db39b6f3c 100644 --- a/setup.py +++ b/setup.py @@ -175,8 +175,14 @@ if __name__ == "__main__": package_data=package_data, include_package_data=True, extras_require={ - "testing": ["numpy", "torch"], - "dev": ["pre-commit"], + "dev": [ + "nanobind@git+https://github.com/wjakob/nanobind.git@2f04eac452a6d9142dedb957701bdb20125561e4", + "numpy", + "pre-commit", + "setuptools>=42", + "torch", + "typing_extensions", + ], }, ext_modules=[CMakeExtension("mlx.core")], cmdclass={"build_ext": CMakeBuild, "generate_stubs": GenerateStubs},