Skip to content

backend: Add FP16-destination MX dequantization - #171

Closed
DanielKellerM wants to merge 2 commits into
develfrom
otf/mxdequant-fp16
Closed

backend: Add FP16-destination MX dequantization#171
DanielKellerM wants to merge 2 commits into
develfrom
otf/mxdequant-fp16

Conversation

@DanielKellerM

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #167: adds COMPUTE_MXDEQUANT_FP16 (MXFP8 -> FP16, 33B -> 64B per 32-elem block) so the 512-bit configuration roundtrips FP16 -> MXFP8 -> FP16 natively, halving the expanded footprint vs the FP32 destination. Same programming model as the other ops (compute_cfg.compute_op = 5).

  • The FP32 -> FP16 narrowing is IEEE (RNE, overflow saturates to Inf, quiet NaNs keep a payload bit). The C golden was cross-validated against numpy's float32 -> float16 cast over 4.2M vectors (every exponent band, both signs, plus 4M randoms): zero mismatches.
  • The dequant engine reuses the proven MXFP8 -> FP32 expansion and the circular pack buffer with a parametric insert length (64B/128B); no new datapath structure.
  • New elaboration parameter ComputeOps.mxfp16 gates the FP16 format paths (quant source and dequant destination) in or out per instance.
  • Fenced: FP16 dequant above 512b (ComputeMxdequantFp16Width, one block per beat), covered by firing negative case 12; the beat-alignment and length-overflow fences extend to the new op.

Validation

Questa 2026.1, byte-exact vs the DPI golden at every legal StrbWidth: roundtrip FP16 leg now returns FP16 (tb_idma_mxroundtrip), FP16-destination transfers mixed into the constrained-random stall campaign (tb_idma_mxrand), throughput gate green (tb_idma_mxperf: W = 100% at the destination bus, R at the 33:64 compression ratio), all 12 negative guards fire, transpose suites unchanged.

COMPUTE_MXDEQUANT_FP16 expands 33B -> 64B per block at up to 512b (one
block per beat, width-fenced), so the 512b roundtrip is FP16 -> MXFP8 ->
FP16. The FP32 -> FP16 narrowing is IEEE RNE with overflow to Inf,
cross-validated against numpy's float16 cast over 4.2M vectors and
mirrored in the DPI golden; the dequant engine reuses the proven FP32
expansion path and the circular pack with a parametric insert length.
ComputeOps.mxfp16 elaborates the FP16 format paths in or out per
instance (both quant source and dequant destination).
Copilot AI lite review requested due to automatic review settings August 11, 2026 08:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@DanielKellerM

Copy link
Copy Markdown
Collaborator Author

Superseded by branch otf/mx-compute (78be850), which carries the FP16-destination dequant together with the full MX feature on current devel.

@DanielKellerM
DanielKellerM deleted the otf/mxdequant-fp16 branch August 11, 2026 12:53
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.

2 participants