Skip to content

Mosaic requires 32-bit matmul accumulators on TPU. Previously, - #489

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_1026758432
Open

copybara-service[bot] wants to merge 1 commit into
mainfrom
test_1026758432

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Mosaic requires 32-bit matmul accumulators on TPU. Previously,
loop_dot_general picked a bfloat16 accumulator for float values with
bfloat16 scales when preferred_element_type was unset, failing to compile
(mxfp8, float8 with bfloat16 scales, or bfloat16 inputs with int8).

Promote floating accumulator types narrower than 32 bits to float32 inside
loop_dot_general and cast back to the original result type on return. Only
qwix.pallas uses loop_dot_general, so XLA qwix.dot_general is unchanged.
Numerics change: for float inputs with bfloat16 scales, or an explicit
bfloat16 preferred_element_type, results are no longer bit-identical to
before (visible in interpret mode and on GPU, where these setups already
compiled).

@copybara-service
copybara-service Bot force-pushed the test_1026758432 branch 2 times, most recently from 79f0f7f to b9f5a5b Compare November 21, 2026 00:27
`loop_dot_general` picked a `bfloat16` accumulator for float values with
`bfloat16` scales when `preferred_element_type` was unset, failing to compile
(`mxfp8`, `float8` with `bfloat16` scales, or `bfloat16` inputs with `int8`).

Promote floating accumulator types narrower than 32 bits to `float32` inside
`loop_dot_general` and cast back to the original result type on return. Only
`qwix.pallas` uses `loop_dot_general`, so XLA `qwix.dot_general` is unchanged.
Numerics change: for float inputs with `bfloat16` scales, or an explicit
`bfloat16` `preferred_element_type`, results are no longer bit-identical to
before (visible in interpret mode and on GPU, where these setups already
compiled).

PiperOrigin-RevId: 1026758432
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