Interactive engineering note · offline-capable

RainFusion × MXFP8

Explore how video tokens are reordered across time × height × width, then inspect how MXFP8 quantizes each token’s feature channels. RainFusion determines where attention is computed; MXFP8 determines how the selected matrix multiplications are represented.

01 · Video token volume

3 frames × 4 × 4 spatial tokens = 48 tokens

Drag to rotate · Scroll to zoom
Window 0Window 1Window 2Window 3

02 · Flattened memory order

Frame-major: all 16 tokens of F0, then F1, then F2

3 groups × 16 tokens

Each color encodes a spatial window. In frame-major order, a single frame contains all four colors. In window-major order, a single window contains tokens drawn from all three frames.

03 · Inside one attention-head Q vector

Selected token from F0 · 128 feature dimensions

MXFP8 E4M3 + E8M0
BF16: 128 × 2 B = 256 B
MXFP8: 128 × 1 B + 4 × 1 B = 132 B

For Q/K, 32-element microscale groups lie along the attention head dimension D. The spatial grouping of video tokens is independent of these channel groups.

04 · Where precision fits into RainFusion

A proposed implementation flow, not a verified RainFusion MXFP8 backend.

BF16 Q / K / V→3D reorder→BF16 mean-QK score + top-k mask→MXFP8 selected QK tiles→FP32 softmax / BF16 PV

An incremental kernel strategy: keep the mask predictor in BF16; quantize only retained QK tiles to MXFP8; verify accuracy and speed before attempting MXFP8 PV. Real kernels also need correct scale layout, softmax handling and hardware-supported FP8 microscaling.