mirror of
https://github.com/luxfhe/torus.git
synced 2026-10-30 17:07:26 +00:00
The MLIR dialect, its conversion passes (TFHEToConcrete, ConcreteToCAPI, ConcreteToLLVM), the optimizer component, the compiler binary, the Rust crate and the program_info parameter file all still carried the upstream project's name. They now carry this one's. Two things deliberately keep the word, because in them it is not the name. mlir::OpTrait CRTP parameters mean "the derived type", so they are spelled Derived and OpTy — LLVM's other conventional spelling for the same idiom. concreteShape is a capnp field: renaming it would change the serialized protocol, and the prose describing it is ordinary English. This also repairs references the earlier partial rename left dangling: Security.cpp included concrete/curves.gen.h and the directory is torus/, torus-cpu.h included concrete-num_complex.h, the Torus dialect CMakeLists named ConcreteOps.td, and compiler/setup.py asked find_namespace_packages for a "concrete" package that no longer exists — so it built without the package it ships.
2.5 KiB
2.5 KiB
Project layout
Torus layout
Torus is a modular framework composed by sub-projects using different technologies, all having theirs own build system and test suite. Each sub-project have is own README that explain how to setup the developer environment, how to build it and how to run tests commands.
Torus is made of 4 main categories of sub-project that are organized in subdirectories from the root of the Torus repo:
frontendscontains high-level transpilers that target end users developers who want to use the Torus stack easily from their usual environment. There are for now only one frontend provided by the Torus project: a Python frontend namedtorus-python.compilerscontains the sub-projects in charge of actually solving the compilation problem of an high-level abstraction of FHE to an actual executable.torus-optimizeris a Rust based project that solves the optimization problems of an FHE dag to a TFHE dag andtorus-compilerwhich usetorus-optimizeris an end-to-end MLIR-based compiler that takes a crypto free FHE dialect and generates compilation artifacts both for the client and the server.torus-compilerproject provide in addition of the compilation engine, a client and server library in order to easily play with the compilation artifacts to implement a client and server protocol.backendscontains CAPI that can be called by thetorus-compilerruntime to perform the cryptographic operations. There are currently two backends:torus-cpu, using Lux-FHE that implement the fastest implementation of TFHE on CPU.torus-cudathat provides a GPU acceleration of TFHE primitives.
toolsare basically every other sub-projects that cannot be classified in the three previous categories and which are used as a common support by the others.
Torus Python layout
The module structure of Torus Python. You are encouraged to check individual .py files to learn more.
- torus
- fhe
- dtypes: data type specifications (e.g., int4, uint5, float32)
- values: value specifications (i.e., data type + shape + encryption status)
- representation: representation of computation (e.g., computation graphs, nodes)
- tracing: tracing of python functions
- extensions: custom functionality (see Extensions)
- mlir: computation graph to mlir conversion
- compilation: configuration, compiler, artifacts, circuit, client/server, and anything else related to compilation
- fhe