Skip to main content

Orion FHE compiler — traces, fits, and compiles PyTorch neural networks for encrypted inference

Project description

orion-v2-compiler

Orion FHE compiler — traces, fits, and compiles PyTorch neural networks for encrypted inference using the CKKS scheme.

Part of the Orion FHE framework.

Usage

import orion_compiler.nn as on
from orion_compiler import Compiler, CKKSParams

class MLP(on.Module):
    def __init__(self):
        super().__init__()
        self.flatten = on.Flatten()
        self.fc1 = on.Linear(784, 128)
        self.act1 = on.Quad()
        self.fc2 = on.Linear(128, 10)

    def forward(self, x):
        x = self.flatten(x)
        x = self.act1(self.fc1(x))
        return self.fc2(x)

net = MLP()
compiler = Compiler(net, CKKSParams(logn=14, logq=[55, 40, 40, 40], logp=[61, 61], log_default_scale=40))
compiler.fit(dataloader)
compiled = compiler.compile()
model_bytes = compiled.to_bytes()

Modules

  • orion_compilerCompiler, CKKSParams, CompiledModel, Graph, GraphNode, GraphEdge, KeyManifest, CompilerConfig, CostProfile
  • orion_compiler.nn — FHE-compatible layers (cleartext-only forward)
  • orion_compiler.core — Compilation algorithms (tracer, packing, level assignment, auto-bootstrap, galois)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orion_v2_compiler-2.1.0.tar.gz (44.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

orion_v2_compiler-2.1.0-py3-none-any.whl (54.0 kB view details)

Uploaded Python 3

File details

Details for the file orion_v2_compiler-2.1.0.tar.gz.

File metadata

  • Download URL: orion_v2_compiler-2.1.0.tar.gz
  • Upload date:
  • Size: 44.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for orion_v2_compiler-2.1.0.tar.gz
Algorithm Hash digest
SHA256 0da7de52ed8e3f3719529e6be5c8c2180f0daf54ac550c66531a6c360aed53be
MD5 b504412d7a7854e3d9b61b5649dfe039
BLAKE2b-256 75e813ca6c3c24e52b2e782ec44a35d0abd9ff30b69ee9cf3915d84b8800ad0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for orion_v2_compiler-2.1.0.tar.gz:

Publisher: release.yml on butvinm/orion

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file orion_v2_compiler-2.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for orion_v2_compiler-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f42f123486fe772afc1fc3e2004cc7e7eb36a222c9df0684cb6b43cc25503fa1
MD5 4d7193df352477eef59db54f8d268d02
BLAKE2b-256 86650194aed12cd0cd791e263fc7093e26b9f1e6400ba556682dd59b85f438a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for orion_v2_compiler-2.1.0-py3-none-any.whl:

Publisher: release.yml on butvinm/orion

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page