Transpile
Currently, any related EZKL capabilities are disabled
Transpilation is a crucial process in the deployment of Verifiable Machine Learning models and its powered by is powered by ezkl. It involves the usage of an ONNX model and input data to perform the setup
. With this setup
we can generate proofs that can be verified, ensuring the integrity and reliability of the model's predictions.
The transpilation process begins by reading the model and input data from the specified path. The model and data are then sent for transpilation. By default, the output of this process is managed by Giza for later use.
The result of the transpilation process is the following:
Circuit settings
Proving key
Verification key
How do we transpile a model
There are three main methods for transpiling a model:
Method 1: Using the giza transpile --framework EZKL
command
giza transpile --framework EZKL
commandThis is the simplest method and is recommended for most users.
When you run this command, Giza handles everything for you.
It first checks if a model with the specified name already exists. If not, it creates a new model and then transpiles it.
The output of this process is managed by Giza.
This is the strategy that we followed in the example before.
Method 2: Manually creating a model and then transpiling it
This method gives you more control over the process.
First, you create a model manually using the
giza models create
command.After the model is created, you can transpile it using the
giza transpile --framework EZKL --model-id ...
orgiza versions transpile --framework EZKL --model-id
command.This method is useful when you want to specify particular options or parameters during the model creation and transpilation process.
Method 3: Using a previous model
If you have a previously created model, you can transpile it by indicating the model-id in the
giza transpile --framework EZKL --model-id ...
orgiza versions transpile --framework EZKL --model-id
command.This method is useful when you want to create a new version of an existing model.
The output of the transpilation process is saved in the same location as the original model.
What is happening with the models and versions
In Giza, a model is essentially a container for versions. Each version represents a transpilation of a machine learning model at a specific point in time. This allows you to keep track of different versions of your model as it evolves and improves over time.
To check the current models and versions that have been created, you can use the following steps:
Use the
giza models list
command to list all the models that have been created.For each model, you can use the
giza versions list --model-id ...
command to list all the versions of that model.
Remember, each version represents a specific transpilation of the model. So, if you have made changes to your machine learning model and transpiled it again, it will create a new version.
This system of models and versions allows you to manage and keep track of the evolution of your machine learning models over time.
For example, let's say you have created a model called awesome_model
and transpiled it twice. This will create two versions of the model, version 1 and version 2. You can check the status of these versions using the giza versions list --model-id ...
command.
Last updated