Skip to main content

Compilation errors

When you deploy, the platform compiles your pipeline into an FHE circuit. If it cannot, you get an error and the deployment stops. This page lists what each one means and how to fix it.

How errors surface

Compilation runs inside the deploy step. A failure raises an error in your deploy call and the model does not become active. Fix the cause, then deploy again.

Common errors

Message
Model name '<name>' already exists in this account (modelId <model id>). Pick a different name, or delete/rename the existing model
Cause

You tried to create a model with a name that is already taken in your account. The modelId in the message is the existing model with that name.

Fix

To create a new model, pick a different name. To replace the existing one, call deploy_pipeline with the same model_name; it reuses that model instead of failing. If you called create_model directly, delete or rename the existing model first.

See deploy_pipeline (model names must be unique in your account).
Message
Compilation failed: The model's homomorphic parameters are invalid. Please re-deploy the model.
Cause

The encryption parameters sent alongside the model could not be read. Happens when the parameters and the pipeline come from different builds.

Fix

Re-deploy, passing the parameters the pipeline was built with.

See Choosing parameters for how parameters and pipeline builds relate.
Message
Compilation failed: Model file not found. Please ensure the upload completed and re-deploy.
Cause

Compilation started, but the pipeline file is not in storage. Happens when the upload did not finish.

Fix

Re-deploy.

Message
Compilation failed: The model file is corrupt or not a valid Lattica pipeline. Please re-export and re-upload it. (File is not a zip file)
Cause

The uploaded file is not a readable Lattica pipeline archive. Happens when the upload was truncated, or when a file that isn't a serialized pipeline was passed to deploy.

Fix

Re-export the pipeline and deploy again.

Message
Compilation failed: Compilation failed while initializing cryptographic context incompatible homomorphic parameters.
Cause

The parameters were readable but cannot produce a working encryption context, for example a ring size or modulus chain the scheme does not support.

Fix

Adjust the homomorphic parameters and re-deploy.

Message
Compilation failed: Compilation failed during preprocessing (building the homomorphic pipeline from your model graph). The graph may use an unsupported op, dtype, or shape.
Cause

Your model graph could not be turned into a homomorphic pipeline. The usual cause is an operator, dtype, or tensor shape the compiler does not support. The text in parentheses names what failed.

See the HomOps reference for supported operators.
Message
Compilation failed: Compilation failed during key generation and key/pipeline upload. This usually indicates incompatible homomorphic parameters.
Cause

The pipeline built, but keys for it could not be generated or loaded onto the GPU. Usually means the homomorphic parameters don't fit the pipeline.

Message
Compilation failed: The verification input/output embedded in your model file is malformed. Please re-export and re-upload the model.
Cause

The verification tensors attached to the pipeline could not be read.

Fix

Re-export the pipeline with valid verification_data.

Message
Compilation failed: Verification data shape doesn't match declared input shape.Expected (5000,), got torch.Size([10000]).
Cause

The verification input you attached to the pipeline has a different shape than the input the pipeline declares. Happens when the sample input and the pipeline were built against different feature dimensions.

Fix

Align the two and redeploy.

Message
Compilation failed: Compilation failed during the trial encrypted inference run.
Cause

The pipeline compiled, but the compiler's own encrypted test run of it failed. Often a chain that runs out of levels, or a shape that only stops lining up under encryption.

Fix

Trace the pipeline locally to find the operator where it breaks.

See Level budget if the chain is running out of levels.
Message
Compilation failed: Model accuracy verification failed: the compiled pipeline's output did not match the expected output within the configured accuracy tolerance (0.0009765625).
Cause

The pipeline compiled, but its encrypted result drifted further from your expected output than your tolerance allows. Happens when the expected output is wrong, when the pipeline loses more precision than budgeted, or when the tolerance is tighter than the workload can hold. The tolerance in the message is the one you set in <code>verification_data["accuracy"]</code>.

Message
Compilation failed: Dry-run result doesn't match expected output.
Cause

The accuracy check could not complete: the decrypted result could not be compared to your expected output at all. Usually the expected output has a different shape or dtype than the pipeline produces.

Message
Compilation failed: Model compilation failed. Please verify your model file is correct.
Cause

The fallback when compilation fails for a reason the compiler cannot attribute to a stage. The details are in our logs rather than the message.

Fix

Contact support with your model id.

After a failed compilation

The model is left INACTIVE and cannot serve queries. Until you upload a pipeline that compiles:
  • studio.models.get returns is_compiled: false and carries the message above in compilation_error.
  • studio.workers.start returns 403: Model <model_id> is INACTIVE.
  • Any query on a token bound to that model returns 403: Model <model_id> is INACTIVE.

Next

Back to

Deploy the Pipeline

Where compilation runs, and where these errors appear.