chore: fix inputsets in benchmark

This commit is contained in:
Arthur Meyre
2021-12-02 09:39:22 +01:00
parent bc1926903c
commit eaaae6efaf
29 changed files with 29 additions and 35 deletions

View File

@@ -18,7 +18,7 @@ def main():
engine = hnp.compile_numpy_function(
function_to_compile,
{"x": x},
[(i,) for i in range(2 ** 3)],
range(2 ** 3),
compilation_configuration=BENCHMARK_CONFIGURATION,
)
# bench: Measure: End

View File

@@ -12,7 +12,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(6), shape=(3,))
inputset = [(np.random.randint(0, 2 ** 6, size=(3,)),) for _ in range(32)]
inputset = [np.random.randint(0, 2 ** 6, size=(3,)) for _ in range(32)]
# bench: Measure: Compilation Time (ms)
engine = hnp.compile_numpy_function(

View File

@@ -13,7 +13,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(4, 5))
c = np.arange(20).reshape((4, 5))
inputset = [(np.random.randint(0, 2 ** 3, size=(4, 5)),) for _ in range(128)]
inputset = [np.random.randint(0, 2 ** 3, size=(4, 5)) for _ in range(128)]
inputs = []
labels = []

View File

@@ -14,7 +14,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(2), shape=(2, 3))
inputset = [(np.random.randint(0, 2 ** 2, size=(2, 3)),) for _ in range(128)]
inputset = [np.random.randint(0, 2 ** 2, size=(2, 3)) for _ in range(128)]
inputs = []
labels = []

View File

@@ -168,9 +168,7 @@ def main():
def function_to_compile(x_0):
return table[(x_0 + zp_x) * w_0]
inputset = []
for x_i in x_q:
inputset.append((int(x_i[0]),))
inputset = [int(x_i[0]) for x_i in x_q]
# bench: Measure: Compilation Time (ms)
engine = hnp.compile_numpy_function(

View File

@@ -240,9 +240,7 @@ def main():
def function_to_compile(x_0, x_1):
return table[((x_0 + zp_x) * w_0) + ((x_1 + zp_x) * w_1)]
inputset = []
for x_i in x_q:
inputset.append((int(x_i[0]), int(x_i[1])))
inputset = [(int(x_i[0]), int(x_i[1])) for x_i in x_q]
# bench: Measure: Compilation Time (ms)
engine = hnp.compile_numpy_function(

View File

@@ -12,7 +12,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3, 2))
inputset = [(np.random.randint(0, 2 ** 3, size=(3, 2)),) for _ in range(32)]
inputset = [np.random.randint(0, 2 ** 3, size=(3, 2)) for _ in range(32)]
# bench: Measure: Compilation Time (ms)
engine = hnp.compile_numpy_function(

View File

@@ -12,7 +12,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,))
inputset = [(np.random.randint(0, 2 ** 3, size=(3,)),) for _ in range(32)]
inputset = [np.random.randint(0, 2 ** 3, size=(3,)) for _ in range(32)]
# bench: Measure: Compilation Time (ms)
engine = hnp.compile_numpy_function(

View File

@@ -12,7 +12,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,))
inputset = [(np.random.randint(0, 2 ** 3, size=(3,)),) for _ in range(32)]
inputset = [np.random.randint(0, 2 ** 3, size=(3,)) for _ in range(32)]
# bench: Measure: Compilation Time (ms)
engine = hnp.compile_numpy_function(

View File

@@ -12,7 +12,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,))
inputset = [(np.random.randint(0, 2 ** 3, size=(3,)),) for _ in range(32)]
inputset = [np.random.randint(0, 2 ** 3, size=(3,)) for _ in range(32)]
# bench: Measure: Compilation Time (ms)
engine = hnp.compile_numpy_function(

View File

@@ -12,7 +12,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3, 2))
inputset = [(np.random.randint(0, 2 ** 3, size=(3, 2)),) for _ in range(32)]
inputset = [np.random.randint(0, 2 ** 3, size=(3, 2)) for _ in range(32)]
# bench: Measure: Compilation Time (ms)
engine = hnp.compile_numpy_function(

View File

@@ -12,7 +12,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,))
inputset = [(np.random.randint(0, 2 ** 3, size=(3,)),) for _ in range(32)]
inputset = [np.random.randint(0, 2 ** 3, size=(3,)) for _ in range(32)]
# bench: Measure: Compilation Time (ms)
engine = hnp.compile_numpy_function(

View File

@@ -12,7 +12,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,))
inputset = [(np.random.randint(0, 2 ** 3, size=(3,)),) for _ in range(32)]
inputset = [np.random.randint(0, 2 ** 3, size=(3,)) for _ in range(32)]
# bench: Measure: Compilation Time (ms)
engine = hnp.compile_numpy_function(

View File

@@ -12,7 +12,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,))
inputset = [(np.random.randint(0, 2 ** 3, size=(3,)),) for _ in range(32)]
inputset = [np.random.randint(0, 2 ** 3, size=(3,)) for _ in range(32)]
# bench: Measure: Compilation Time (ms)
engine = hnp.compile_numpy_function(

View File

@@ -12,7 +12,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,))
inputset = [(np.random.randint(0, 2 ** 3, size=(3,)),) for _ in range(32)]
inputset = [np.random.randint(0, 2 ** 3, size=(3,)) for _ in range(32)]
# bench: Measure: Compilation Time (ms)
engine = hnp.compile_numpy_function(

View File

@@ -13,7 +13,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(4, 5))
c = np.arange(20).reshape((4, 5))
inputset = [(np.random.randint(0, 2 ** 3, size=(4, 5)),) for _ in range(128)]
inputset = [np.random.randint(0, 2 ** 3, size=(4, 5)) for _ in range(128)]
inputs = []
labels = []

