Repository navigation
Fix FEDP2K on FPGA builds - #474
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comment:
FEDP2K fails on the FPGA build because TCU_MAX_INPUTS was not being sized after TC_K is doubled with FEDP2K. You can observe this bug on the FPGA by seeing that it produces wrong results on the FPGA build, where the computed results undershoot the reference results by around half.
AI-generated comment:
Fixes WGMMA computing wrong results on FPGA with
VX_CFG_TCU_FEDP2Kand the dual-side sparse mask (VX_CFG_TCU_DSM_ENABLE), while simulation passed. First of the standalone fixes in #457's review (§8, item 1).Root cause
Under FEDP2K the FEDP dot product is
FEDP_K = 2 × TC_Kwords wide, but two things were still sized byTC_K:VX_tcu_dsmwas instantiated with.N (TCU_TC_K)while itsa_row/b_colports were driven withFEDP_Kwords, so the upper half of the K inputs was truncated and never got a valid mask.TCU_MAX_INPUTS, which sizes that mask and every TFR multiplier'svld_mask, wasTC_K × TCU_MAX_ELT_RATIO.Vivado only warns on the truncated port connection, so the bitstream built and computed wrong results. No simulation case combined FEDP2K with DSM on the synthesizable TFR datapath, so nothing caught it.
Change
VX_tcu_pkg.sv:TCU_MAX_INPUTS = TCU_WG_FEDP_K × TCU_MAX_ELT_RATIO.VX_tcu_core.sv:VX_tcu_dsm #(.N (FEDP_K)).TCU_WG_FEDP_KequalsTCU_TC_Kwithout FEDP2K, so builds without FEDP2K are unchanged.Gate
New case
tensor_wg:sgemm_tcu_wg-fedp2k-dsm:sgemm_tcu_wgon rtlsim with the TFR datapath, FEDP2K and DSM.WIDTHTRUNConVX_tcu_dsm'sa_row/b_col(64-bit ports driven with 128 bits).Change impact: R2
ci/change_impact.py: R2 (path:rtl,evidence:simx-rtl-lockstep).perf_gateandmodel_paritycase passed unchanged in CI, includingperf_gate-wgmma-fedp2k-rsandmodel_parity-wgmma-fedp2k-rs.gpu32_full, has no FEDP2K), so no golden data moves.Evidence
sgemm_tcu_wg-fedp2k-dsmon rtlsim at XLEN 32 and 64: pass. On unfixed master: build fails (WIDTHTRUNC).ci/testcase.py lint.tests (logic_gate, rtlsim, 32)and thecompletejob that depends on it:tensor: dsp 267 -> 283 (+6.0%). That failure is identical on master (e.g. run 43199063171 on6fcd25477) and is in a build without FEDP2K or DSM, so this change does not cause it.