diff --git a/.github/workflows/aws_tfhe_integer_tests.yml b/.github/workflows/aws_tfhe_integer_tests.yml index 54df464b0..400d8fb42 100644 --- a/.github/workflows/aws_tfhe_integer_tests.yml +++ b/.github/workflows/aws_tfhe_integer_tests.yml @@ -71,7 +71,7 @@ jobs: - name: Run integer tests run: | - BIG_TESTS_INSTANCE=TRUE make test_integer_ci + AVX512_SUPPORT=ON BIG_TESTS_INSTANCE=TRUE make test_integer_ci - name: Slack Notification if: ${{ always() }} diff --git a/.github/workflows/aws_tfhe_multi_bit_tests.yml b/.github/workflows/aws_tfhe_multi_bit_tests.yml index 3f08e88ba..b2677bb65 100644 --- a/.github/workflows/aws_tfhe_multi_bit_tests.yml +++ b/.github/workflows/aws_tfhe_multi_bit_tests.yml @@ -75,7 +75,7 @@ jobs: - name: Run integer multi-bit tests run: | - make test_integer_multi_bit_ci + AVX512_SUPPORT=ON make test_integer_multi_bit_ci - name: Slack Notification if: ${{ always() }} diff --git a/Makefile b/Makefile index fd24bfa30..27bb081ea 100644 --- a/Makefile +++ b/Makefile @@ -363,18 +363,18 @@ test_shortint_cov: install_rs_check_toolchain install_tarpaulin -p tfhe -- shortint:: .PHONY: test_integer_ci # Run the tests for integer ci -test_integer_ci: install_rs_build_toolchain install_cargo_nextest +test_integer_ci: install_rs_check_toolchain install_cargo_nextest BIG_TESTS_INSTANCE="$(BIG_TESTS_INSTANCE)" \ FAST_TESTS="$(FAST_TESTS)" \ - ./scripts/integer-tests.sh --rust-toolchain $(CARGO_RS_BUILD_TOOLCHAIN) \ - --cargo-profile "$(CARGO_PROFILE)" + ./scripts/integer-tests.sh --rust-toolchain $(CARGO_RS_CHECK_TOOLCHAIN) \ + --cargo-profile "$(CARGO_PROFILE)" --avx512-support "$(AVX512_SUPPORT)" .PHONY: test_integer_multi_bit_ci # Run the tests for integer ci running only multibit tests -test_integer_multi_bit_ci: install_rs_build_toolchain install_cargo_nextest +test_integer_multi_bit_ci: install_rs_check_toolchain install_cargo_nextest BIG_TESTS_INSTANCE="$(BIG_TESTS_INSTANCE)" \ FAST_TESTS="$(FAST_TESTS)" \ - ./scripts/integer-tests.sh --rust-toolchain $(CARGO_RS_BUILD_TOOLCHAIN) \ - --cargo-profile "$(CARGO_PROFILE)" --multi-bit + ./scripts/integer-tests.sh --rust-toolchain $(CARGO_RS_CHECK_TOOLCHAIN) \ + --cargo-profile "$(CARGO_PROFILE)" --multi-bit --avx512-support "$(AVX512_SUPPORT)" .PHONY: test_safe_deserialization # Run the tests for safe deserialization test_safe_deserialization: install_rs_build_toolchain install_cargo_nextest diff --git a/scripts/integer-tests.sh b/scripts/integer-tests.sh index 74144c80c..805b3482e 100755 --- a/scripts/integer-tests.sh +++ b/scripts/integer-tests.sh @@ -9,6 +9,7 @@ function usage() { echo "--rust-toolchain The toolchain to run the tests with default: stable" echo "--multi-bit Run multi-bit tests only: default off" echo "--cargo-profile The cargo profile used to build tests" + echo "--avx512-support Set to ON to enable avx512" echo } @@ -16,6 +17,7 @@ RUST_TOOLCHAIN="+stable" multi_bit="" not_multi_bit="_multi_bit" cargo_profile="release" +avx512_feature="" while [ -n "$1" ] do @@ -40,6 +42,13 @@ do cargo_profile="$1" ;; + "--avx512-support" ) + shift + if [[ "$1" == "ON" ]]; then + avx512_feature=nightly-avx512 + fi + ;; + *) echo "Unknown param : $1" exit 1 @@ -104,7 +113,7 @@ and not test(/.*default_add_sequence_multi_thread_param_message_3_carry_3_ks_pbs --cargo-profile "${cargo_profile}" \ --package tfhe \ --profile ci \ - --features="${ARCH_FEATURE}",integer,internal-keycache \ + --features="${ARCH_FEATURE}",integer,internal-keycache,"${avx512_feature}" \ --test-threads "${n_threads}" \ -E "$filter_expression" @@ -112,7 +121,7 @@ and not test(/.*default_add_sequence_multi_thread_param_message_3_carry_3_ks_pbs cargo "${RUST_TOOLCHAIN}" test \ --profile "${cargo_profile}" \ --package tfhe \ - --features="${ARCH_FEATURE}",integer,internal-keycache \ + --features="${ARCH_FEATURE}",integer,internal-keycache,"${avx512_feature}" \ --doc \ -- integer:: fi @@ -148,7 +157,7 @@ and not test(/.*default_add_sequence_multi_thread_param_message_3_carry_3_ks_pbs --cargo-profile "${cargo_profile}" \ --package tfhe \ --profile ci \ - --features="${ARCH_FEATURE}",integer,internal-keycache \ + --features="${ARCH_FEATURE}",integer,internal-keycache,"${avx512_feature}" \ --test-threads $num_threads \ -E "$filter_expression" @@ -156,7 +165,7 @@ and not test(/.*default_add_sequence_multi_thread_param_message_3_carry_3_ks_pbs cargo "${RUST_TOOLCHAIN}" test \ --profile "${cargo_profile}" \ --package tfhe \ - --features="${ARCH_FEATURE}",integer,internal-keycache \ + --features="${ARCH_FEATURE}",integer,internal-keycache,"${avx512_feature}" \ --doc \ -- --test-threads="$(${nproc_bin})" integer:: fi