Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The save of the TenSEALContext object is interrupted. #206

Closed
Coldfire93 opened this issue Dec 30, 2020 · 4 comments
Closed

The save of the TenSEALContext object is interrupted. #206

Coldfire93 opened this issue Dec 30, 2020 · 4 comments
Labels
Type: Question ❔ Question about implementation or some technical aspect

Comments

@Coldfire93
Copy link

The following code I used before works ok :
`
import tenseal as ts
import copy
import os

ctx = ts.context(ts.SCHEME_TYPE.CKKS, 8192, 0, [60, 40, 40, 60])
ctx.global_scale = pow(2, 40)
ctx.generate_galois_keys()
ctx_copy = copy.deepcopy(ctx)
ctx_copy.make_context_public()

path = "/tmp/vlr"
with open(os.path.join(path, "ctx_whole"), "wb") as f:
f.write(ctx.serialize())
print("save whole context done.")
with open(os.path.join(path, "ctx_public"), "wb") as f:
f.write(ctx_copy.serialize())
print("save public context done.")
`

But when I changed the code in the fifth line to :
ctx = ts.context(ts.SCHEME_TYPE.CKKS, 16384, 0, [60, 40, 40, 40, 60])
The serialization of ctx_copy object can not be saved.
The error is:
Process finished with exit code 137 (interrupted by signal 9: SIGKILL)

I'm confused. I searched that the error is usually caused by the insufficient of memory.
I expanded the virtual machine's memory but it doesn't work. I wonder why the serialization of ctx object can be saved but the ctx_copy object goes wrong.
I would be appreciate if you could tell me the reason. Thank you!

@Coldfire93 Coldfire93 added the Type: Question ❔ Question about implementation or some technical aspect label Dec 30, 2020
@Coldfire93
Copy link
Author

I run the code on my Mac. The code runs correctly. But the memory consumption is almost 100%.
And the file size of ctx object is 1.6 M, but the file size of ctx_copy object is 116.8 M.
Why?

@bcebere
Copy link
Member

bcebere commented Dec 30, 2020

Hello,

Are you using TenSeal 0.3.0a1?

Most likely it is related to microsoft/SEAL#249

There was an issue with SEAL 3.6, and it was fixed in 3.6.1, and we integrated it in TenSEAL 0.3.0a1.

@bcebere
Copy link
Member

bcebere commented Jan 18, 2021

Hello. Are you still experiencing this issue?

@Coldfire93
Copy link
Author

Hello. Are you still experiencing this issue?

Sorry, I miss your reply. it has been solved. Thanks a lot.

@bcebere bcebere closed this as completed Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Question ❔ Question about implementation or some technical aspect
Projects
None yet
Development

No branches or pull requests

2 participants