Forked from upstream concrete (BSD-3-Clause-Clear, © 2024 ZAMA) at HEAD
ecb729bb. Modifications copyright © 2026 Lux Industries Inc.
Rebranding scope:
- Python module concrete → torus (across frontends/torus-python)
- Rust module concrete-* → torus-* (across frontends/torus-rust)
- MLIR dialect concretelang → toruslang (across compilers/torus-compiler)
- Compiler optimizer concrete-optimizer → torus-optimizer
- Backend concrete-cpu / concrete-cuda → torus-cpu / torus-cuda
- Wire protocol concrete-protocol → torus-protocol
- Parameter-curves concrete-security-curves-* → torus-security-curves-*
- Public symbols concretelib → toruslib, ConcreteLang → TorusLang
- URLs github.com/zama-ai/concrete → github.com/luxfhe/torus
- URLs docs.zama.ai/concrete → docs.luxfhe.com/torus
Legal compliance:
- LICENSE.txt retains original Copyright © 2024 ZAMA verbatim (§1-§2)
- LICENSE.txt adds modifications copyright © 2026 Lux Industries Inc.
- §3 endorsement clause: Torus is marketed exclusively as a Lux product;
no Zama name used in README, docs, or marketing
- NOTICE file provides factual attribution per legal best practice
(not endorsement; required by upstream BSD-3-Clause-Clear)
README + NOTICE rewritten from scratch with Lux brand:
- Quick-start in Python (torus.fhe)
- Architecture diagram showing the gen-1 vtbl integration path
(luxcpp/gpu → lux-private/gpu-kernels for CUDA/Metal/WebGPU)
- Scheme coverage table: TFHE (luxfi/fhe), CKKS/BGV/BFV (luxfi/lattice)
- Lux FHE family table: Torus / TorusVM / TorusEVM / TorusML / TorusNet
Known limitations (phase-2A scope):
- PyPI package torus-fhe not yet published; the torus Python module
is renamed structurally but pip-installable distribution is a
follow-up (Phase 2A.1)
- MLIR dialect rename is text-level; the compiler-internal LLVM
rebuild (concrete-compiler-internal-llvm-project submodule) is
structural and works; tablegen files renamed concrete→torus but the
generated .inc files in the source tree will regenerate at build
time
- backends/torus-cuda/implementation/ is an upstream submodule
pointer to the tfhe-rs source (not fetched in the staging clone);
the CUDA backend body is delivered out-of-tree
- ~100 test-fixture variable names like concrete_encoded_sample
retain "concrete" as a math term (vs symbolic); these are inside
tests/, not the public API; cleanup is a follow-up commit
- 295 Python `from concrete import ...` residuals in luxfhe/ml-sdk
consumer remain; that repo's import update is Phase 2B
This commit is the seed for the luxfhe/torus repo. Push as the first
commit to a fresh GitHub repo; do not re-import upstream Zama git
history.
3.5 KiB
Progressbar
This document introduces the progressbar feature that provides visual feedback on the execution progress of large circuits, which can take considerable time to execute.
The following Python code demonstrates how to enable and use the progressbar:
import time
import matplotlib.pyplot as plt
import numpy as np
import randimage
from torus import fhe
configuration = fhe.Configuration(
enable_unsafe_features=True,
use_insecure_key_cache=True,
insecure_key_cache_location=".keys",
# To enable displaying progressbar
show_progress=True,
# To enable showing tags in the progressbar (does not work in notebooks)
progress_tag=True,
# To give a title to the progressbar
progress_title="Evaluation:",
)
@fhe.compiler({"image": "encrypted"})
def to_grayscale(image):
with fhe.tag("scaling.r"):
r = image[:, :, 0]
r = (r * 0.30).astype(np.int64)
with fhe.tag("scaling.g"):
g = image[:, :, 1]
g = (g * 0.59).astype(np.int64)
with fhe.tag("scaling.b"):
b = image[:, :, 2]
b = (b * 0.11).astype(np.int64)
with fhe.tag("combining.rgb"):
gray = r + g + b
with fhe.tag("creating.result"):
gray = np.expand_dims(gray, axis=2)
result = np.concatenate((gray, gray, gray), axis=2)
return result
image_size = (16, 16)
image_data = (randimage.get_random_image(image_size) * 255).round().astype(np.int64)
print()
print(f"Compilation started @ {time.strftime('%H:%M:%S', time.localtime())}")
start = time.time()
inputset = [np.random.randint(0, 256, size=image_data.shape) for _ in range(100)]
circuit = to_grayscale.compile(inputset, configuration)
end = time.time()
print(f"(took {end - start:.3f} seconds)")
print()
print(f"Key generation started @ {time.strftime('%H:%M:%S', time.localtime())}")
start = time.time()
circuit.keygen()
end = time.time()
print(f"(took {end - start:.3f} seconds)")
print()
print(f"Evaluation started @ {time.strftime('%H:%M:%S', time.localtime())}")
start = time.time()
grayscale_image_data = circuit.encrypt_run_decrypt(image_data)
end = time.time()
print(f"(took {end - start:.3f} seconds)")
fig, axs = plt.subplots(1, 2)
axs = axs.flatten()
axs[0].set_title("Original")
axs[0].imshow(image_data)
axs[0].axis("off")
axs[1].set_title("Grayscale")
axs[1].imshow(grayscale_image_data)
axs[1].axis("off")
plt.show()
When you run this code, you will see a progressbar like this one:
Evaluation: 10% |█████.............................................| 10% (scaling.r)
^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^
Title Progressbar Tag
As the execution proceeds, the progress bar updates:
Evaluation: 30% |███████████████...................................| 30% (scaling.g)
Evaluation: 50% |█████████████████████████.........................| 50% (scaling.b)
{% hint style="info" %} The progress bar does not measure time. When it shows 50%, it indicates that half of the nodes in the computation graph have been processed, not that half of the time has elapsed. The duration of processing different node types may vary, so the progress bar should not be used to estimate the remaining time. {% endhint %}
Once the progressbar fills and execution completes, you will see the following figure:
