docs update

This commit is contained in:
Awni Hannun
2024-04-26 08:24:09 -07:00
committed by CircleCI Docs
parent ba26fe5be5
commit 61c03b86a4
502 changed files with 14665 additions and 15103 deletions

View File

@@ -32,10 +32,9 @@ work.
trace_file = "mlx_trace.gputrace"
if not mx.metal.start_capture(trace_file):
print("Make sure to run with MTL_CAPTURE_ENABLED=1 and "
f"that the path {trace_file} does not already exist.")
exit(1)
# Make sure to run with MTL_CAPTURE_ENABLED=1 and
# that the path trace_file does not already exist.
mx.metal.start_capture(trace_file)
for _ in range(10):
mx.eval(mx.add(a, b))

View File

@@ -74,7 +74,7 @@ Install `nanobind <https://nanobind.readthedocs.io/en/latest/>`_ with:
.. code-block:: shell
pip install git+https://github.com/wjakob/nanobind.git
pip install git+https://github.com/wjakob/nanobind.git@2f04eac452a6d9142dedb957701bdb20125561e4
Then simply build and install MLX using pip:
@@ -120,7 +120,7 @@ Create a build directory and run CMake and make:
.. code-block:: shell
mkdir -p build && cd build
cmake .. && make -j
cmake .. && make -j
Run tests with:
@@ -139,7 +139,7 @@ directory as the executable statically linked to ``libmlx.a`` or the
preprocessor constant ``METAL_PATH`` should be defined at build time and it
should point to the path to the built metal library.
.. list-table:: Build Options
.. list-table:: Build Options
:widths: 25 8
:header-rows: 1
@@ -161,15 +161,15 @@ should point to the path to the built metal library.
.. note::
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
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
.. code-block:: shell
export DEVELOPER_DIR="/path/to/Xcode.app/Contents/Developer/"
Further, you can use the following command to find out which
Further, you can use the following command to find out which
macOS SDK will be used
.. code-block:: shell
@@ -201,7 +201,7 @@ Then set the active developer directory:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
x86 Shell
x86 Shell
~~~~~~~~~
.. _build shell:

View File

@@ -0,0 +1,6 @@
mlx.core.block\_masked\_mm
==========================
.. currentmodule:: mlx.core
.. autofunction:: block_masked_mm

View File

@@ -0,0 +1,6 @@
mlx.core.degrees
================
.. currentmodule:: mlx.core
.. autofunction:: degrees

View File

@@ -0,0 +1,6 @@
mlx.core.metal.clear\_cache
===========================
.. currentmodule:: mlx.core.metal
.. autofunction:: clear_cache

View File

@@ -0,0 +1,6 @@
mlx.core.not\_equal
===================
.. currentmodule:: mlx.core
.. autofunction:: not_equal

View File

@@ -0,0 +1,6 @@
mlx.core.radians
================
.. currentmodule:: mlx.core
.. autofunction:: radians

View File

@@ -0,0 +1,6 @@
mlx.core.synchronize
====================
.. currentmodule:: mlx.core
.. autofunction:: synchronize

View File

@@ -0,0 +1,6 @@
mlx.nn.quantize
===============
.. currentmodule:: mlx.nn
.. autofunction:: quantize

View File

@@ -0,0 +1,6 @@
mlx.utils.tree\_map\_with\_path
===============================
.. currentmodule:: mlx.utils
.. autofunction:: tree_map_with_path

View File

@@ -16,3 +16,4 @@ Devices and Streams
new_stream
set_default_stream
stream
synchronize

View File

@@ -12,5 +12,6 @@ Metal
get_cache_memory
set_memory_limit
set_cache_limit
clear_cache
start_capture
stop_capture

View File

@@ -173,6 +173,7 @@ In detail:
:toctree: _autosummary
value_and_grad
quantize
.. toctree::

View File

@@ -3,4 +3,16 @@
.. currentmodule:: mlx.nn
.. autoclass:: ALiBi
.. autoclass:: ALiBi
.. rubric:: Methods
.. autosummary::
~ALiBi.create_alibi_matrix
~ALiBi.create_alibi_slope

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: AvgPool1d
.. autoclass:: AvgPool1d
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: AvgPool2d
.. autoclass:: AvgPool2d
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,15 @@
.. currentmodule:: mlx.nn
.. autoclass:: BatchNorm
.. autoclass:: BatchNorm
.. rubric:: Methods
.. autosummary::
~BatchNorm.unfreeze

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: Conv1d
.. autoclass:: Conv1d
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: Conv2d
.. autoclass:: Conv2d
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: Dropout
.. autoclass:: Dropout
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: Dropout2d
.. autoclass:: Dropout2d
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: Dropout3d
.. autoclass:: Dropout3d
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,15 @@
.. currentmodule:: mlx.nn
.. autoclass:: Embedding
.. autoclass:: Embedding
.. rubric:: Methods
.. autosummary::
~Embedding.as_linear

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: GELU
.. autoclass:: GELU
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: GRU
.. autoclass:: GRU
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: GroupNorm
.. autoclass:: GroupNorm
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: InstanceNorm
.. autoclass:: InstanceNorm
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: LSTM
.. autoclass:: LSTM
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: LayerNorm
.. autoclass:: LayerNorm
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: Linear
.. autoclass:: Linear
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: MaxPool1d
.. autoclass:: MaxPool1d
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: MaxPool2d
.. autoclass:: MaxPool2d
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: Mish
.. autoclass:: Mish
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,15 @@
.. currentmodule:: mlx.nn
.. autoclass:: MultiHeadAttention
.. autoclass:: MultiHeadAttention
.. rubric:: Methods
.. autosummary::
~MultiHeadAttention.create_additive_causal_mask

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: PReLU
.. autoclass:: PReLU
.. rubric:: Methods
.. autosummary::

