mirror of
https://github.com/luxfi/torus-ml.git
synced 2026-10-30 15:15:23 +00:00
The distribution called itself torus-ml while shipping a package directory named concrete, so the name a user installs and the name they import disagreed — and most of the tree already said torus.ml, which could not resolve against src/concrete. Moved src/concrete to src/torus and pointed the include at it. The dependency was Zama's concrete-python from their index. It is torus-fhe from ours, which is what luxfhe/torus already ships: that frontend declares torus-fhe and ships a torus/fhe module, so every 'from torus.fhe' in this tree was already naming our compiler and only the dependency lagged. Two distributions share one namespace, which is the shape the upstream this forked from used and the reason the split works: torus-fhe gives torus.fhe, torus-ml gives torus.ml. Swept every other spelling — identifiers, enum members, workflow variables, filenames, notebooks. LICENSE and NOTICE keep the upstream attribution a fork owes; the figures carry the old name in JPEG metadata a text sweep cannot reach.
1.7 KiB
1.7 KiB
Deployment
In this folder we show how to deploy a Torus ML model that classifies images from CIFAR-10, either through Docker or Amazon Web Services. We use the model showcased in CIFAR QAT training from scratch.
Get started
To run this example on AWS you will also need to have the AWS CLI properly setup on your system. To do so please refer to AWS documentation. One can also run this example locally using Docker, or just by running the scripts locally.
Deployment this model on your personal machine is not recommended as running a VGG in FHE is computationally intensive. It is recommended to run this on a m6i.metal instance from AWS.
- To compile your model you can use
compile.py, orcompile_with_docker.pyto use Docker. This will compile the model to an FHE circuit and serialize it. This will result in a new folder called./dev. - Once that's done you can use the script provided in Torus ML in
use_case_examples/deployment/server/, usedeploy_to_docker.py.
python use_case_examples/deployment/server/deploy_to_docker.py
- Once that's done you can launch the
build_docker_client_image.pyscript to build a client Docker image. - You can then run the client by using the
client.shscript. This will run the container in interactive mode. To interact with the server you can launch theclient.pyscript usingURL="<my_url>" python client.pywhere<my_url>is the content of theurl.txtfile.
And here it is you deployed a deep-learning model and ran an inference using Fully Homormophic Encryption.