Skip to content

Commit cd3a085

Browse files
fabergaJose Rojas ChavesFlorentCLMichelGelilaSeifumichaelbeale-IL
authored
V1.2.6 (#161)
# Changes ## Version 1.2.6 - Update documentation to make a reference to OpenFHE - Complies with Clang-Format +11 - Fixes EltwiseFMAMod Failing on 52 bits modulus (#136) - Fixes Check Bounds for avx512 reduction mod_2 (#153) - Fixes Destructor error (#159) - Updates to CI/CD - Add SECURITY.md for OSSF Scorecard compliance - Added workflow permissions to meet OpenSSF Scorecard requirements --------- Co-authored-by: Jose Rojas Chaves <joserochh+github@users.noreply.github.com> Co-authored-by: Florent Michel <56166507+FlorentCLMichel@users.noreply.github.com> Co-authored-by: Gelila Seifu <Gelila.seifu@intel.com> Co-authored-by: Michael Beale <michael.beale@intel.com>
1 parent f95acf1 commit cd3a085

48 files changed

Lines changed: 241 additions & 214 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/github-ci.yml

Lines changed: 15 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
name: Build and Test
5+
permissions: read-all
56
on:
67
# By default this will run when the activity type is "opened", "synchronize",
78
# or "reopened".
@@ -24,14 +25,14 @@ on:
2425
# Define env vars #
2526
###################
2627
env:
27-
HEXL_VER: 1.2.5
28+
HEXL_VER: 1.2.6
2829
HEXL_DIR: ${GITHUB_WORKSPACE}/lib/cmake/hexl-${HEXL_VER}
2930
HEXL_HINT_DIR: >
3031
-DHEXL_HINT_DIR=${GITHUB_WORKSPACE}/lib/cmake/hexl-${HEXL_VER}
3132
COVERAGE_COMPILER_FLAGS: >
3233
-DCMAKE_BUILD_TYPE=Debug
33-
-DCMAKE_CXX_COMPILER=g++-9
34-
-DCMAKE_C_COMPILER=gcc-9
34+
-DCMAKE_CXX_COMPILER=g++-11
35+
-DCMAKE_C_COMPILER=gcc-11
3536
-DHEXL_BENCHMARK=ON
3637
-DHEXL_TESTING=ON
3738
-DHEXL_COVERAGE=ON
@@ -42,26 +43,28 @@ env:
4243
jobs:
4344
format:
4445
name: Format
45-
runs-on: ubuntu-20.04
46+
runs-on: ubuntu-22.04
4647
steps:
47-
- uses: actions/checkout@v2
48+
- uses: actions/checkout@v3
4849
# Required for pre-commit
4950
- run: pip3 install cpplint==1.5.5
5051
# NOTE: This is deprecated in favor of pre-commit.ci
51-
- uses: pre-commit/action@v2.0.2
52+
- uses: pre-commit/action@v3.0.1
5253
with:
5354
extra_args: --all-files
5455

5556
nix-build:
5657
name: '${{ matrix.os }} ${{ matrix.build_type }} shared=${{ matrix.shared_lib }}'
5758
runs-on: '${{ matrix.os }}'
59+
permissions:
60+
contents: write # required for actions/upload-artifacts@v2
5861
defaults:
5962
run:
6063
shell: bash
6164
strategy:
6265
matrix:
63-
# os: [ice-lake, [self-hosted, ubuntu-18.04], macos-latest, ubuntu-20.04]
64-
os: [ice-lake, macos-latest, ubuntu-20.04]
66+
# removed platforms not available on github hosted servers.
67+
os: [ubuntu-22.04]
6568
build_type: [Release, Debug]
6669
shared_lib: [ON, OFF]
6770
include:
@@ -70,9 +73,6 @@ jobs:
7073
benchmark_min_time: "--benchmark_min_time=0.001"
7174
- build_type: Release
7275
benchmark_min_time: ""
73-
exclude: # Skip debug on Mac. TODO: add Debug mode
74-
- os: macos-latest
75-
build_type: Debug
7676
steps:
7777
- uses: actions/checkout@v2
7878
- name: Setup cmake
@@ -83,8 +83,8 @@ jobs:
8383
run: |
8484
set -x
8585
if [ "$RUNNER_OS" == "Linux" ]; then
86-
export CC=clang-10
87-
export CXX=clang++-10
86+
export CC=clang-14
87+
export CXX=clang++-14
8888
fi
8989
9090
# Print information useful for debugging
@@ -136,9 +136,9 @@ jobs:
136136
# set +x
137137
138138
- name: Archive benchmark results
139-
uses: actions/upload-artifact@v2
139+
uses: actions/upload-artifact@v4
140140
with:
141-
name: bench_hexl_${{github.sha}}.csv
141+
name: bench_hexl_${{github.sha}}_${{github.run_id}}_${{github.job}}_${{matrix.os}}_${{matrix.build_type}}_Shared_${{matrix.shared_lib}}
142142
path: ${{ github.workspace }}/${{ github.workflow }}_${{ github.sha }}
143143
retention-days: 90 # Maximum for free version
144144

@@ -176,142 +176,3 @@ jobs:
176176
build/${{ matrix.build_type}}/example.exe
177177
178178
# TODO: add pkgconfig and vcpkg examples
179-
180-
181-
182-
ubuntu-1804-build:
183-
name: '${{ matrix.os }} ${{ matrix.build_type }} shared=${{ matrix.shared_lib }}'
184-
runs-on: '${{ matrix.os }}'
185-
defaults:
186-
run:
187-
shell: bash
188-
strategy:
189-
matrix:
190-
os: [ubuntu-18.04]
191-
build_type: [Release, Debug]
192-
shared_lib: [ON, OFF]
193-
include:
194-
# Run benchmarks quickly in Debug mode
195-
- build_type: Debug
196-
benchmark_min_time: "--benchmark_min_time=0.001"
197-
- build_type: Release
198-
benchmark_min_time: ""
199-
exclude: # Skip debug on Mac. TODO: add Debug mode
200-
- os: macos-latest
201-
build_type: Debug
202-
steps:
203-
- uses: actions/checkout@v2
204-
- name: Setup cmake
205-
uses: jwlawson/actions-setup-cmake@v1.10
206-
with:
207-
cmake-version: '3.13.x'
208-
- name: Default build
209-
run: |
210-
set -x
211-
if [ "$RUNNER_OS" == "Linux" ]; then
212-
export CC=gcc
213-
export CXX=g++
214-
fi
215-
216-
# Print information useful for debugging
217-
gcc --version
218-
g++ --version
219-
whoami
220-
echo $HOME
221-
echo $GITHUB_WORKSPACE
222-
echo "Testing from branch:"
223-
echo $GITHUB_REFH
224-
cmake --version
225-
pwd
226-
227-
# Build library
228-
cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
229-
-DHEXL_SHARED_LIB=${{ matrix.shared_lib }} \
230-
-DCMAKE_INSTALL_PREFIX=./
231-
cmake --build build -j
232-
cmake --build build --target install
233-
cmake --build build --target unittest
234-
# Instead of calling cmake --build build --target bench,
235-
# we run the executable directly to pass command-line arguments
236-
./build/benchmark/bench_hexl \
237-
--benchmark_out="${GITHUB_WORKFLOW}_${GITHUB_SHA}" \
238-
--benchmark_out_format=csv ${{ matrix.benchmark_min_time }}
239-
240-
# Build and run examples
241-
cd $GITHUB_WORKSPACE/example/cmake
242-
cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
243-
${{ env.HEXL_HINT_DIR }}
244-
cmake --build build
245-
build/example
246-
247-
# Build example using pkgconfig
248-
cd $GITHUB_WORKSPACE/example/pkgconfig
249-
# Set PKG_CONFIG_PATH to locate hexl.pc
250-
export PKG_CONFIG_PATH=$GITHUB_WORKSPACE/lib/pkgconfig
251-
cmake -S . -B build
252-
cmake --build build
253-
build/example
254-
255-
# Build example using vcpkg
256-
# TODO: fix vcpkg example CI
257-
# vcpkg install hexl --overlay-ports=$GITHUB_WORKSPACE/port/hexl/ --head
258-
# cd $GITHUB_WORKSPACE/example/vcpkg
259-
# vcpkg_toolchain=$(locate vcpkg.cmake)
260-
# echo $vcpkg_toolchain
261-
# cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=$vcpkg_toolchain
262-
# cmake --build build
263-
# build/example
264-
# set +x
265-
266-
- name: Archive benchmark results
267-
uses: actions/upload-artifact@v2
268-
with:
269-
name: bench_hexl_${{github.sha}}.csv
270-
path: ${{ github.workspace }}/${{ github.workflow }}_${{ github.sha }}
271-
retention-days: 90 # Maximum for free version
272-
273-
274-
275-
experimental-build:
276-
name: 'experimental: ${{ matrix.os }} ${{ matrix.build_type }} shared=${{ matrix.shared_lib }}'
277-
runs-on: '${{ matrix.os }}'
278-
defaults:
279-
run:
280-
shell: bash
281-
strategy:
282-
matrix:
283-
os: [ice-lake]
284-
build_type: [Release]
285-
shared_lib: [ON]
286-
steps:
287-
- uses: actions/checkout@v2
288-
- name: Default build
289-
run: |
290-
set -x
291-
if [ "$RUNNER_OS" == "Linux" ]; then
292-
export CC=clang-10
293-
export CXX=clang++-10
294-
fi
295-
296-
# Print information useful for debugging
297-
whoami
298-
echo $HOME
299-
echo $GITHUB_WORKSPACE
300-
echo "Testing from branch:"
301-
echo $GITHUB_REFH
302-
cmake --version
303-
pwd
304-
305-
# Build library
306-
cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
307-
-DHEXL_SHARED_LIB=${{ matrix.shared_lib }} \
308-
-DCMAKE_INSTALL_PREFIX=./ \
309-
-DHEXL_EXPERIMENTAL=ON
310-
cmake --build build -j
311-
cmake --build build --target install
312-
cmake --build build --target unittest
313-
# Instead of calling cmake --build build --target bench,
314-
# we run the executable directly to pass command-line arguments
315-
./build/benchmark/bench_hexl \
316-
--benchmark_out="${GITHUB_WORKFLOW}_${GITHUB_SHA}" \
317-
--benchmark_out_format=csv

CHANGES.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
# Changes
22

3-
## Version 1.2.5
3+
## Version 1.2.6
4+
- Update documentation to make a reference to OpenFHE
5+
- Complies with Clang-Format +11
6+
- Fixes EltwiseFMAMod Failing on 52 bits modulus (https://github.com/IntelLabs/hexl/pull/136)
7+
- Fixes Check Bounds for avx512 reduction mod_2 (https://github.com/IntelLabs/hexl/pull/153)
8+
- Fixes Destructor error (https://github.com/IntelLabs/hexl/pull/159)
9+
- Updates to CI/CD
10+
- Add SECURITY.md for OSSF Scorecard compliance
11+
- Added workflow permissions to meet OpenSSF Scorecard requirements
412

13+
## Version 1.2.5
514
- Adds experimental FFT-like (https://github.com/intel/hexl/pull/104)
615
- Adds big moduli tests for IFMA (https://github.com/intel/hexl/pull/123)
716
- Fixes HEXL's example build (https://github.com/intel/hexl/pull/114)

CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# target_link_options and cmake -S . -B build require cmake 3.13
55
cmake_minimum_required(VERSION 3.13)
6-
project(HEXL VERSION 1.2.5 LANGUAGES C CXX)
6+
project(HEXL VERSION 1.2.6 LANGUAGES C CXX)
77

88
include(CheckCCompilerFlag)
99
include(CheckCXXCompilerFlag)
@@ -66,6 +66,15 @@ if (NOT HEXL_FPGA_COMPATIBILITY)
6666
set(HEXL_FPGA_COMPATIBILITY "0" CACHE INTERNAL "Set FPGA compatibility mask" FORCE)
6767
endif()
6868

69+
# Get the current working branch
70+
execute_process(
71+
COMMAND git rev-parse --abbrev-ref HEAD
72+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
73+
OUTPUT_VARIABLE GIT_BRANCH
74+
OUTPUT_STRIP_TRAILING_WHITESPACE
75+
)
76+
77+
message(STATUS "HEXL BRANCH: ${GIT_BRANCH}")
6978
message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
7079
message(STATUS "CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}")
7180
message(STATUS "CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}")

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
# Default codeowner for all files
5-
* @intel/hexl-maintain
5+
* @IntelLabs/hexl-maintain

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build and Test](https://github.com/intel/hexl/actions/workflows/github-ci.yml/badge.svg?branch=main)](https://github.com/intel/hexl/actions/workflows/github-ci.yml)
1+
[![Build and Test](https://github.com/intel/hexl/actions/workflows/github-ci.yml/badge.svg)](https://github.com/intel/hexl/actions/workflows/github-ci.yml)
22

33
# Intel Homomorphic Encryption (HE) Acceleration Library
44
Intel:registered: HE Acceleration Library is an open-source library which
@@ -268,6 +268,7 @@ Intel HE Acceleration Library is single-threaded and thread-safe.
268268

269269
Intel HE Acceleration Library has been integrated to the following homomorphic
270270
encryption libraries:
271+
- [OpenFHE](https://github.com/openfheorg/openfhe-development)
271272
- [PALISADE](https://gitlab.com/palisade/palisade-release)
272273
- [Microsoft SEAL](https://github.com/microsoft/SEAL)
273274
- [HElib](https://github.com/homenc/HElib)

SECURITY.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Security Policy
2+
Intel is committed to rapidly addressing security vulnerabilities affecting
3+
our customers and providing clear guidance on the solution, impact, severity
4+
and mitigation.
5+
6+
## Reporting a Vulnerability
7+
Please report any security vulnerabilities in this project utilizing the
8+
guidelines [here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html).

example/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ Once you have installed Intel HE Acceleration Library. Then, in your external
2929
application, add the following lines to your `CMakeLists.txt`:
3030

3131
```bash
32-
find_package(HEXL 1.2.5
32+
find_package(HEXL 1.2.6
3333
HINTS ${HEXL_HINT_DIR}
3434
REQUIRED)
3535
target_link_libraries(<your target> HEXL::hexl)
3636
```
3737
If Intel HE Acceleration Library is installed globally, `HEXL_HINT_DIR` is not
3838
needed. Otherwise, `HEXL_HINT_DIR` should be the directory containing
39-
`HEXLConfig.cmake`, e.g. `${CMAKE_INSTALL_PREFIX}/lib/cmake/hexl-1.2.5/`
39+
`HEXLConfig.cmake`, e.g. `${CMAKE_INSTALL_PREFIX}/lib/cmake/hexl-1.2.6/`
4040

4141
## Method 2 (pkgconfig)
4242

example/cmake/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.13)
66
set(CMAKE_CXX_STANDARD 17)
77

88
# Example using source
9-
find_package(HEXL 1.2.5
9+
find_package(HEXL 1.2.6
1010
HINTS ${HEXL_HINT_DIR}
1111
REQUIRED)
1212
if (NOT TARGET HEXL::hexl)

example/vcpkg/vcpkg.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"dependencies": [
55
{
66
"name": "hexl",
7-
"version>=": "1.2.5"
7+
"version>=": "1.2.6"
88
}
99
],
1010
"builtin-baseline": "7baf7bc9f3390bab2f47e2bcbd35b065663bc80d",
1111
"overrides": [
12-
{ "name": "hexl", "version": "1.2.1", "port-version": 0}
12+
{ "name": "hexl", "version": "1.2.6", "port-version": 0}
1313
]
1414
}

hexl/eltwise/eltwise-fma-mod.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void EltwiseFMAMod(uint64_t* result, const uint64_t* arg1, uint64_t arg2,
4040
<< (input_mod_factor * modulus));
4141

4242
#ifdef HEXL_HAS_AVX512IFMA
43-
if (has_avx512ifma && input_mod_factor * modulus < (1ULL << 52)) {
43+
if (has_avx512ifma && input_mod_factor * modulus < (1ULL << 51)) {
4444
HEXL_VLOG(3, "Calling 52-bit EltwiseFMAModAVX512");
4545

4646
switch (input_mod_factor) {

0 commit comments

Comments
 (0)