jax-ml / jax-ml/ml_dtypes

Incorrect behavior for out-of-range casts to FP8E4M3FN

Open
#260 8 comments 0 reactions 1 assignee View on GitHub

@hawkinsp is already working on this.

Since Jan 27, 2025.

Dominant language
C++
Stars
361
Forks
60
Avg merge
18h 41m
Merged PRs (30d)
3

Description

The following calculation returns NaN but this is inconsistent with the behavior in ONNXRUNTIME which returns the max representable value of 448.
```
np.asarray([3e10]).astype(float8_e4m3fn)
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.