fhelium/ntt.h
#include <fhelium/ntt.h> · namespace fhelium::ntt
Forward and inverse negacyclic number-theoretic transforms on RNS residue Tensors.
A residue operand has shape [*batch, limb, N], where limb rns_params (fhelium/rns_parameters.h). Row
and the inverse transform computes its inverse including the factor *batch as one axis; they neither broadcast nor copy.
Three table layouts select the implementation:
- Indexed: int32
even_indicesandodd_indicesof shape[stage, N/2]that pair coefficients in each radix-2 stage, with twiddles of shape[limb, stage, N/2]. A schedule must be accepted byvalidate_indexed_schedulebefore use and must not change while execution that uses it is prepared. - Compact: radix-2 twiddles of shape
[limb, N]in bit-reversed stage order. For the transform makes two passes over the operand: one pass applies stages to coefficients spaced apart, and the other applies the remaining stages to contiguous tiles. CUDA int32 kernels also accept[limb, N, 2]Shoup pairs. - Power-of-two radix:
outer_twiddlesof shape[limb, N-1]andradix_root_powersof shape[limb, radix]for radix 4, 8, or 16; is a multiple of radix.
Forward montgomery functions consume coefficient-domain Montgomery residues, and forward to_montgomery functions consume coefficient-domain standard residues; both produce NTT-domain Montgomery residues in the lazy range montgomery keeps Montgomery form in to_standard_lazy gives standard residues in to_standard gives standard residues in to_centered gives standard residues in the centered range. A trailing underscore marks a function that transforms its first argument in place; the other functions allocate their result.
| Function | Devices | Summary |
|---|---|---|
forward_ntt_montgomery_indexed_ | CPU, CUDA, HIP | Forward NTT of coefficient-domain Montgomery residues with an indexed schedule, in place. |
forward_ntt_to_montgomery_indexed_ | CPU, CUDA, HIP | Forward NTT of coefficient-domain standard residues with an indexed schedule, in place. |
forward_ntt_to_montgomery_indexed | Any device | Forward NTT of coefficient-domain standard residues with an indexed schedule; returns a new Tensor. |
forward_ntt_to_montgomery_indexed_out | CPU, CUDA, HIP | Out form of forward_ntt_to_montgomery_indexed: writes the transform of standard_residues to out, a Tensor of the same shape, dtype and device. |
forward_ntt_montgomery_compact_ | CUDA, HIP | Forward NTT of coefficient-domain Montgomery residues with compact twiddles, in place. |
forward_ntt_to_montgomery_compact_ | CUDA, HIP | Forward NTT of coefficient-domain standard residues with compact twiddles, in place. |
forward_ntt_to_montgomery_compact | Any device | Forward NTT of coefficient-domain standard residues with compact twiddles; returns a new Tensor. |
forward_ntt_to_montgomery_compact_out | CUDA, HIP | Out form of forward_ntt_to_montgomery_compact: writes the transform of standard_residues to out, a Tensor of the same shape, dtype and device. |
forward_ntt_to_montgomery_compact_add_scaled_ | CUDA, HIP | Transforms a correction to the NTT domain and adds a scaled NTT addend in the same pass. |
forward_ntt_montgomery_compact_keyswitch_accumulate_ | CUDA, HIP | Transforms one coefficient-domain key-switching digit and accumulates its key products. |
forward_ntt_montgomery_power_of_two_radix_compact_ | CUDA, HIP | Forward NTT of coefficient-domain Montgomery residues with power-of-two radix stages, in place. |
forward_ntt_to_montgomery_power_of_two_radix_compact_ | CUDA, HIP | Forward NTT of coefficient-domain standard residues with power-of-two radix stages, in place. |
forward_ntt_to_montgomery_power_of_two_radix_compact | Any device | Forward NTT of coefficient-domain standard residues with power-of-two radix stages; returns a new Tensor. |
forward_ntt_to_montgomery_power_of_two_radix_compact_out | CUDA, HIP | Out form of forward_ntt_to_montgomery_power_of_two_radix_compact: writes the transform of standard_residues to out, a Tensor of the same shape, dtype and device. |
inverse_ntt_montgomery_indexed_ | CPU, CUDA, HIP | Inverse NTT with an indexed schedule, in place, producing coefficient-domain Montgomery residues in |
inverse_ntt_to_standard_lazy_indexed_ | CPU, CUDA, HIP | Inverse NTT with an indexed schedule, in place, producing coefficient-domain standard residues in |
inverse_ntt_to_standard_indexed_ | CPU, CUDA, HIP | Inverse NTT with an indexed schedule, in place, producing coefficient-domain standard residues in |
inverse_ntt_to_centered_indexed_ | CPU, CUDA, HIP | Inverse NTT with an indexed schedule, in place, producing coefficient-domain standard residues in the centered range. |
inverse_ntt_montgomery_compact_ | CUDA, HIP | Inverse NTT with compact twiddles, in place, producing coefficient-domain Montgomery residues in |
inverse_ntt_to_standard_lazy_compact_ | CUDA, HIP | Inverse NTT with compact twiddles, in place, producing coefficient-domain standard residues in |
inverse_ntt_to_standard_compact_ | CUDA, HIP | Inverse NTT with compact twiddles, in place, producing coefficient-domain standard residues in |
inverse_ntt_to_centered_compact_ | CUDA, HIP | Inverse NTT with compact twiddles, in place, producing coefficient-domain standard residues in the centered range. |
inverse_ntt_montgomery_power_of_two_radix_compact_ | CUDA, HIP | Inverse NTT with power-of-two radix stages, in place, producing coefficient-domain Montgomery residues in |
inverse_ntt_to_standard_lazy_power_of_two_radix_compact_ | CUDA, HIP | Inverse NTT with power-of-two radix stages, in place, producing coefficient-domain standard residues in |
inverse_ntt_to_standard_power_of_two_radix_compact_ | CUDA, HIP | Inverse NTT with power-of-two radix stages, in place, producing coefficient-domain standard residues in |
inverse_ntt_to_centered_power_of_two_radix_compact_ | CUDA, HIP | Inverse NTT with power-of-two radix stages, in place, producing coefficient-domain standard residues in the centered range. |
validate_indexed_schedule | Any device | Checks that an indexed NTT schedule is a valid radix-2 pairing for ring dimension ring_dimension. |
fixed_radix_ntt_stage_range_ | CUDA, HIP | Executes a half-open interval of unnormalized power-of-two radix stages in place. |
forward_ntt_montgomery_indexed_
function View source
void fhelium::ntt::forward_ntt_montgomery_indexed_(
at::Tensor& montgomery_residues,
const at::Tensor& even_indices,
const at::Tensor& odd_indices,
const at::Tensor& forward_twiddles,
const at::Tensor& rns_params);2
3
4
5
6
Devices: CPU, CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.forward_ntt_montgomery_indexed_
fhelium_ntt_ops::forward_ntt_montgomery_indexed_(Tensor(a!) montgomery_residues, Tensor even_indices, Tensor odd_indices, Tensor forward_twiddles, Tensor rns_params) -> ()Forward NTT of coefficient-domain Montgomery residues with an indexed schedule, in place.
forward_ntt_to_montgomery_indexed_
function View source
void fhelium::ntt::forward_ntt_to_montgomery_indexed_(
at::Tensor& standard_residues,
const at::Tensor& even_indices,
const at::Tensor& odd_indices,
const at::Tensor& forward_twiddles,
const at::Tensor& rns_params);2
3
4
5
6
Devices: CPU, CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.forward_ntt_to_montgomery_indexed_
fhelium_ntt_ops::forward_ntt_to_montgomery_indexed_(Tensor(a!) standard_residues, Tensor even_indices, Tensor odd_indices, Tensor forward_twiddles, Tensor rns_params) -> ()Forward NTT of coefficient-domain standard residues with an indexed schedule, in place.
forward_ntt_to_montgomery_indexed
function View source
at::Tensor fhelium::ntt::forward_ntt_to_montgomery_indexed(
const at::Tensor& standard_residues,
const at::Tensor& even_indices,
const at::Tensor& odd_indices,
const at::Tensor& forward_twiddles,
const at::Tensor& rns_params);2
3
4
5
6
Devices: Any device
Torch operator: torch.ops.fhelium_ntt_ops.forward_ntt_to_montgomery_indexed
fhelium_ntt_ops::forward_ntt_to_montgomery_indexed(Tensor standard_residues, Tensor even_indices, Tensor odd_indices, Tensor forward_twiddles, Tensor rns_params) -> TensorForward NTT of coefficient-domain standard residues with an indexed schedule; returns a new Tensor.
forward_ntt_to_montgomery_indexed_out
function View source
void fhelium::ntt::forward_ntt_to_montgomery_indexed_out(
const at::Tensor& standard_residues,
const at::Tensor& even_indices,
const at::Tensor& odd_indices,
const at::Tensor& forward_twiddles,
const at::Tensor& rns_params,
at::Tensor& out);2
3
4
5
6
7
Devices: CPU, CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.forward_ntt_to_montgomery_indexed_out
fhelium_ntt_ops::forward_ntt_to_montgomery_indexed_out(Tensor standard_residues, Tensor even_indices, Tensor odd_indices, Tensor forward_twiddles, Tensor rns_params, Tensor(a!) out) -> ()Out form of forward_ntt_to_montgomery_indexed: writes the transform of standard_residues to out, a Tensor of the same shape, dtype and device.
forward_ntt_montgomery_compact_
function View source
void fhelium::ntt::forward_ntt_montgomery_compact_(
at::Tensor& montgomery_residues,
const at::Tensor& forward_twiddles,
const at::Tensor& rns_params);2
3
4
Devices: CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.forward_ntt_montgomery_compact_
fhelium_ntt_ops::forward_ntt_montgomery_compact_(Tensor(a!) montgomery_residues, Tensor forward_twiddles, Tensor rns_params) -> ()Forward NTT of coefficient-domain Montgomery residues with compact twiddles, in place.
forward_ntt_to_montgomery_compact_
function View source
void fhelium::ntt::forward_ntt_to_montgomery_compact_(
at::Tensor& standard_residues,
const at::Tensor& forward_twiddles,
const at::Tensor& rns_params);2
3
4
Devices: CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.forward_ntt_to_montgomery_compact_
fhelium_ntt_ops::forward_ntt_to_montgomery_compact_(Tensor(a!) standard_residues, Tensor forward_twiddles, Tensor rns_params) -> ()Forward NTT of coefficient-domain standard residues with compact twiddles, in place.
forward_ntt_to_montgomery_compact
function View source
at::Tensor fhelium::ntt::forward_ntt_to_montgomery_compact(
const at::Tensor& standard_residues,
const at::Tensor& forward_twiddles,
const at::Tensor& rns_params);2
3
4
Devices: Any device
Torch operator: torch.ops.fhelium_ntt_ops.forward_ntt_to_montgomery_compact
fhelium_ntt_ops::forward_ntt_to_montgomery_compact(Tensor standard_residues, Tensor forward_twiddles, Tensor rns_params) -> TensorForward NTT of coefficient-domain standard residues with compact twiddles; returns a new Tensor.
forward_ntt_to_montgomery_compact_out
function View source
void fhelium::ntt::forward_ntt_to_montgomery_compact_out(
const at::Tensor& standard_residues,
const at::Tensor& forward_twiddles,
const at::Tensor& rns_params,
at::Tensor& out);2
3
4
5
Devices: CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.forward_ntt_to_montgomery_compact_out
fhelium_ntt_ops::forward_ntt_to_montgomery_compact_out(Tensor standard_residues, Tensor forward_twiddles, Tensor rns_params, Tensor(a!) out) -> ()Out form of forward_ntt_to_montgomery_compact: writes the transform of standard_residues to out, a Tensor of the same shape, dtype and device.
forward_ntt_to_montgomery_compact_add_scaled_
function View source
void fhelium::ntt::forward_ntt_to_montgomery_compact_add_scaled_(
at::Tensor& source,
const at::Tensor& addend,
const at::Tensor& multiplier,
const at::Tensor& forward_twiddles,
const at::Tensor& rns_params);2
3
4
5
6
Devices: CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.forward_ntt_to_montgomery_compact_add_scaled_
fhelium_ntt_ops::forward_ntt_to_montgomery_compact_add_scaled_(Tensor(a!) source, Tensor addend, Tensor multiplier, Tensor forward_twiddles, Tensor rns_params) -> ()Transforms a correction to the NTT domain and adds a scaled NTT addend in the same pass.
source holds coefficient-domain standard residues addend holds NTT-domain Montgomery residues source, and multiplier holds one Montgomery scalar forward_ntt_to_montgomery_compact_.
forward_ntt_montgomery_compact_keyswitch_accumulate_
function View source
void fhelium::ntt::forward_ntt_montgomery_compact_keyswitch_accumulate_(
at::Tensor& coefficient_digit_qp,
const at::Tensor& forward_twiddles,
const at::Tensor& rns_params,
const at::Tensor& key_digit_qp,
at::Tensor& accumulator0_qp,
at::Tensor& accumulator1_qp,
int64_t key_row_start,
int64_t key_p_row_start = -1);2
3
4
5
6
7
8
9
Devices: CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.forward_ntt_montgomery_compact_keyswitch_accumulate_
fhelium_ntt_ops::forward_ntt_montgomery_compact_keyswitch_accumulate_(Tensor(a!) coefficient_digit_qp, Tensor forward_twiddles, Tensor rns_params, Tensor key_digit_qp, Tensor(b!) accumulator0_qp, Tensor(c!) accumulator1_qp, int key_row_start, int key_p_row_start=-1) -> ()Transforms one coefficient-domain key-switching digit and accumulates its key products.
coefficient_digit_qp holds coefficient-domain Montgomery residues of one extended digit. The function computes its compact forward NTT key_digit_qp of shape [2, key_rows, N] and digit row key_row_start + r. coefficient_digit_qp serves as scratch storage; its contents after the call are unspecified.
forward_ntt_montgomery_power_of_two_radix_compact_
function View source
void fhelium::ntt::forward_ntt_montgomery_power_of_two_radix_compact_(
at::Tensor& montgomery_residues,
const at::Tensor& outer_twiddles,
const at::Tensor& radix_root_powers,
const at::Tensor& rns_params);2
3
4
5
Devices: CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.forward_ntt_montgomery_power_of_two_radix_compact_
fhelium_ntt_ops::forward_ntt_montgomery_power_of_two_radix_compact_(Tensor(a!) montgomery_residues, Tensor outer_twiddles, Tensor radix_root_powers, Tensor rns_params) -> ()Forward NTT of coefficient-domain Montgomery residues with power-of-two radix stages, in place.
forward_ntt_to_montgomery_power_of_two_radix_compact_
function View source
void fhelium::ntt::forward_ntt_to_montgomery_power_of_two_radix_compact_(
at::Tensor& standard_residues,
const at::Tensor& outer_twiddles,
const at::Tensor& radix_root_powers,
const at::Tensor& rns_params);2
3
4
5
Devices: CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.forward_ntt_to_montgomery_power_of_two_radix_compact_
fhelium_ntt_ops::forward_ntt_to_montgomery_power_of_two_radix_compact_(Tensor(a!) standard_residues, Tensor outer_twiddles, Tensor radix_root_powers, Tensor rns_params) -> ()Forward NTT of coefficient-domain standard residues with power-of-two radix stages, in place.
forward_ntt_to_montgomery_power_of_two_radix_compact
function View source
at::Tensor fhelium::ntt::forward_ntt_to_montgomery_power_of_two_radix_compact(
const at::Tensor& standard_residues,
const at::Tensor& outer_twiddles,
const at::Tensor& radix_root_powers,
const at::Tensor& rns_params);2
3
4
5
Devices: Any device
Torch operator: torch.ops.fhelium_ntt_ops.forward_ntt_to_montgomery_power_of_two_radix_compact
fhelium_ntt_ops::forward_ntt_to_montgomery_power_of_two_radix_compact(Tensor standard_residues, Tensor outer_twiddles, Tensor radix_root_powers, Tensor rns_params) -> TensorForward NTT of coefficient-domain standard residues with power-of-two radix stages; returns a new Tensor.
forward_ntt_to_montgomery_power_of_two_radix_compact_out
function View source
void fhelium::ntt::forward_ntt_to_montgomery_power_of_two_radix_compact_out(
const at::Tensor& standard_residues,
const at::Tensor& outer_twiddles,
const at::Tensor& radix_root_powers,
const at::Tensor& rns_params,
at::Tensor& out);2
3
4
5
6
Devices: CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.forward_ntt_to_montgomery_power_of_two_radix_compact_out
fhelium_ntt_ops::forward_ntt_to_montgomery_power_of_two_radix_compact_out(Tensor standard_residues, Tensor outer_twiddles, Tensor radix_root_powers, Tensor rns_params, Tensor(a!) out) -> ()Out form of forward_ntt_to_montgomery_power_of_two_radix_compact: writes the transform of standard_residues to out, a Tensor of the same shape, dtype and device.
inverse_ntt_montgomery_indexed_
function View source
void fhelium::ntt::inverse_ntt_montgomery_indexed_(
at::Tensor& montgomery_residues,
const at::Tensor& even_indices,
const at::Tensor& odd_indices,
const at::Tensor& inverse_twiddles,
const at::Tensor& rns_params);2
3
4
5
6
Devices: CPU, CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.inverse_ntt_montgomery_indexed_
fhelium_ntt_ops::inverse_ntt_montgomery_indexed_(Tensor(a!) montgomery_residues, Tensor even_indices, Tensor odd_indices, Tensor inverse_twiddles, Tensor rns_params) -> ()Inverse NTT with an indexed schedule, in place, producing coefficient-domain Montgomery residues in
inverse_ntt_to_standard_lazy_indexed_
function View source
void fhelium::ntt::inverse_ntt_to_standard_lazy_indexed_(
at::Tensor& montgomery_residues,
const at::Tensor& even_indices,
const at::Tensor& odd_indices,
const at::Tensor& inverse_twiddles,
const at::Tensor& rns_params);2
3
4
5
6
Devices: CPU, CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.inverse_ntt_to_standard_lazy_indexed_
fhelium_ntt_ops::inverse_ntt_to_standard_lazy_indexed_(Tensor(a!) montgomery_residues, Tensor even_indices, Tensor odd_indices, Tensor inverse_twiddles, Tensor rns_params) -> ()Inverse NTT with an indexed schedule, in place, producing coefficient-domain standard residues in
inverse_ntt_to_standard_indexed_
function View source
void fhelium::ntt::inverse_ntt_to_standard_indexed_(
at::Tensor& montgomery_residues,
const at::Tensor& even_indices,
const at::Tensor& odd_indices,
const at::Tensor& inverse_twiddles,
const at::Tensor& rns_params);2
3
4
5
6
Devices: CPU, CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.inverse_ntt_to_standard_indexed_
fhelium_ntt_ops::inverse_ntt_to_standard_indexed_(Tensor(a!) montgomery_residues, Tensor even_indices, Tensor odd_indices, Tensor inverse_twiddles, Tensor rns_params) -> ()Inverse NTT with an indexed schedule, in place, producing coefficient-domain standard residues in
inverse_ntt_to_centered_indexed_
function View source
void fhelium::ntt::inverse_ntt_to_centered_indexed_(
at::Tensor& montgomery_residues,
const at::Tensor& even_indices,
const at::Tensor& odd_indices,
const at::Tensor& inverse_twiddles,
const at::Tensor& rns_params);2
3
4
5
6
Devices: CPU, CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.inverse_ntt_to_centered_indexed_
fhelium_ntt_ops::inverse_ntt_to_centered_indexed_(Tensor(a!) montgomery_residues, Tensor even_indices, Tensor odd_indices, Tensor inverse_twiddles, Tensor rns_params) -> ()Inverse NTT with an indexed schedule, in place, producing coefficient-domain standard residues in the centered range.
inverse_ntt_montgomery_compact_
function View source
void fhelium::ntt::inverse_ntt_montgomery_compact_(
at::Tensor& montgomery_residues,
const at::Tensor& inverse_twiddles,
const at::Tensor& rns_params);2
3
4
Devices: CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.inverse_ntt_montgomery_compact_
fhelium_ntt_ops::inverse_ntt_montgomery_compact_(Tensor(a!) montgomery_residues, Tensor inverse_twiddles, Tensor rns_params) -> ()Inverse NTT with compact twiddles, in place, producing coefficient-domain Montgomery residues in
inverse_ntt_to_standard_lazy_compact_
function View source
void fhelium::ntt::inverse_ntt_to_standard_lazy_compact_(
at::Tensor& montgomery_residues,
const at::Tensor& inverse_twiddles,
const at::Tensor& rns_params);2
3
4
Devices: CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.inverse_ntt_to_standard_lazy_compact_
fhelium_ntt_ops::inverse_ntt_to_standard_lazy_compact_(Tensor(a!) montgomery_residues, Tensor inverse_twiddles, Tensor rns_params) -> ()Inverse NTT with compact twiddles, in place, producing coefficient-domain standard residues in
inverse_ntt_to_standard_compact_
function View source
void fhelium::ntt::inverse_ntt_to_standard_compact_(
at::Tensor& montgomery_residues,
const at::Tensor& inverse_twiddles,
const at::Tensor& rns_params);2
3
4
Devices: CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.inverse_ntt_to_standard_compact_
fhelium_ntt_ops::inverse_ntt_to_standard_compact_(Tensor(a!) montgomery_residues, Tensor inverse_twiddles, Tensor rns_params) -> ()Inverse NTT with compact twiddles, in place, producing coefficient-domain standard residues in
inverse_ntt_to_centered_compact_
function View source
void fhelium::ntt::inverse_ntt_to_centered_compact_(
at::Tensor& montgomery_residues,
const at::Tensor& inverse_twiddles,
const at::Tensor& rns_params);2
3
4
Devices: CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.inverse_ntt_to_centered_compact_
fhelium_ntt_ops::inverse_ntt_to_centered_compact_(Tensor(a!) montgomery_residues, Tensor inverse_twiddles, Tensor rns_params) -> ()Inverse NTT with compact twiddles, in place, producing coefficient-domain standard residues in the centered range.
inverse_ntt_montgomery_power_of_two_radix_compact_
function View source
void fhelium::ntt::inverse_ntt_montgomery_power_of_two_radix_compact_(
at::Tensor& montgomery_residues,
const at::Tensor& outer_twiddles,
const at::Tensor& radix_root_powers,
const at::Tensor& rns_params);2
3
4
5
Devices: CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.inverse_ntt_montgomery_power_of_two_radix_compact_
fhelium_ntt_ops::inverse_ntt_montgomery_power_of_two_radix_compact_(Tensor(a!) montgomery_residues, Tensor outer_twiddles, Tensor radix_root_powers, Tensor rns_params) -> ()Inverse NTT with power-of-two radix stages, in place, producing coefficient-domain Montgomery residues in
inverse_ntt_to_standard_lazy_power_of_two_radix_compact_
function View source
void fhelium::ntt::inverse_ntt_to_standard_lazy_power_of_two_radix_compact_(
at::Tensor& montgomery_residues,
const at::Tensor& outer_twiddles,
const at::Tensor& radix_root_powers,
const at::Tensor& rns_params);2
3
4
5
Devices: CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.inverse_ntt_to_standard_lazy_power_of_two_radix_compact_
fhelium_ntt_ops::inverse_ntt_to_standard_lazy_power_of_two_radix_compact_(Tensor(a!) montgomery_residues, Tensor outer_twiddles, Tensor radix_root_powers, Tensor rns_params) -> ()Inverse NTT with power-of-two radix stages, in place, producing coefficient-domain standard residues in
inverse_ntt_to_standard_power_of_two_radix_compact_
function View source
void fhelium::ntt::inverse_ntt_to_standard_power_of_two_radix_compact_(
at::Tensor& montgomery_residues,
const at::Tensor& outer_twiddles,
const at::Tensor& radix_root_powers,
const at::Tensor& rns_params);2
3
4
5
Devices: CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.inverse_ntt_to_standard_power_of_two_radix_compact_
fhelium_ntt_ops::inverse_ntt_to_standard_power_of_two_radix_compact_(Tensor(a!) montgomery_residues, Tensor outer_twiddles, Tensor radix_root_powers, Tensor rns_params) -> ()Inverse NTT with power-of-two radix stages, in place, producing coefficient-domain standard residues in
inverse_ntt_to_centered_power_of_two_radix_compact_
function View source
void fhelium::ntt::inverse_ntt_to_centered_power_of_two_radix_compact_(
at::Tensor& montgomery_residues,
const at::Tensor& outer_twiddles,
const at::Tensor& radix_root_powers,
const at::Tensor& rns_params);2
3
4
5
Devices: CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.inverse_ntt_to_centered_power_of_two_radix_compact_
fhelium_ntt_ops::inverse_ntt_to_centered_power_of_two_radix_compact_(Tensor(a!) montgomery_residues, Tensor outer_twiddles, Tensor radix_root_powers, Tensor rns_params) -> ()Inverse NTT with power-of-two radix stages, in place, producing coefficient-domain standard residues in the centered range.
validate_indexed_schedule
function View source
void fhelium::ntt::validate_indexed_schedule(
const at::Tensor& even_indices,
const at::Tensor& odd_indices,
int64_t ring_dimension);2
3
4
Devices: Any device
Torch operator: torch.ops.fhelium_ntt_ops.validate_indexed_schedule
fhelium_ntt_ops::validate_indexed_schedule(Tensor even_indices, Tensor odd_indices, int ring_dimension) -> ()Checks that an indexed NTT schedule is a valid radix-2 pairing for ring dimension ring_dimension.
even_indices and odd_indices are int32 Tensors of shape [stage, N/2] with ring_dimension. In every stage, the two Tensors together list each coefficient index in
fixed_radix_ntt_stage_range_
function View source
void fhelium::ntt::fixed_radix_ntt_stage_range_(
at::Tensor& residues,
const at::Tensor& outer_twiddles,
const at::Tensor& root_powers,
const at::Tensor& rns_params,
bool inverse,
int64_t start_stage,
int64_t end_stage);2
3
4
5
6
7
8
Devices: CUDA, HIP
Torch operator: torch.ops.fhelium_ntt_ops.fixed_radix_ntt_stage_range_
fhelium_ntt_ops::fixed_radix_ntt_stage_range_(Tensor(a!) residues, Tensor outer_twiddles, Tensor root_powers, Tensor rns_params, bool inverse, int start_stage, int end_stage) -> ()Executes a half-open interval of unnormalized power-of-two radix stages in place.
The interval [start_stage, end_stage) with start_stage end_stage inverse is true, inverse decimation-in-time stages, on Montgomery residues with outer_twiddles and root_powers in the power-of-two radix layout. start_stage and end_stage are multiples of