No project description provided
Project description
ml_dtypes
This is not an officially supported Google product.
ml_dtypes
is a stand-alone implementation of several NumPy dtype extensions used in machine learning libraries, including:
bfloat16
: an alternative to the standardfloat16
formatfloat8_*
: several experimental 8-bit floating point representations including:float8_e4m3b11
float8_e4m3fn
float8_e4m3fnuz
float8_e5m2
float8_e5m2fnuz
Installation
The ml_dtypes
package is tested with Python versions 3.8-3.11, and can be installed
with the following command:
pip install ml_dtypes
To test your installation, you can run the following:
pip install absl-py pytest
pytest --pyargs ml_dtypes
To build from source, clone the repository and run:
git submodule init
git submodule update
pip install .
Example Usage
>>> from ml_dtypes import bfloat16
>>> import numpy as np
>>> np.zeros(4, dtype=bfloat16)
array([0, 0, 0, 0], dtype=bfloat16)
Importing ml_dtypes
also registers the data types with numpy, so that they may
be referred to by their string name:
>>> np.dtype('bfloat16')
dtype(bfloat16)
>>> np.dtype('float8_e5m2')
dtype(float8_e5m2)
License
The ml_dtypes
source code is licensed under the Apache 2.0 license
(see LICENSE). Pre-compiled wheels are built with the
EIGEN project, which is released under the
MPL 2.0 license (see LICENSE.eigen).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file ml_dtypes-0.1.0.tar.gz
.
File metadata
- Download URL: ml_dtypes-0.1.0.tar.gz
- Upload date:
- Size: 686.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1fc0afe63ce99069f9d7e0693a61cfd0aea90241fc3821af9953d0c11f4048a |
|
MD5 | 9a46cb2e8e56132a462b2d3e21aaffe1 |
|
BLAKE2b-256 | e87e355b8db0651a2fe74437b578db1afc965b88bedd2116a83308bd7b91af43 |
Provenance
File details
Details for the file ml_dtypes-0.1.0-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: ml_dtypes-0.1.0-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 120.7 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8de9bbf5bed587a1166699447ea14d1e8fe66d4e812811e37bf2f4d988475476 |
|
MD5 | bb4036cea58ce8d666df34c41db8fdaa |
|
BLAKE2b-256 | dc2d08840216d482b41b0b64e7b51c71f9b08c3b12e524d618db9dfe19c0ed76 |
Provenance
File details
Details for the file ml_dtypes-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ml_dtypes-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 190.6 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99fab8262d175c49bf1655c229244f301274e8289449c350ba4d5b95ade07d9a |
|
MD5 | 1fe85e3ec3b2ca18337ec9b668aaaf36 |
|
BLAKE2b-256 | 642e48ae32e673bf5ed2ea4e6d073b6b8af4a0b1220b69fa51cde3c01545fca1 |
Provenance
File details
Details for the file ml_dtypes-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: ml_dtypes-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 189.7 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36e8518c8fd2c38729f020125f39ef07b045f5c16d0846320c7252d7773285ee |
|
MD5 | 162335232adc8e170d3c4a38d008d679 |
|
BLAKE2b-256 | b56823b29b1dac193c387c506d8bbf531a7b1f8f26d17a4cf117ef016cad7a76 |
Provenance
File details
Details for the file ml_dtypes-0.1.0-cp311-cp311-macosx_10_9_universal2.whl
.
File metadata
- Download URL: ml_dtypes-0.1.0-cp311-cp311-macosx_10_9_universal2.whl
- Upload date:
- Size: 317.9 kB
- Tags: CPython 3.11, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9c5578dffd85637a7dd437192de18bc1a14eb6ba7d53ef40de3f84c51c789e5 |
|
MD5 | 3fd7e6fa48a99f0edd535f70fb76831b |
|
BLAKE2b-256 | 9a30e018c89343a05acc4badef90b1264114f3919aac5da48a7e8232a881b492 |
Provenance
File details
Details for the file ml_dtypes-0.1.0-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: ml_dtypes-0.1.0-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 120.4 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad765159ac6c18d5ee7d325fcf34d3106a9d9d7a49713d998f5cfa330a1459b4 |
|
MD5 | cef7f4fe7aabca51b246ac57193bb150 |
|
BLAKE2b-256 | 03e01f341b60e866653eb67322b8acc1b9cc601da7a7cc0f8f9494a3d43a8592 |
Provenance
File details
Details for the file ml_dtypes-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ml_dtypes-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 190.6 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dee8ea629b8e3e20c6649852c1b9deacfa13384ab9337f2c9e717e401d102f23 |
|
MD5 | 6a3784cc4099e244a68203e8304e58d7 |
|
BLAKE2b-256 | 32d1ac8d79aadbdeb6b2d4b350f7575d2ae9b362a1136f9d2338d9337f37c95b |
Provenance
File details
Details for the file ml_dtypes-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: ml_dtypes-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 189.7 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87aa1cf83d41fed5a40fc27ee57ac4c1bf904e940f082531d3d58f1c318b5928 |
|
MD5 | c8ffcc861a145c96e6d3301a194297e9 |
|
BLAKE2b-256 | 508bbf5e5903b7567399a6c718f31986e19b8b5019b6e5a95518fcd92bba9a20 |
Provenance
File details
Details for the file ml_dtypes-0.1.0-cp310-cp310-macosx_10_9_universal2.whl
.
File metadata
- Download URL: ml_dtypes-0.1.0-cp310-cp310-macosx_10_9_universal2.whl
- Upload date:
- Size: 317.9 kB
- Tags: CPython 3.10, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 377f2d5cfbf809b59188e0bfda4a0774e658541f575b637fee4850d99c2f9fdc |
|
MD5 | ee7c806ffc46bd0c8a5905af3f451fce |
|
BLAKE2b-256 | 7774266060215a30a04b4347aad204335541945d1d73968fa7395d4cd96e1311 |
Provenance
File details
Details for the file ml_dtypes-0.1.0-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: ml_dtypes-0.1.0-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 120.3 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9218175b06764b8ddc95cb18d11a6c4b48a4b103a31c9ea2b2c3cd0cfc369f8 |
|
MD5 | ca4056feb1ff64f79a333753a8aa6aca |
|
BLAKE2b-256 | d37443b2a9f0a52c6786d410b5cbacf19324cadd1c55635a5bc76d66c2e3ef00 |
Provenance
File details
Details for the file ml_dtypes-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ml_dtypes-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 191.1 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c5c9fe086756fbc1bf51296431d64429536093cf6e2ba592e042d7fc07c8514 |
|
MD5 | dfb78c2489516bfeb2bc6e2bff339462 |
|
BLAKE2b-256 | f2b0a12b40c848ac9795082c1cc9054d69580ef4cc47a036917d5be34ca5f6ea |
Provenance
File details
Details for the file ml_dtypes-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: ml_dtypes-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 190.2 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffb7882dd46399217dc54f37affc899e0a29a4cfb63e5bf733ac0baf4a179c77 |
|
MD5 | a0e6dc133f7b9121c5c77159b7be1352 |
|
BLAKE2b-256 | a8bde9a11180103abe83fe97472ea118bf6e794ceb4fd18e5ed52db614c734e5 |
Provenance
File details
Details for the file ml_dtypes-0.1.0-cp39-cp39-macosx_10_9_universal2.whl
.
File metadata
- Download URL: ml_dtypes-0.1.0-cp39-cp39-macosx_10_9_universal2.whl
- Upload date:
- Size: 317.9 kB
- Tags: CPython 3.9, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77970beeb3cf6ac559c4b6b393f24778a5abd34fafbaad82d5a0d17d0f148936 |
|
MD5 | 9d756693c8700c777d1f2182bbce67b2 |
|
BLAKE2b-256 | e690a2fc320d098a72b4c96f97b128bab7449dd479c704075b96bc86bb9e3be5 |
Provenance
File details
Details for the file ml_dtypes-0.1.0-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: ml_dtypes-0.1.0-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 120.2 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2de6c81b0da398d54aabdd7de599f2dfc43e30b65d9fad379a69f4cc4ae165d3 |
|
MD5 | 23e4fda3fed5678fdd294fbce1be12de |
|
BLAKE2b-256 | 6d9c62207711a105d37e83ca4899298b72254c65dc40535a007165ef532a532f |
Provenance
File details
Details for the file ml_dtypes-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ml_dtypes-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 190.6 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41b6beeaea47e2466b94068664c9a45b2a65dd023aa4e5deeb5a73303661344e |
|
MD5 | c80883e27f8259e4908dd9214a9a4b3f |
|
BLAKE2b-256 | 4f88e252178b54fea300f1c4d8a28873f394a9a804515c8666a4305f2ea8bd4f |
Provenance
File details
Details for the file ml_dtypes-0.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: ml_dtypes-0.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 189.5 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 273c306db846005b83a98c9c7ec3dc8fa20e8f11c3772c8e8c20cc12d8abfd4b |
|
MD5 | e60a605f57eb684e870463ce503c3786 |
|
BLAKE2b-256 | c671fa610622b37d2f80652e0f02c1d4d3a2db61b9877cbfe2bded192805d161 |
Provenance
File details
Details for the file ml_dtypes-0.1.0-cp38-cp38-macosx_10_9_universal2.whl
.
File metadata
- Download URL: ml_dtypes-0.1.0-cp38-cp38-macosx_10_9_universal2.whl
- Upload date:
- Size: 317.8 kB
- Tags: CPython 3.8, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a29fbf128583673eca0f43def1dbe77e02c1e8b8a8331db2877bbb57d091ef11 |
|
MD5 | f9c1fb803497f479c0fa7fc6ee0d93f8 |
|
BLAKE2b-256 | a6ff759cf2360971b0668e5b9b5f34da9bc2c1dcfbfe56975ba83f09db6526fa |