jax-ml / jax-ml/ml_dtypes

Rounding behavior of float8_e8m0fnu

Open
#298 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

e8m0 serves as the common scale type for MX (microscaling) formats, however, different libraries have adopted different rounding behaviors, see summarized in this table

![Image](https://github.com/user-attachments/assets/cfe69e1d-0f93-4eb5-9684-d364191b7b2e)

Although rounding to nearest is the common behavior for other floating point types, when used in MX formats it has been shown that rounding up with saturation is the most beneficial for training accuracy: https://arxiv.org/abs/2506.08027. As a result, this has been chosen as the default in the cuda spec.

I'm wondering if ml-dtypes has plans to update the rounding behavior or expose different rounding modes?

Thanks.

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.

Research direction

The issue concerns rounding behavior for float8_e8m0fnu in MX formats, but it names no implementation files or tests. First clarify whether the goal is to change the default, expose selectable rounding modes, or both; completion should be defined by an agreed behavior aligned with the relevant specification and covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.