Skip to content
FP4-is-All-you-NeedPublic

About

Exact matrix products on FP4 Tensor Cores: the Adaptive Weight Encoding (AWE) catalog and the BLAS routines built on it.

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FP4 BLAS

Exact integer matrix products on FP4 Tensor Cores, and the BLAS routines built on them.

Warning

Only GEMM is published so far, and the optimized implementations are not published yet. The code here is the working reference.

Adaptive Weight Encoding (AWE) splits an integer into limbs taken from the set of values FP4 can store, with freely chosen integer weights, and multiplies linear combinations of limbs. The exact product needs fewer FP4 GEMMs than the base-13 split of prior work. AWE/Solutions/ is the catalog of these encodings. Details are in the paper, arXiv:2609.24519.

FamilyInputsFP4 GEMMs for one exact productRatio
Base-13 limbs
(prior work)
AWE
DirectINT8 × INT8961.5×
INT4 × INT8641.5×
FP16 significand16121.3×
Residue systems
(K = 16,384)
FP64 significand75591.3×

The radix-13 limb representation itself is published in FP4-is-All-you-Need/Oz-FP4.

INT8 × INT8 in 6 FP4 GEMMs

The paper's example of INT8 × INT8 in 6 FP4 GEMMs, limb weights (1, 29, 37). The INT8 path of the GEMM library uses the catalog solution with weights (1, 5, 27).

Repository Structure

Path Content
AWE/Solutions/ Encoding solutions as data, one JSON line per solution.
AWE/CodeGen/ The generator that turns a solution into C constants.
Platforms/NVIDIA/CUDA/GEMM/ GEMM library: INT8 (AWE and radix-13), FP64 (residue systems) and complex FP64 backends, with examples and tests.

License

MIT; see LICENSE.

Citation

@misc{hayashi2026awe,
  title         = {AWE: Adaptive Weight Encoding for Exact Integer Matrix Products with Fewer GEMMs on FP4 Tensor Cores},
  author        = {Hayashi, Shun{-}ichiro and Mukunoki, Daichi and Hoshino, Tetsuya and Katagiri, Takahiro},
  year          = {2026},
  eprint        = {2609.24519},
  archivePrefix = {arXiv},
  primaryClass  = {cs.MS},
  url           = {https://arxiv.org/abs/2609.24519}
}

About

Exact matrix products on FP4 Tensor Cores: the Adaptive Weight Encoding (AWE) catalog and the BLAS routines built on it.

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages