fhelium.benchmarks.standalone.ntt_kernel
NTT kernel measurement helpers with representation-state validation.
NTT_OPERATIONS
constant View source
python
NTT_OPERATIONS = ('forward_ntt', 'inverse_ntt', 'roundtrip')1
make_residue_rows
function View source
python
def make_residue_rows(engine: CkksEngine, *, seed: int) -> torch.Tensor: ...1
Create deterministic standard-residue QP rows for one engine.
run_ntt_operation
function View source
python
def run_ntt_operation(engine: CkksEngine, data: torch.Tensor, operation: str) -> None: ...1
Run one in-place semantic NTT operation on a prepared operand.
prepare_ntt_operation_inputs
function View source
python
def prepare_ntt_operation_inputs(engine: CkksEngine, standard_rows: torch.Tensor) -> dict[str, torch.Tensor]: ...1
Build valid representation-specific inputs outside timed regions.
measure_ntt_operation
function View source
python
def measure_ntt_operation(engine: CkksEngine, base_data: torch.Tensor, operation: str, *, warmup: int, runs: int) -> dict[str, float]: ...1
Measure only an NTT operation, excluding restoration of its input.
assert_ntt_roundtrip
function View source
python
def assert_ntt_roundtrip(engine: CkksEngine, base_data: torch.Tensor) -> None: ...1
Require exact equality modulo each active QP prime after a roundtrip.