Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[DOCS] Documenting the support for MXFP4 data format. (#26554)

Sebastian Golebiewski1d3a71160b56
diff --git a/docs/articles_en/openvino-workflow/model-optimization-guide/weight-compression.rst b/docs/articles_en/openvino-workflow/model-optimization-guide/weight-compression.rst
index 2b67dc0ddf5..6c85473502f 100644
--- a/docs/articles_en/openvino-workflow/model-optimization-guide/weight-compression.rst
+++ b/docs/articles_en/openvino-workflow/model-optimization-guide/weight-compression.rst
@@ -1,6 +1,13 @@
Weight Compression
==================
+.. toctree::
+ :maxdepth: 1
+ :hidden:
+
+ weight-compression/microscaling-quantization
+
+
Weight compression is a technique for enhancing the efficiency of models,
especially those with large memory requirements. This method reduces the model's
memory footprint, a crucial factor for Large Language Models (LLMs).
@@ -289,6 +296,7 @@ from Optimum Intel instead of NNCF to compress the model to INT8_ASYM.
results = pipe(phrase)
print(results)
+
Exporting and Loading Compressed Models
########################################
@@ -485,3 +493,4 @@ Additional Resources
- `NNCF GitHub <https://github.com/openvinotoolkit/nncf>`__
- :doc:`Post-training Quantization <quantizing-models-post-training>`
- :doc:`Training-time Optimization <compressing-models-during-training>`
+- `OCP Microscaling Formats (MX) Specification <https://www.opencompute.org/documents/ocp-microscaling-formats-mx-v1-0-spec-final-pdf>`__
diff --git a/docs/articles_en/openvino-workflow/model-optimization-guide/weight-compression/microscaling-quantization.rst b/docs/articles_en/openvino-workflow/model-optimization-guide/weight-compression/microscaling-quantization.rst
new file mode 100644
index 00000000000..d4dfad2868c
--- /dev/null
+++ b/docs/articles_en/openvino-workflow/model-optimization-guide/weight-compression/microscaling-quantization.rst
@@ -0,0 +1,52 @@
+Microscaling (MX) Quantization
+==============================
+
+Microscaling (MX) Quantization method has been introduced to enable users
+to quantize LLMs with a high compression rate at minimal cost of accuracy.
+The method helps maintain model performance comparable to that of the conventional
+FP32. It increases compute and storage efficiency by using low bit-width
+floating point and integer-based data formats:
+
++---------------+-----------------+----------------------------+
+| Data format | Data type | Description |
++===============+=================+============================+
+| MXFP8 | | FP8 (E5M2) | | Floating point, 8-bit |
+| | | FP8 (E4M3) | | Floating point, 8-bit |
++---------------+-----------------+----------------------------+
+| MXFP6 | | FP6 (E3M2) | | Floating point, 6-bit |
+| | | FP6 (E2M3) | | Floating point, 6-bit |
++---------------+-----------------+----------------------------+
+| **MXFP4** | **FP4 (E2M1)** | **Floating point, 4-bit** |
++---------------+-----------------+----------------------------+
+| MXINT8 | INT8 | Integer, 8-bit |
++---------------+-----------------+----------------------------+
+
+
+.. _mxfp4_support:
+
+**Currently, only the**
+`MXFP4 (E2M1) <https://www.opencompute.org/documents/ocp-microscaling-formats-mx-v1-0-spec-final-pdf>`__
+**data format is supported in NNCF and for quantization on CPU.**
+E2M1 may be considered for improving accuracy, however, quantized models will
+not be faster than the ones compressed to INT8_ASYM.
+
+Quantization to the E2M1 data type will compress weights to 4-bit without a zero
+point and with 8-bit E8M0 scales. To quantize a model to E2M1, set
+``mode=CompressWeightsMode.E2M1`` in ``nncf.compress_weights()``. It is
+recommended to use ``group size = 32``. See the example below:
+
+.. code-block:: py
+
+ from nncf import compress_weights, CompressWeightsMode
+ compressed_model = compress_weights(model, mode=CompressWeightsMode.E2M1, group_size=32, all_layers=True)
+
+.. note::
+
+ Different values for ``group_size`` and ``ratio`` are also supported.
+
+
+Additional Resources
+####################
+
+* `OCP Microscaling Formats (MX) Specification <https://www.opencompute.org/documents/ocp-microscaling-formats-mx-v1-0-spec-final-pdf>`__
+* `Intel® Neural Compressor Documentation <https://intel.github.io/neural-compressor/latest/docs/source/3x/PT_MXQuant.html>`__
\ No newline at end of file
diff --git a/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes/cpu-device.rst b/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes/cpu-device.rst
index d4ee9af90c5..f1a914e6b9d 100644
--- a/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes/cpu-device.rst
+++ b/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes/cpu-device.rst
@@ -53,24 +53,27 @@ the ``ov::Core::compile_model()`` method:
:fragment: [compile_model_default]
-Supported Inference Data Types
-###########################################################
+Supported Model Precision
+#########################
CPU plugin supports the following data types as inference precision of internal primitives:
- Floating-point data types:
- - ``f32`` (Intel® x86-64, Arm®)
- - ``bf16`` (Intel® x86-64)
- - ``f16`` (Intel® x86-64, Arm®)
+ - ``FP32`` (Intel® x86-64, Arm®)
+ - ``BF16`` (Intel® x86-64)
+ - ``FP16`` (Intel® x86-64, Arm®)
+ - ``:ref:`MXFP4 <mxfp4_support>``` (Intel® x86-64)
+
- Integer data types:
- - ``i32`` (Intel® x86-64, Arm®)
+ - ``INT32`` (Intel® x86-64, Arm®)
+
- Quantized data types:
- - ``u8`` (Intel® x86-64)
- - ``i8`` (Intel® x86-64)
- - ``u1`` (Intel® x86-64)
+ - ``uINT8`` (Intel® x86-64)
+ - ``INT8`` (Intel® x86-64)
+ - ``uINT1`` (Intel® x86-64)
:doc:`Hello Query Device C++ Sample <../../../learn-openvino/openvino-samples/hello-query-device>` can be used to print out supported data types for all detected devices.