View File

@@ -0,0 +1,18 @@
mlx.nn.QuantizedEmbedding
=========================
.. currentmodule:: mlx.nn
.. autoclass:: QuantizedEmbedding
.. rubric:: Methods
.. autosummary::
~QuantizedEmbedding.as_linear
~QuantizedEmbedding.from_embedding

View File

@@ -3,4 +3,16 @@
.. currentmodule:: mlx.nn
.. autoclass:: QuantizedLinear
.. autoclass:: QuantizedLinear
.. rubric:: Methods
.. autosummary::
~QuantizedLinear.from_linear
~QuantizedLinear.unfreeze

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: RMSNorm
.. autoclass:: RMSNorm
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: RNN
.. autoclass:: RNN
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: ReLU
.. autoclass:: ReLU
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: RoPE
.. autoclass:: RoPE
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: SELU
.. autoclass:: SELU
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: Sequential
.. autoclass:: Sequential
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: SiLU
.. autoclass:: SiLU
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: SinusoidalPositionalEncoding
.. autoclass:: SinusoidalPositionalEncoding
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: Softshrink
.. autoclass:: Softshrink
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: Step
.. autoclass:: Step
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: Transformer
.. autoclass:: Transformer
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,14 @@
.. currentmodule:: mlx.nn
.. autoclass:: Upsample
.. autoclass:: Upsample
.. rubric:: Methods
.. autosummary::

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn
.. autofunction:: elu
.. autoclass:: elu

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn
.. autofunction:: gelu
.. autoclass:: gelu

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn
.. autofunction:: gelu_approx
.. autoclass:: gelu_approx

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn
.. autofunction:: gelu_fast_approx
.. autoclass:: gelu_fast_approx

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn
.. autofunction:: glu
.. autoclass:: glu

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn
.. autofunction:: hardswish
.. autoclass:: hardswish

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn
.. autofunction:: leaky_relu
.. autoclass:: leaky_relu

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn
.. autofunction:: log_sigmoid
.. autoclass:: log_sigmoid

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn
.. autofunction:: log_softmax
.. autoclass:: log_softmax

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn.losses
.. autofunction:: binary_cross_entropy
.. autoclass:: binary_cross_entropy

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn.losses
.. autofunction:: cosine_similarity_loss
.. autoclass:: cosine_similarity_loss

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn.losses
.. autofunction:: cross_entropy
.. autoclass:: cross_entropy

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn.losses
.. autofunction:: gaussian_nll_loss
.. autoclass:: gaussian_nll_loss

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn.losses
.. autofunction:: hinge_loss
.. autoclass:: hinge_loss

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn.losses
.. autofunction:: huber_loss
.. autoclass:: huber_loss

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn.losses
.. autofunction:: kl_div_loss
.. autoclass:: kl_div_loss

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn.losses
.. autofunction:: l1_loss
.. autoclass:: l1_loss

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn.losses
.. autofunction:: log_cosh_loss
.. autoclass:: log_cosh_loss

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn.losses
.. autofunction:: margin_ranking_loss
.. autoclass:: margin_ranking_loss

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn.losses
.. autofunction:: mse_loss
.. autoclass:: mse_loss

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn.losses
.. autofunction:: nll_loss
.. autoclass:: nll_loss

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn.losses
.. autofunction:: smooth_l1_loss
.. autoclass:: smooth_l1_loss

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn.losses
.. autofunction:: triplet_loss
.. autoclass:: triplet_loss

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn
.. autofunction:: mish
.. autoclass:: mish

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn
.. autofunction:: prelu
.. autoclass:: prelu

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn
.. autofunction:: relu
.. autoclass:: relu

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn
.. autofunction:: relu6
.. autoclass:: relu6

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn
.. autofunction:: selu
.. autoclass:: selu

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn
.. autofunction:: sigmoid
.. autoclass:: sigmoid

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn
.. autofunction:: silu
.. autoclass:: silu

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn
.. autofunction:: softmax
.. autoclass:: softmax

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn
.. autofunction:: softplus
.. autoclass:: softplus

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn
.. autofunction:: softshrink
.. autoclass:: softshrink

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn
.. autofunction:: step
.. autoclass:: step

View File

@@ -3,4 +3,9 @@
.. currentmodule:: mlx.nn
.. autofunction:: tanh
.. autoclass:: tanh

View File

@@ -31,6 +31,7 @@ Layers
Mish
MultiHeadAttention
PReLU
QuantizedEmbedding
QuantizedLinear
RMSNorm
ReLU
@@ -43,4 +44,4 @@ Layers
Softshrink
Step
Transformer
Upsample
Upsample

View File

@@ -29,6 +29,7 @@ Operations
atleast_2d
atleast_3d
broadcast_to
block_masked_mm
ceil
clip
concatenate
@@ -42,6 +43,7 @@ Operations
cummin
cumprod
cumsum
degrees
dequantize
diag
diagonal
@@ -90,6 +92,7 @@ Operations
moveaxis
multiply
negative
not_equal
ones
ones_like
outer
@@ -98,6 +101,7 @@ Operations
prod
quantize
quantized_matmul
radians
reciprocal
repeat
reshape

View File

@@ -19,3 +19,4 @@ return python trees will be using the default python ``dict``, ``list`` and
tree_flatten
tree_unflatten
tree_map
tree_map_with_path