skillfed

ml-dtypes

ml_dtypes is a stand-alone implementation of several NumPy dtype extensions used in machine learning.

ml-dtypes Permissive license Apache-2.0 Active 357 v0.6.0 released

Install

ml-dtypes on PyPI

pip

pip install ml-dtypes

uv

uv add ml-dtypes

poetry

poetry add ml-dtypes

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction medium — platform-specific wheel
Runtime dependencies 1 — numpy
Maintenance actively maintained — 0 days since the last release
Last repo commit
First released
Popularity one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13)
Known vulnerabilities none known (OSV.dev, checked 2026-08-13)

Evidence: ml_dtypes-0.6.0-cp310-cp310-macosx_10_9_universal2.whl; ml_dtypes-0.6.0-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; ml_dtypes-0.6.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; ml_dtypes-0.6.0-cp310-cp310-win_amd64.whl; ml_dtypes-0.6.0-cp311-cp311-macosx_10_9_universal2.whl; ml_dtypes-0.6.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; ml_dtypes-0.6.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; ml_dtypes-0.6.0-cp311-cp311-win_amd64.whl; ml_dtypes-0.6.0-cp311-cp311-win_arm64.whl; ml_dtypes-0.6.0-cp312-cp312-macosx_10_13_universal2.whl; ml_dtypes-0.6.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; ml_dtypes-0.6.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; ml_dtypes-0.6.0-cp312-cp312-win_amd64.whl; ml_dtypes-0.6.0-cp312-cp312-win_arm64.whl; ml_dtypes-0.6.0-cp313-cp313-macosx_10_13_universal2.whl; ml_dtypes-0.6.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; ml_dtypes-0.6.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; ml_dtypes-0.6.0-cp313-cp313-win_amd64.whl; ml_dtypes-0.6.0-cp313-cp313-win_arm64.whl; ml_dtypes-0.6.0-cp314-cp314-macosx_10_15_universal2.whl

Intended Audience :: Science/ResearchProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: Only

About ml-dtypes

from the package's own PyPI description — quoted content, verbatim

ml_dtypes

Unittests (image) Wheel Build (image) PyPI version (image)

ml_dtypes is a stand-alone implementation of several NumPy dtype extensions used in machine learning libraries, including:

  • bfloat16: an alternative to the standard float16 format
  • 8-bit floating point representations, parameterized by number of exponent and mantissa bits, as well as the bias (if any) and representability of infinity, NaN, and signed zero.
  • float8_e3m4
  • float8_e4m3
  • float8_e4m3b11fnuz
  • float8_e4m3fn
  • float8_e4m3fnuz
  • float8_e5m2
  • float8_e5m2fnuz
  • float8_e8m0fnu
  • Microscaling (MX) sub-byte floating point representations:
  • float4_e2m1fn
  • float6_e2m3fn *...

Read as markdown · JSON record · Source repository

AI interpretation — verify before relying

AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page

ml_dtypes provides NumPy-compatible data types for machine learning, including bfloat16, 8-bit floats (float8_e5m2, float8_e4m3, etc.), 4–6-bit microscaling formats, and narrow integers (int1–int4, uint1–uint4).

Medium install friction due to platform-specific wheels (cp310–cp314 across macOS, Linux, Windows, and ARM64), but pre-built binaries are available for all major platforms. Active maintenance with a recent release.

Apache-2.0 permissive license; pre-compiled wheels include EIGEN (MPL 2.0). Both are compatible with commercial use, though MPL 2.0 requires source disclosure for modifications to EIGEN itself.

Usage

pip install ml_dtypes
from ml_dtypes import bfloat16
import numpy as np
arr = np.zeros(4, dtype=bfloat16)

Requires Python >=3.10; platform-specific wheel selection is automatic but may require a recent pip/setuptools.

Verdict: A well-maintained, actively developed library for low-precision ML dtypes with broad platform support and no known vulnerabilities. Apache-2.0 licensing is permissive. Medium install friction is typical for compiled extensions; suitable for ML workflows that need bfloat16 or float8 support in NumPy.

Needs verification

  • Whether numpy's aggregation behavior with these dtypes (e.g., precision loss in sum) is documented or mitigated in recent versions.
  • Performance characteristics and overhead of unpacked sub-byte integer types relative to standard NumPy integers.
bfloat16 numpy dtypefloat8 machine learninglow precision data typesml_dtypes numpy extensions8-bit floating pointmicroscaling formatsnarrow integer types

Similar packages