Skip to content

Making RCEIL the default for MXFP scale derivation #2035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
frsun-nvda opened this issue Apr 10, 2025 · 0 comments
Open

Making RCEIL the default for MXFP scale derivation #2035

frsun-nvda opened this issue Apr 10, 2025 · 0 comments
Labels

Comments

@frsun-nvda
Copy link
Contributor

frsun-nvda commented Apr 10, 2025

Propose to make RCEIL the default for MXFP scale derivation.

RCEIL is targeting to optimize the MXFP E8 scale factor w.r.t the ratio of block_amax / dtype_max. An example formula is: X_E8 = to_e8(ceil(log2(block_amax / dtype_max))). Real implementation is achieved through bit manipulation. Nvidia Blackwell architecture has instruction cvt.rp.satfinite.ue8m0x2.f32. TransformerEngine and CUTLASS have already adopted.
In contract, the OCP spec's ceil formula is X_E8 = to_e8(ceil(log2(block_amax)) - floor(log2(dtype_max))).
With block_amax = 150 and dtype_max = float8_e4m3.max = 448, RCEIL X_E8 = to_e8(ceil(log2(150 / 448))) = 126 while OCP ceil X_E8 = to_e8(ceil(log2(150)) - floor(log2(448))) = 127.

RCEIL is used to generate the cast-only slide for GTC 2025 to showcase direct-cast with MXFP8 could achieve iso-accuracy as BF16. We have also verified the model training and accuracy across various model sizes and token counts to ensure MXFP8 with RCEIL could achieve iso-accuracy with BF16.

The benefits of using RCEIL as the default is:

  1. Users could enjoy the hardware acceleration for MXFP scale derivation on Blackwell architecture.
  2. Users could enjoy cast-only MXFP8 out of the box with torchao to achieve iso-accuracy as BF16 for deployment.
  3. Users could enjoy iso-accuracy MXFP8 training and downstream task as BF16.
@supriyar supriyar added the mx label Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants