Skip to content

docs(mxfp): clarify that TPU/CPU use native fp8 dot_general fallback#323

Open
lokic233 wants to merge 2 commits into
google:mainfrom
lokic233:docs/mxfp-tpu-fallback-clarification
Open

docs(mxfp): clarify that TPU/CPU use native fp8 dot_general fallback#323
lokic233 wants to merge 2 commits into
google:mainfrom
lokic233:docs/mxfp-tpu-fallback-clarification

Conversation

@lokic233

@lokic233 lokic233 commented Jul 6, 2026

Copy link
Copy Markdown

Summary

The comment at qwix/_src/core/mxfp_dot.py L50-52 reads:

"Once scaled_matmul supports TPU, we will enable it for TPU as well."

This could be misread as MXFP being unsupported on TPU. In fact, when mxfp_dot_general returns None on TPU/CPU, the caller already falls through to dot_general._fast_dot_general — a correct, MXU-accelerated native fp8 path that works today.

This rewords the comment to state the current behavior clearly.

Details

  • No behavior change — comment reword only.
  • GPU: uses the fused jax.nn.scaled_matmul path (natively on Blackwell via cuDNN, emulated on legacy).
  • TPU/CPU: returns None → caller uses native tiled fp8 dot_general fallback (correct + accelerated).
  • We verified the fallback path on real tpu7x: weight-cached fp8 dot_general measured 1.6–1.8× over bf16 at large shapes.

The existing comment ('Once scaled_matmul supports TPU, we will enable it')
could be misread as TPU being unsupported. In fact, when mxfp_dot_general
returns None on TPU/CPU, the caller already falls through to
dot_general._fast_dot_general — a correct, MXU-accelerated native fp8 path.

This rewords the comment to state the current behavior clearly: GPU uses
the fused scaled_matmul path; TPU/CPU use the native tiled fp8 fallback.

No behavior change — comment only.
@google-cla

google-cla Bot commented Jul 6, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant