Skip to content

Naifeng/benchntt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

benchNTT

benchNTT provides high-performance CPU implementations of 128-bit cryptographic kernels, specifically number theoretic transforms (NTTs) and basic linear algebra subprograms (BLAS) operations. The kernels are implemented using scalar, AVX2, and AVX-512 instructions. For more details, please refer to our paper.

Related GPU work is available in our MoMA repository.

Dependencies

One of the following compilers is required:

  • Intel: ICX >= 2024.2.0
  • AMD: AOCC >= 16.0.3
  • Generic: GCC

Usage

The build system supports multiple compilers and architectures:

Intel CPUs

ICX required for best performance.

make blas-intel     # Build and run BLAS benchmarks
make ntt-intel      # Build and run NTT benchmarks

AMD CPUs

AOCC required for best performance.

make blas-amd       # Build and run BLAS benchmarks
make ntt-amd        # Build and run NTT benchmarks

Generic

GCC required.

make blas           # Build and run BLAS benchmarks
make ntt            # Build and run NTT benchmarks

Note I: If your CPU does not support AVX2 or AVX-512, you can comment out the corresponding build targets (see BLAS_TARGETS and NTT_TARGETS) in the Makefile to build only the supported implementations.

Note II: You can also use make all to build and run all targets with GCC. Always run make clean before switching compilers.

Environment Requirements

For accurate benchmarking, please ensure that no other processes are competing for CPU resources. Running benchmarks on dedicated machines (e.g., via SSH) and taking multiple measurements is recommended to minimize noise.

Directory Structure

benchntt (this repository)
│    README.md (this file)
│    Makefile
│    ...
│
└────benchmark
│    │    run_ntt.sh
│ 
└────data
│    │    x_1024.txt
│    │    ver_1024.txt
│    │    ...
│ 
└────src
     │    blas_avx512.c
     │    ntt_avx512.c
     |    ...
  • benchmark: Bash script for benchmarking different NTT sizes.
  • data: Verification data for NTT and BLAS operations.
  • src: Scalar, AVX2, and AVX-512 implementations of NTT and BLAS operations.

License

Distributed under the SPIRAL License. For more details, please refer to the LICENSE file.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages