Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/src/usage/environment_variables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ General
on supported hardware. The default is ``1``. Set it to ``0`` to keep these
operations in full ``float32`` precision. See :doc:`precision`.

.. envvar:: MLX_ENABLE_INT8_QMM

Allow :func:`mlx.core.quantized_matmul` to quantize the input to 8-bit
integers on supported hardware. The default is ``1``. Set it to ``0`` to
keep the input precision. See :doc:`precision`.

Distributed
-----------

Expand Down
11 changes: 11 additions & 0 deletions docs/src/usage/precision.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,14 @@ To disable Winograd, set :envvar:`MLX_CONV_WINOGRAD` to ``0``:
.. code-block:: shell

MLX_CONV_WINOGRAD=0 python my_script.py

On Metal, ``quantized_matmul`` with ``"affine"`` weights can quantize large
``float16`` or ``bfloat16`` inputs to 8-bit integers on supported hardware.
This is faster, but the added error can be as large as the error of 8-bit
weights.

To keep the input precision, set :envvar:`MLX_ENABLE_INT8_QMM` to ``0``:

.. code-block:: shell

MLX_ENABLE_INT8_QMM=0 python my_script.py
Loading
Loading