mirror of
https://github.com/zama-ai/tfhe-rs.git
synced 2026-01-08 22:28:01 -05:00
chore(ci): re-organize tests a bit for better parallelism usage
This commit is contained in:
@@ -12,19 +12,25 @@ if [[ $(uname) == "Darwin" ]]; then
|
||||
nproc_bin="sysctl -n hw.logicalcpu"
|
||||
fi
|
||||
|
||||
n_threads="$(${nproc_bin})"
|
||||
n_threads_small="$(${nproc_bin})"
|
||||
n_threads_big="${n_threads_small}"
|
||||
|
||||
# TODO: automate thread selection by measuring host machine ram and loading the key sizes from the
|
||||
# 'keys' cache directory keeping a safety margin for test execution
|
||||
|
||||
if uname -a | grep "arm64"; then
|
||||
if [[ $(uname) == "Darwin" ]]; then
|
||||
# Keys are 2 gigs at max, CI M1 macs only has 8 gigs of RAM so a bit conservative here
|
||||
n_threads_small=3
|
||||
# Keys are 4.7 gigs at max, CI M1 macs only has 8 gigs of RAM
|
||||
n_threads=1
|
||||
n_threads_big=1
|
||||
fi
|
||||
else
|
||||
# Keys are 4.7 gigs at max, test machine has 32 gigs of RAM
|
||||
n_threads=6
|
||||
# Keys are 4.7 gigs at max, test machine has 64 gigs of RAM
|
||||
n_threads_big=13
|
||||
fi
|
||||
|
||||
filter_expression=''\
|
||||
filter_expression_small_params=''\
|
||||
'('\
|
||||
' test(/^shortint::.*_param_message_1_carry_1$/)'\
|
||||
'or test(/^shortint::.*_param_message_1_carry_2$/)'\
|
||||
@@ -38,31 +44,34 @@ filter_expression=''\
|
||||
'or test(/^shortint::.*_param_message_3_carry_1$/)'\
|
||||
'or test(/^shortint::.*_param_message_3_carry_2$/)'\
|
||||
'or test(/^shortint::.*_param_message_3_carry_3$/)'\
|
||||
'or test(/^shortint::.*_param_message_4_carry_4$/)'\
|
||||
')'\
|
||||
'and not test(~smart_add_and_mul)' # This test is too slow
|
||||
|
||||
# Run tests only no examples or benches
|
||||
# Run tests only no examples or benches with small params and more threads
|
||||
cargo ${1:+"${1}"} nextest run \
|
||||
--tests \
|
||||
--release \
|
||||
--package tfhe \
|
||||
--profile ci \
|
||||
--features="${ARCH_FEATURE}",shortint,internal-keycache \
|
||||
--test-threads "${n_threads}" \
|
||||
-E "${filter_expression}"
|
||||
--test-threads "${n_threads_small}" \
|
||||
-E "${filter_expression_small_params}"
|
||||
|
||||
filter_expression_wopbs='test(/^shortint::wopbs::.*$/)'
|
||||
filter_expression_big_params=''\
|
||||
'('\
|
||||
' test(/^shortint::.*_param_message_4_carry_4$/)'\
|
||||
')'\
|
||||
'and not test(~smart_add_and_mul)'
|
||||
|
||||
# Run tests only no examples or benches for wopbs
|
||||
# Run tests only no examples or benches with big params and less threads
|
||||
cargo ${1:+"${1}"} nextest run \
|
||||
--tests \
|
||||
--release \
|
||||
--package tfhe \
|
||||
--profile ci \
|
||||
--features="${ARCH_FEATURE}",shortint,internal-keycache \
|
||||
--test-threads "${n_threads}" \
|
||||
-E "${filter_expression_wopbs}"
|
||||
--test-threads "${n_threads_big}" \
|
||||
-E "${filter_expression_big_params}"
|
||||
|
||||
cargo ${1:+"${1}"} test \
|
||||
--release \
|
||||
|
||||
Reference in New Issue
Block a user