mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-15 07:05:09 -05:00
add test code for memory usage
This commit is contained in:
17
memory_tests/test.py
Normal file
17
memory_tests/test.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from estimator_new import *
|
||||
from sage.all import oo, save
|
||||
|
||||
def test():
|
||||
|
||||
# code
|
||||
D = ND.DiscreteGaussian
|
||||
params = LWE.Parameters(n=1024, q=2 ** 64, Xs=D(0.50, -0.50), Xe=D(2**57), m=oo, tag='TFHE_DEFAULT')
|
||||
|
||||
names = [params, params.updated(n=761), params.updated(q=2 ** 65), params.updated(n=762)]
|
||||
|
||||
for name in names:
|
||||
x = LWE.estimate(name, deny_list=("arora-gb", "bkw"))
|
||||
|
||||
return 0
|
||||
|
||||
test()
|
||||
31
memory_tests/test2.py
Normal file
31
memory_tests/test2.py
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
from multiprocessing import *
|
||||
from estimator_new import *
|
||||
from sage.all import oo, save
|
||||
|
||||
|
||||
def test_memory(x):
|
||||
print("doing job...")
|
||||
print(x)
|
||||
y = LWE.estimate(x, deny_list=("arora-gb", "bkw"))
|
||||
return y
|
||||
|
||||
if __name__ == "__main__":
|
||||
D = ND.DiscreteGaussian
|
||||
params = LWE.Parameters(n=1024, q=2 ** 64, Xs=D(0.50, -0.50), Xe=D(2**57), m=oo, tag='TFHE_DEFAULT')
|
||||
|
||||
names = [params, params.updated(n=761), params.updated(q=2**65), params.updated(n=762)]
|
||||
procs = []
|
||||
proc = Process(target=print_func)
|
||||
procs.append(proc)
|
||||
proc.start()
|
||||
p = Pool(1)
|
||||
|
||||
for name in names:
|
||||
proc = Process(target=test_memory, args=(name,))
|
||||
procs.append(proc)
|
||||
proc.start()
|
||||
proc.join()
|
||||
|
||||
for proc in procs:
|
||||
proc.join()
|
||||
Reference in New Issue
Block a user