Developer Guide
The Developer Guide explains how FHElium is implemented: Python CKKS orchestration, PyTorch operator dispatch, CPU and CUDA arithmetic, distributed transport, reusable execution, persistent artifacts, live Residency, JIT lowering, source ownership, and contributor validation.
Implementation map
Contributor workflows
Cross-layer rule
A native operation is implemented as one cross-layer path:
Changes to shape, mutation, row mapping, polynomial domain, modulus basis, or residue range must be represented consistently at every layer.
Start from an execution path
Before changing an implementation, trace one concrete path from its public entry point to the storage or native operation that performs the work. Record:
- public method and typed input state;
- Python orchestration and parameter/table selection;
torch.opsschema and CPU/CUDA registrations when native;- tensor axes, mutation, allocation, thread, and stream behavior;
- source commit and loaded native ABI manifest;
- smallest correctness oracle and focused tests.
For numerical work, retain the exact preset, level, scale, NTT backend, and first failing stage. Synchronize only around the suspected CUDA stage when locating asynchronous failures.