jax-ml / jax-ml/ml_dtypes

[Q] How to properly save and load fp8 NumPy arrays?

Open
#207 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
361
Forks
60
Avg merge
18h 41m
Merged PRs (30d)
3

Description

I would like to save and load an f8m5e2 array. I initially tried using the standard `numpy.save()` and `numpy.load()` functions, but loading fails.

```bash
.local/lib/python3.10/site-packages/numpy/lib/format.py", line 325, in descr_to_dtype
return numpy.dtype(descr)
TypeError: data type '

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure through NumPy's numpy/lib/format.py with an ml_dtypes.float8_e5m2 array, then compare it with the np.tobytes/np.frombuffer example and related issue 148. Done means the supported serialization approach is established and documented, or the incompatibility is addressed with a reproducible test.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.