mirror of
https://github.com/zama-ai/concrete.git
synced 2026-04-17 03:00:54 -04:00
test(frontend-python): increase the number of retries for table lookup tests
This commit is contained in:
@@ -59,7 +59,7 @@ def test_bitwise(function, parameters, helpers):
|
||||
circuit = compiler.compile(inputset, configuration)
|
||||
|
||||
sample = helpers.generate_sample(parameters)
|
||||
helpers.check_execution(circuit, function, sample)
|
||||
helpers.check_execution(circuit, function, sample, retries=3)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -114,4 +114,4 @@ def test_bitwise_optimized(function, parameters, helpers):
|
||||
circuit = compiler.compile(inputset, configuration)
|
||||
|
||||
sample = helpers.generate_sample(parameters)
|
||||
helpers.check_execution(circuit, function, sample)
|
||||
helpers.check_execution(circuit, function, sample, retries=3)
|
||||
|
||||
@@ -87,7 +87,7 @@ def test_comparison(function, parameters, helpers):
|
||||
circuit = compiler.compile(inputset, configuration)
|
||||
|
||||
sample = helpers.generate_sample(parameters)
|
||||
helpers.check_execution(circuit, function, sample)
|
||||
helpers.check_execution(circuit, function, sample, retries=3)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -158,4 +158,4 @@ def test_optimized_comparison(function, parameters, helpers):
|
||||
circuit = compiler.compile(inputset, configuration)
|
||||
|
||||
sample = helpers.generate_sample(parameters)
|
||||
helpers.check_execution(circuit, function, sample)
|
||||
helpers.check_execution(circuit, function, sample, retries=3)
|
||||
|
||||
@@ -172,7 +172,7 @@ def test_direct_table_lookup(bits, function, helpers):
|
||||
circuit = compiler.compile(inputset, configuration)
|
||||
|
||||
sample = int(np.random.randint(0, 2**bits))
|
||||
helpers.check_execution(circuit, function, sample)
|
||||
helpers.check_execution(circuit, function, sample, retries=3)
|
||||
|
||||
# tensor
|
||||
# ------
|
||||
@@ -183,7 +183,7 @@ def test_direct_table_lookup(bits, function, helpers):
|
||||
circuit = compiler.compile(inputset, configuration)
|
||||
|
||||
sample = np.random.randint(0, 2**bits, size=(3, 2))
|
||||
helpers.check_execution(circuit, function, sample)
|
||||
helpers.check_execution(circuit, function, sample, retries=3)
|
||||
|
||||
# negative scalar
|
||||
# ---------------
|
||||
@@ -194,7 +194,7 @@ def test_direct_table_lookup(bits, function, helpers):
|
||||
circuit = compiler.compile(inputset, configuration)
|
||||
|
||||
sample = int(np.random.randint(-(2 ** (bits - 1)), 2 ** (bits - 1)))
|
||||
helpers.check_execution(circuit, function, sample)
|
||||
helpers.check_execution(circuit, function, sample, retries=3)
|
||||
|
||||
# negative tensor
|
||||
# ---------------
|
||||
@@ -207,7 +207,7 @@ def test_direct_table_lookup(bits, function, helpers):
|
||||
circuit = compiler.compile(inputset, configuration)
|
||||
|
||||
sample = np.random.randint(-(2 ** (bits - 1)), 2 ** (bits - 1), size=(3, 2))
|
||||
helpers.check_execution(circuit, function, sample)
|
||||
helpers.check_execution(circuit, function, sample, retries=3)
|
||||
|
||||
|
||||
def test_direct_multi_table_lookup(helpers):
|
||||
@@ -237,7 +237,7 @@ def test_direct_multi_table_lookup(helpers):
|
||||
circuit = compiler.compile(inputset, configuration)
|
||||
|
||||
sample = np.random.randint(0, 2**2, size=(3, 2))
|
||||
helpers.check_execution(circuit, function, sample)
|
||||
helpers.check_execution(circuit, function, sample, retries=3)
|
||||
|
||||
|
||||
def test_bad_direct_table_lookup(helpers):
|
||||
|
||||
@@ -120,7 +120,7 @@ def test_maxpool2d(
|
||||
circuit = compiler.compile(inputset, configuration)
|
||||
|
||||
sample = helpers.generate_sample(parameters)
|
||||
helpers.check_execution(circuit, function, sample)
|
||||
helpers.check_execution(circuit, function, sample, retries=3)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
||||
@@ -168,7 +168,7 @@ def test_mul(function, parameters, helpers):
|
||||
circuit = compiler.compile(inputset, configuration)
|
||||
|
||||
sample = helpers.generate_sample(parameters)
|
||||
helpers.check_execution(circuit, function, sample)
|
||||
helpers.check_execution(circuit, function, sample, retries=3)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
||||
@@ -704,7 +704,7 @@ def test_others(function, parameters, helpers):
|
||||
circuit = compiler.compile(inputset, configuration)
|
||||
|
||||
sample = helpers.generate_sample(parameters)
|
||||
helpers.check_execution(circuit, function, sample)
|
||||
helpers.check_execution(circuit, function, sample, retries=3)
|
||||
|
||||
# tensor
|
||||
# ------
|
||||
@@ -724,7 +724,7 @@ def test_others(function, parameters, helpers):
|
||||
circuit = compiler.compile(inputset, configuration)
|
||||
|
||||
sample = helpers.generate_sample(parameters)
|
||||
helpers.check_execution(circuit, function, sample)
|
||||
helpers.check_execution(circuit, function, sample, retries=3)
|
||||
|
||||
|
||||
def test_others_bad_fusing(helpers):
|
||||
|
||||
@@ -132,10 +132,10 @@ def test_round_bit_pattern(input_bits, lsbs_to_remove, mapper, overflow, helpers
|
||||
inputset.append(upper_bound - 1)
|
||||
|
||||
circuit = function.compile(inputset, helpers.configuration())
|
||||
helpers.check_execution(circuit, function, np.random.randint(0, upper_bound))
|
||||
helpers.check_execution(circuit, function, np.random.randint(0, upper_bound), retries=3)
|
||||
|
||||
for value in inputset:
|
||||
helpers.check_execution(circuit, function, value)
|
||||
helpers.check_execution(circuit, function, value, retries=3)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -161,7 +161,7 @@ def test_round_bit_pattern_unsigned_range(input_bits, lsbs_to_remove, helpers):
|
||||
circuit = function.compile(inputset, helpers.configuration())
|
||||
|
||||
for value in inputset:
|
||||
helpers.check_execution(circuit, function, value)
|
||||
helpers.check_execution(circuit, function, value, retries=3)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -187,7 +187,7 @@ def test_round_bit_pattern_signed_range(input_bits, lsbs_to_remove, helpers):
|
||||
circuit = function.compile(inputset, helpers.configuration())
|
||||
|
||||
for value in inputset:
|
||||
helpers.check_execution(circuit, function, value)
|
||||
helpers.check_execution(circuit, function, value, retries=3)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -214,7 +214,7 @@ def test_round_bit_pattern_unsigned_range_assigned(input_bits, lsbs_to_remove, h
|
||||
circuit = function.compile(inputset, helpers.configuration())
|
||||
|
||||
for value in inputset:
|
||||
helpers.check_execution(circuit, function, value)
|
||||
helpers.check_execution(circuit, function, value, retries=3)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -241,7 +241,7 @@ def test_round_bit_pattern_signed_range_assigned(input_bits, lsbs_to_remove, hel
|
||||
circuit = function.compile(inputset, helpers.configuration())
|
||||
|
||||
for value in inputset:
|
||||
helpers.check_execution(circuit, function, value)
|
||||
helpers.check_execution(circuit, function, value, retries=3)
|
||||
|
||||
|
||||
def test_round_bit_pattern_no_overflow_protection(helpers, pytestconfig):
|
||||
|
||||
@@ -51,7 +51,7 @@ def test_left_shift(function, parameters, helpers):
|
||||
circuit = compiler.compile(inputset, configuration)
|
||||
|
||||
sample = helpers.generate_sample(parameters)
|
||||
helpers.check_execution(circuit, function, sample)
|
||||
helpers.check_execution(circuit, function, sample, retries=3)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -98,7 +98,7 @@ def test_right_shift(function, parameters, helpers):
|
||||
circuit = compiler.compile(inputset, configuration)
|
||||
|
||||
sample = helpers.generate_sample(parameters)
|
||||
helpers.check_execution(circuit, function, sample)
|
||||
helpers.check_execution(circuit, function, sample, retries=3)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -134,7 +134,7 @@ def test_left_shift_coverage(function, parameters, helpers):
|
||||
|
||||
for i in range(2):
|
||||
for j in range(8):
|
||||
helpers.check_execution(circuit, function, [i, j])
|
||||
helpers.check_execution(circuit, function, [i, j], retries=3)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -168,11 +168,11 @@ def test_right_shift_coverage(function, parameters, helpers):
|
||||
inputset = helpers.generate_inputset(parameters)
|
||||
circuit = compiler.compile(inputset, configuration)
|
||||
|
||||
helpers.check_execution(circuit, function, [0b11, 0])
|
||||
helpers.check_execution(circuit, function, [0b11, 1])
|
||||
helpers.check_execution(circuit, function, [0b110, 2])
|
||||
helpers.check_execution(circuit, function, [0b1100, 3])
|
||||
helpers.check_execution(circuit, function, [0b11000, 4])
|
||||
helpers.check_execution(circuit, function, [0b110000, 5])
|
||||
helpers.check_execution(circuit, function, [0b110000, 6])
|
||||
helpers.check_execution(circuit, function, [0b1100000, 7])
|
||||
helpers.check_execution(circuit, function, [0b11, 0], retries=3)
|
||||
helpers.check_execution(circuit, function, [0b11, 1], retries=3)
|
||||
helpers.check_execution(circuit, function, [0b110, 2], retries=3)
|
||||
helpers.check_execution(circuit, function, [0b1100, 3], retries=3)
|
||||
helpers.check_execution(circuit, function, [0b11000, 4], retries=3)
|
||||
helpers.check_execution(circuit, function, [0b110000, 5], retries=3)
|
||||
helpers.check_execution(circuit, function, [0b110000, 6], retries=3)
|
||||
helpers.check_execution(circuit, function, [0b1100000, 7], retries=3)
|
||||
|
||||
Reference in New Issue
Block a user