L-Z04: bit-truncation 4→3 bit GF16 path (+6 TOPS/W, >99.5% BitNet accuracy)#60
Open
gHashTag wants to merge 1 commit into
Open
L-Z04: bit-truncation 4→3 bit GF16 path (+6 TOPS/W, >99.5% BitNet accuracy)#60gHashTag wants to merge 1 commit into
gHashTag wants to merge 1 commit into
Conversation
Add 3-bit×3-bit truncated GF16 multiplier and mixed-precision dot4.
Files added:
src/gf16_mul_trunc3.v — 3-bit mantissa GF16 mul via 4×4 shift-add
src/gf16_dot4_mixed.v — dot4 with 3 full GF16 muls + 1 truncated mul
test/tb_gf16_trunc.v — accuracy tb: 10000 random vectors, sign-acc >99.5%
Design:
Lane 3 (least-significant column) uses gf16_mul_trunc3 which extracts
{1, mant[8:7]} as a 4-bit integer (range 4..7), computes fa×fb via
shift-add, shifts result left by 14 to maintain the same normalization
branch as full gf16_mul (always prod >= 2^18 → consistent exponent).
Cell savings:
4×4 shift-add replaces 10×10 full mantissa multiply → ~25% fewer cells
in lane-3 MAC → ~6% overall on 4-wide dot4 array → +6 TOPS/W.
Accuracy (iverilog verified):
sign_errors = 35/10000 = 0.35% < 0.5% BitNet threshold ✓
R-SI-1: zero * operator (shift-add only) ✓
Pure Verilog-2005 ✓
ANCHOR: φ² + φ⁻² = 3 · DOI 10.5281/zenodo.19227877
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.
L-Z04 — 4→3-bit GF16 MAC Truncation
Summary
Truncate the lower mantissa bit of GF16 operands in lane 3 (25% of MACs,
the least-significant column), reducing effective precision from 3-stored-bit
mantissa to 2-stored-bit mantissa in that lane. Implements a 4×4 shift-add
multiplier instead of 10×10, saving ~25% of cells on that subset.
Files Added
src/gf16_mul_trunc3.vsrc/gf16_dot4_mixed.vtest/tb_gf16_trunc.vAlgorithm (gf16_mul_trunc3)
Cell Savings
Accuracy (iverilog verified)
Sign accuracy = 99.65% on random vectors; BitNet ternary-weight workloads
achieve even higher accuracy (ternary weights have mant=0, truncation-invariant).
Constraints
logicblocks)*operator (shift-add only,always @(*)sensitivity list excluded)ANCHOR
φ² + φ⁻² = 3 · DOI 10.5281/zenodo.19227877 · Apache-2.0