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

[Question] FHE inference over a single image time #658

Open
malickKhurram opened this issue Apr 29, 2024 · 2 comments
Open

[Question] FHE inference over a single image time #658

malickKhurram opened this issue Apr 29, 2024 · 2 comments

Comments

@malickKhurram
Copy link

Hi, I found this community very helpful. I have a question related to inference time.
I am running following use case example.
https://github.com/zama-ai/concrete-ml/blob/main/use_case_examples/cifar/cifar_brevitas_training/evaluate_one_example_fhe.py

The issue is that FHE inference over a single image took more than 28 min.
Is there a way to optimize it or reduce the inference time.

@andrei-stoian-zama
Copy link
Collaborator

Hi,

One possible way to reduce latency is to use a bigger machine, since Concrete makes very good use of parallelism: we obtain around 40 seconds inference time on that model using the hpc7a instances on AWS.

A second possible approach is, depending on the use-case, to optimize your model by making it smaller or pruning it. You might want to look into structured pruning. See this section of the documentation about such techniques - some are already used in the CIFAR example that you link.

@malickKhurram
Copy link
Author

Hi andrei, thanks for your quick reply. I am using a high end workstation with 64 GB RAM and 24 core processor.
I will take a look at the pruning.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants