Skip to content

Commit

Permalink
chore(ci): reduce ci duration by not running 4_4 parameters set
Browse files Browse the repository at this point in the history
This only apply for CI triggered in pull-request. A nightly run is added that run 4bits message/4bits carry parameters set.
  • Loading branch information
soonum committed Jun 28, 2024
1 parent 7c80f29 commit 22e9505
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 3 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/aws_tfhe_integer_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@ env:
# We clear the cache to reduce memory pressure because of the numerous processes of cargo
# nextest
TFHE_RS_CLEAR_IN_MEMORY_KEY_CACHE: "1"
NO_BIG_PARAMS: FALSE

on:
# Allows you to run this workflow manually from the Actions tab as an alternative.
workflow_dispatch:
pull_request:
types: [ labeled ]
push:
branches:
- main
schedule:
# Nightly tests @ 3AM after each work day
- cron: "0 3 * * MON-FRI"

jobs:
setup-instance:
Expand Down Expand Up @@ -61,6 +68,11 @@ jobs:
with:
toolchain: stable

- name: Should skip big parameters set
if: github.event_name == 'pull_request'
run: |
echo "NO_BIG_PARAMS=TRUE" >> "${GITHUB_ENV}"
- name: Gen Keys if required
run: |
make GEN_KEY_CACHE_MULTI_BIT_ONLY=TRUE gen_key_cache
Expand All @@ -75,7 +87,7 @@ jobs:
- name: Run unsigned integer tests
run: |
AVX512_SUPPORT=ON BIG_TESTS_INSTANCE=TRUE make test_unsigned_integer_ci
AVX512_SUPPORT=ON NO_BIG_PARAMS=${{ env.NO_BIG_PARAMS }} BIG_TESTS_INSTANCE=TRUE make test_unsigned_integer_ci
- name: Slack Notification
if: ${{ always() }}
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/aws_tfhe_signed_integer_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@ env:
# We clear the cache to reduce memory pressure because of the numerous processes of cargo
# nextest
TFHE_RS_CLEAR_IN_MEMORY_KEY_CACHE: "1"
NO_BIG_PARAMS: FALSE

on:
# Allows you to run this workflow manually from the Actions tab as an alternative.
workflow_dispatch:
pull_request:
types: [ labeled ]
push:
branches:
- main
schedule:
# Nightly tests @ 3AM after each work day
- cron: "0 3 * * MON-FRI"

jobs:
setup-instance:
Expand Down Expand Up @@ -61,6 +68,11 @@ jobs:
with:
toolchain: stable

- name: Should skip big parameters set
if: github.event_name == 'pull_request'
run: |
echo "NO_BIG_PARAMS=TRUE" >> "${GITHUB_ENV}"
- name: Gen Keys if required
run: |
make GEN_KEY_CACHE_MULTI_BIT_ONLY=TRUE gen_key_cache
Expand All @@ -79,7 +91,7 @@ jobs:
- name: Run signed integer tests
run: |
AVX512_SUPPORT=ON BIG_TESTS_INSTANCE=TRUE make test_signed_integer_ci
AVX512_SUPPORT=ON NO_BIG_PARAMS=${{ env.NO_BIG_PARAMS }} BIG_TESTS_INSTANCE=TRUE make test_signed_integer_ci
- name: Slack Notification
if: ${{ always() }}
Expand Down
7 changes: 6 additions & 1 deletion scripts/integer-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ RUST_TOOLCHAIN="+stable"
multi_bit_argument=
sign_argument=
fast_tests_argument=
no_big_params_argument=
cargo_profile="release"
backend="cpu"
gpu_feature=""
Expand Down Expand Up @@ -89,6 +90,10 @@ if [[ "${FAST_TESTS}" == TRUE ]]; then
fast_tests_argument=--fast-tests
fi

if [[ "${NO_BIG_PARAMS}" == TRUE ]]; then
no_big_params_argument=--no-big-params
fi

if [[ "${backend}" == "gpu" ]]; then
gpu_feature="gpu"
fi
Expand Down Expand Up @@ -117,7 +122,7 @@ else
doctest_threads="${num_cpu_threads}"
fi

filter_expression=$(/usr/bin/python3 scripts/test_filtering.py --layer integer --backend "${backend}" ${fast_tests_argument} ${multi_bit_argument} ${sign_argument})
filter_expression=$(/usr/bin/python3 scripts/test_filtering.py --layer integer --backend "${backend}" ${fast_tests_argument} ${multi_bit_argument} ${sign_argument} ${no_big_params_argument})

if [[ "${FAST_TESTS}" == "TRUE" ]]; then
echo "Running 'fast' test set'"
Expand Down
13 changes: 13 additions & 0 deletions scripts/test_filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
action="store_true",
help="Include only unsigned integer tests",
)
parser.add_argument(
"--no-big-params",
dest="no_big_params",
action="store_true",
help="Do not run tests with big parameters set (e.g. 4bits message with 4 bits carry)",
)

# block PBS are too slow for high params
# mul_crt_4_4 is extremely flaky (~80% failure)
Expand Down Expand Up @@ -77,6 +83,9 @@
"/.*default_add_sequence_multi_thread_param_message_3_carry_3_ks_pbs$/",
]

EXCLUDED_BIG_PARAMETERS = [
"/.*_param_message_4_carry_4_ks_pbs$/",
]

def filter_integer_tests(input_args):
multi_bit_filter = "_multi_bit" if input_args.multi_bit else ""
Expand All @@ -96,6 +105,10 @@ def filter_integer_tests(input_args):
if input_args.unsigned_only:
filter_expression.append("not test(~_signed)")

if input_args.no_big_params:
for pattern in EXCLUDED_BIG_PARAMETERS:
filter_expression.append(f"not test({pattern})")

if input_args.fast_tests:
# Test only fast default operations with only two set of parameters
param_group = "_group_2" if input_args.multi_bit else ""
Expand Down

0 comments on commit 22e9505

Please sign in to comment.