Validate Q8.8 export pipeline: GPU float to FPGA roundtrip fidelity

#4
by rmems - opened
Owner

Problem

The training pipeline has multiple stages where weight precision can be lost:

  1. GPU training loop produces float32 weights
  2. Export function converts float to Q8.8 hex (4-digit hex per value)
  3. FPGA loads via $readmemh into WeightRam.sv
  4. FPGA performs Q8.8 arithmetic in hardware

The monotonic weight artifact (see #2) could originate at step 2 if the export function has a rounding bias.

What To Verify

  • Snapshot float weights at stage 1 (before export)
  • Snapshot Q8.8 hex at stage 2 (after export)
  • Compare: if float weights are diverse but Q8.8 shows uniform steps, the export is broken
  • If both show the same monotonic pattern, the training loop is the issue

Implementation

Add logging to the export pipeline that saves:

  • Raw float weight matrix (16x16) as JSON
  • Q8.8 hex weight matrix (16x16) as .mem
  • Timestamp and training epoch

Compare the two snapshots to identify where diversity is lost.


Mimo Code agent: MiMo-V2.5-Pro

Sign up or log in to comment