View File

@@ -14,7 +14,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(2), shape=(2, 3))
inputset = [(np.random.randint(0, 2 ** 2, size=(2, 3)),) for _ in range(128)]
inputset = [np.random.randint(0, 2 ** 2, size=(2, 3)) for _ in range(128)]
inputs = []
labels = []

View File

@@ -12,7 +12,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,))
inputset = [(np.random.randint(0, 2 ** 2, size=(3,)) + np.array([1, 2, 3]),) for _ in range(32)]
inputset = [np.random.randint(0, 2 ** 2, size=(3,)) + np.array([1, 2, 3]) for _ in range(32)]
# bench: Measure: Compilation Time (ms)
engine = hnp.compile_numpy_function(

View File

@@ -12,9 +12,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(2, 3))
inputset = [
(np.random.randint(0, 2 ** 2, size=(2, 3)) + np.array([1, 2, 3]),) for _ in range(32)
]
inputset = [np.random.randint(0, 2 ** 2, size=(2, 3)) + np.array([1, 2, 3]) for _ in range(32)]
# bench: Measure: Compilation Time (ms)
engine = hnp.compile_numpy_function(

View File

@@ -12,7 +12,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(6), shape=(3,))
inputset = [(np.random.randint(0, 2 ** 5, size=(3,)) + 24,) for _ in range(32)]
inputset = [np.random.randint(0, 2 ** 5, size=(3,)) + 24 for _ in range(32)]
# bench: Measure: Compilation Time (ms)
engine = hnp.compile_numpy_function(

View File

@@ -13,7 +13,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(10, 6))
inputset = [(np.random.randint(0, 2 ** 3, size=(10, 6)),) for _ in range(128)]
inputset = [np.random.randint(0, 2 ** 3, size=(10, 6)) for _ in range(128)]
inputs = []
labels = []

View File

@@ -12,7 +12,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,))
inputset = [(np.random.randint(0, 2 ** 3, size=(3,)),) for _ in range(32)]
inputset = [np.random.randint(0, 2 ** 3, size=(3,)) for _ in range(32)]
# bench: Measure: Compilation Time (ms)
engine = hnp.compile_numpy_function(

View File

@@ -12,7 +12,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(2, 3))
inputset = [(np.random.randint(0, 2 ** 3, size=(2, 3)),) for _ in range(32)]
inputset = [np.random.randint(0, 2 ** 3, size=(2, 3)) for _ in range(32)]
# bench: Measure: Compilation Time (ms)
engine = hnp.compile_numpy_function(

View File

@@ -12,7 +12,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,))
inputset = [(np.random.randint(0, 2 ** 3, size=(3,)),) for _ in range(32)]
inputset = [np.random.randint(0, 2 ** 3, size=(3,)) for _ in range(32)]
# bench: Measure: Compilation Time (ms)
engine = hnp.compile_numpy_function(

View File

@@ -12,7 +12,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(10, 6))
inputset = [(np.random.randint(0, 2 ** 3, size=(10, 6)),) for _ in range(128)]
inputset = [np.random.randint(0, 2 ** 3, size=(10, 6)) for _ in range(128)]
inputs = []
labels = []

View File

@@ -12,7 +12,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,))
inputset = [(np.random.randint(0, 2 ** 3, size=(3,)),) for _ in range(32)]
inputset = [np.random.randint(0, 2 ** 3, size=(3,)) for _ in range(32)]
# bench: Measure: Compilation Time (ms)
engine = hnp.compile_numpy_function(

View File

@@ -12,7 +12,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(2, 3))
inputset = [(np.random.randint(0, 2 ** 3, size=(2, 3)),) for _ in range(32)]
inputset = [np.random.randint(0, 2 ** 3, size=(2, 3)) for _ in range(32)]
# bench: Measure: Compilation Time (ms)
engine = hnp.compile_numpy_function(

View File

@@ -12,7 +12,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,))
inputset = [(np.random.randint(0, 2 ** 3, size=(3,)),) for _ in range(32)]
inputset = [np.random.randint(0, 2 ** 3, size=(3,)) for _ in range(32)]
# bench: Measure: Compilation Time (ms)
engine = hnp.compile_numpy_function(

View File

@@ -12,7 +12,7 @@ def main():
x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(2, 4))
inputset = [(np.random.randint(0, 2 ** 3, size=(2, 4)),) for _ in range(128)]
inputset = [np.random.randint(0, 2 ** 3, size=(2, 4)) for _ in range(128)]
inputs = []
labels = []