Skip to content

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

Description

@malickKhurram

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.

Activity

  1. andrei-stoian-zama commented on Apr 29, 2024

    @andrei-stoian-zama
    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.

  2. malickKhurram commented on Apr 29, 2024

    @malickKhurram
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions